CrazyIter_Bin hai 1 ano
pai
achega
5668d5cc65
Modificáronse 53 ficheiros con 3709 adicións e 84 borrados
  1. 324 0
      HTEXMark/AISettingForm.Designer.cs
  2. 228 0
      HTEXMark/AISettingForm.cs
  3. 120 0
      HTEXMark/AISettingForm.resx
  4. 173 0
      HTEXMark/AI_Form.Designer.cs
  5. 206 0
      HTEXMark/AI_Form.cs
  6. 120 0
      HTEXMark/AI_Form.resx
  7. 44 1
      HTEXMark/HTEXMark.csproj
  8. 54 0
      HTEXMark/HttpClientHelper.cs
  9. 18 0
      HTEXMark/MarkLanguage.cs
  10. 13 12
      HTEXMark/MarkRibbon.Designer.cs
  11. 32 20
      HTEXMark/MarkRibbon.cs
  12. 10 0
      HTEXMark/Properties/Resources.Designer.cs
  13. 5 2
      HTEXMark/Properties/Resources.resx
  14. 5 5
      HTEXMark/Properties/Settings.Designer.cs
  15. 2 4
      HTEXMark/Properties/Settings.settings
  16. 21 8
      HTEXMark/QRCodeForm.cs
  17. 29 0
      HTEXMark/RichTextBoxEx.cs
  18. 28 0
      HTEXMark/Settings.cs
  19. 49 0
      HTEXMark/UserSettings.cs
  20. 2 0
      HTEXMark/app.config
  21. 52 3
      HTEXMark/lang.json
  22. 1 0
      HTEXMark/packages.config
  23. 244 0
      HTEXTeach/HTEXTeach.csproj
  24. 79 0
      HTEXTeach/MainRibbon.Designer.cs
  25. 16 0
      HTEXTeach/MainRibbon.cs
  26. 120 0
      HTEXTeach/MainRibbon.resx
  27. 38 0
      HTEXTeach/Properties/AssemblyInfo.cs
  28. 62 0
      HTEXTeach/Properties/Resources.Designer.cs
  29. 117 0
      HTEXTeach/Properties/Resources.resx
  30. 26 0
      HTEXTeach/Properties/Settings.Designer.cs
  31. 7 0
      HTEXTeach/Properties/Settings.settings
  32. 231 0
      HTEXTeach/ThisAddIn.Designer.cs
  33. 4 0
      HTEXTeach/ThisAddIn.Designer.xml
  34. 36 0
      HTEXTeach/ThisAddIn.cs
  35. 12 14
      HTEXWeb/Properties/launchSettings.json
  36. 0 1
      HTEXWordTest/Form1.cs
  37. 16 14
      HTEXWordTest/HTEXWordTest.csproj
  38. 246 0
      HTEXWordWps/HTEXWordWps.csproj
  39. 79 0
      HTEXWordWps/MarkRibbon.Designer.cs
  40. 16 0
      HTEXWordWps/MarkRibbon.cs
  41. 120 0
      HTEXWordWps/MarkRibbon.resx
  42. 38 0
      HTEXWordWps/Properties/AssemblyInfo.cs
  43. 62 0
      HTEXWordWps/Properties/Resources.Designer.cs
  44. 117 0
      HTEXWordWps/Properties/Resources.resx
  45. 26 0
      HTEXWordWps/Properties/Settings.Designer.cs
  46. 7 0
      HTEXWordWps/Properties/Settings.settings
  47. 237 0
      HTEXWordWps/ThisAddIn.Designer.cs
  48. 5 0
      HTEXWordWps/ThisAddIn.Designer.xml
  49. 36 0
      HTEXWordWps/ThisAddIn.cs
  50. 12 0
      HTEXWps/Class1.cs
  51. 86 0
      HTEXWps/HTEXWps.csproj
  52. 36 0
      HTEXWps/Properties/AssemblyInfo.cs
  53. 42 0
      TEAMModelHTEX.sln

+ 324 - 0
HTEXMark/AISettingForm.Designer.cs

@@ -0,0 +1,324 @@
+namespace HTEXMark
+{
+    partial class AISettingForm
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.panel1 = new System.Windows.Forms.Panel();
+            this.label1 = new System.Windows.Forms.Label();
+            this.radioButton1 = new System.Windows.Forms.RadioButton();
+            this.radioButton2 = new System.Windows.Forms.RadioButton();
+            this.panel2 = new System.Windows.Forms.Panel();
+            this.radioButton3 = new System.Windows.Forms.RadioButton();
+            this.comboBoxPeriod = new System.Windows.Forms.ComboBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.comboBoxSubject = new System.Windows.Forms.ComboBox();
+            this.panel3 = new System.Windows.Forms.Panel();
+            this.label5 = new System.Windows.Forms.Label();
+            this.comboBoxItemTypes = new System.Windows.Forms.ComboBox();
+            this.panel4 = new System.Windows.Forms.Panel();
+            this.panel5 = new System.Windows.Forms.Panel();
+            this.listBox_itemList = new System.Windows.Forms.ListBox();
+            this.richTextBoxEx1 = new HTEXMark.RichTextBoxEx();
+            this.button1 = new System.Windows.Forms.Button();
+            this.panel6 = new System.Windows.Forms.Panel();
+            this.radioButton4 = new System.Windows.Forms.RadioButton();
+            this.radioButton5 = new System.Windows.Forms.RadioButton();
+            this.label6 = new System.Windows.Forms.Label();
+            this.radioButton6 = new System.Windows.Forms.RadioButton();
+            this.panel1.SuspendLayout();
+            this.panel2.SuspendLayout();
+            this.panel3.SuspendLayout();
+            this.panel4.SuspendLayout();
+            this.panel5.SuspendLayout();
+            this.panel6.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // panel1
+            // 
+            this.panel1.Controls.Add(this.radioButton2);
+            this.panel1.Controls.Add(this.radioButton3);
+            this.panel1.Controls.Add(this.radioButton1);
+            this.panel1.Controls.Add(this.label1);
+            this.panel1.Location = new System.Drawing.Point(120, 0);
+            this.panel1.Name = "panel1";
+            this.panel1.Size = new System.Drawing.Size(663, 29);
+            this.panel1.TabIndex = 1;
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(6, 9);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(65, 12);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "题目归属:";
+            // 
+            // radioButton1
+            // 
+            this.radioButton1.AutoSize = true;
+            this.radioButton1.Checked = true;
+            this.radioButton1.Location = new System.Drawing.Point(77, 7);
+            this.radioButton1.Name = "radioButton1";
+            this.radioButton1.Size = new System.Drawing.Size(47, 16);
+            this.radioButton1.TabIndex = 1;
+            this.radioButton1.TabStop = true;
+            this.radioButton1.Text = "学校";
+            this.radioButton1.UseVisualStyleBackColor = true;
+            // 
+            // radioButton2
+            // 
+            this.radioButton2.AutoSize = true;
+            this.radioButton2.Location = new System.Drawing.Point(222, 7);
+            this.radioButton2.Name = "radioButton2";
+            this.radioButton2.Size = new System.Drawing.Size(47, 16);
+            this.radioButton2.TabIndex = 2;
+            this.radioButton2.Text = "个人";
+            this.radioButton2.UseVisualStyleBackColor = true;
+            // 
+            // panel2
+            // 
+            this.panel2.Controls.Add(this.comboBoxSubject);
+            this.panel2.Controls.Add(this.comboBoxPeriod);
+            this.panel2.Controls.Add(this.label3);
+            this.panel2.Location = new System.Drawing.Point(120, 29);
+            this.panel2.Name = "panel2";
+            this.panel2.Size = new System.Drawing.Size(663, 29);
+            this.panel2.TabIndex = 3;
+            // 
+            // radioButton3
+            // 
+            this.radioButton3.AutoSize = true;
+            this.radioButton3.Location = new System.Drawing.Point(365, 7);
+            this.radioButton3.Name = "radioButton3";
+            this.radioButton3.Size = new System.Drawing.Size(47, 16);
+            this.radioButton3.TabIndex = 2;
+            this.radioButton3.Text = "公开";
+            this.radioButton3.UseVisualStyleBackColor = true;
+            // 
+            // comboBoxPeriod
+            // 
+            this.comboBoxPeriod.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBoxPeriod.FormattingEnabled = true;
+            this.comboBoxPeriod.Location = new System.Drawing.Point(77, 6);
+            this.comboBoxPeriod.Name = "comboBoxPeriod";
+            this.comboBoxPeriod.Size = new System.Drawing.Size(121, 20);
+            this.comboBoxPeriod.TabIndex = 6;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(6, 9);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(65, 12);
+            this.label3.TabIndex = 5;
+            this.label3.Text = "学段学科:";
+            // 
+            // comboBoxSubject
+            // 
+            this.comboBoxSubject.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBoxSubject.FormattingEnabled = true;
+            this.comboBoxSubject.Location = new System.Drawing.Point(217, 6);
+            this.comboBoxSubject.Name = "comboBoxSubject";
+            this.comboBoxSubject.Size = new System.Drawing.Size(121, 20);
+            this.comboBoxSubject.TabIndex = 8;
+            // 
+            // panel3
+            // 
+            this.panel3.Controls.Add(this.comboBoxItemTypes);
+            this.panel3.Controls.Add(this.label5);
+            this.panel3.Location = new System.Drawing.Point(120, 58);
+            this.panel3.Name = "panel3";
+            this.panel3.Size = new System.Drawing.Size(663, 29);
+            this.panel3.TabIndex = 4;
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(6, 8);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(65, 12);
+            this.label5.TabIndex = 1;
+            this.label5.Text = "题目类型:";
+            // 
+            // comboBoxItemTypes
+            // 
+            this.comboBoxItemTypes.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBoxItemTypes.FormattingEnabled = true;
+            this.comboBoxItemTypes.Location = new System.Drawing.Point(77, 5);
+            this.comboBoxItemTypes.Name = "comboBoxItemTypes";
+            this.comboBoxItemTypes.Size = new System.Drawing.Size(121, 20);
+            this.comboBoxItemTypes.TabIndex = 9;
+            // 
+            // panel4
+            // 
+            this.panel4.Controls.Add(this.panel6);
+            this.panel4.Controls.Add(this.richTextBoxEx1);
+            this.panel4.Location = new System.Drawing.Point(120, 87);
+            this.panel4.Name = "panel4";
+            this.panel4.Size = new System.Drawing.Size(663, 153);
+            this.panel4.TabIndex = 5;
+            // 
+            // panel5
+            // 
+            this.panel5.Controls.Add(this.listBox_itemList);
+            this.panel5.Location = new System.Drawing.Point(0, 0);
+            this.panel5.Name = "panel5";
+            this.panel5.Size = new System.Drawing.Size(120, 261);
+            this.panel5.TabIndex = 6;
+            // 
+            // listBox_itemList
+            // 
+            this.listBox_itemList.FormattingEnabled = true;
+            this.listBox_itemList.ItemHeight = 12;
+            this.listBox_itemList.Location = new System.Drawing.Point(0, 0);
+            this.listBox_itemList.Name = "listBox_itemList";
+            this.listBox_itemList.Size = new System.Drawing.Size(120, 268);
+            this.listBox_itemList.TabIndex = 1;
+            // 
+            // richTextBoxEx1
+            // 
+            this.richTextBoxEx1.Location = new System.Drawing.Point(0, 31);
+            this.richTextBoxEx1.Name = "richTextBoxEx1";
+            this.richTextBoxEx1.PlaceHolder = "请输入题目描述信息......";
+            this.richTextBoxEx1.Size = new System.Drawing.Size(663, 122);
+            this.richTextBoxEx1.TabIndex = 0;
+            this.richTextBoxEx1.Text = "";
+            // 
+            // button1
+            // 
+            this.button1.Location = new System.Drawing.Point(119, 238);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(666, 26);
+            this.button1.TabIndex = 1;
+            this.button1.Text = "添加/更新";
+            this.button1.UseVisualStyleBackColor = true;
+            // 
+            // panel6
+            // 
+            this.panel6.Controls.Add(this.radioButton4);
+            this.panel6.Controls.Add(this.radioButton5);
+            this.panel6.Controls.Add(this.label6);
+            this.panel6.Controls.Add(this.radioButton6);
+            this.panel6.Location = new System.Drawing.Point(0, 0);
+            this.panel6.Name = "panel6";
+            this.panel6.Size = new System.Drawing.Size(663, 32);
+            this.panel6.TabIndex = 1;
+            // 
+            // radioButton4
+            // 
+            this.radioButton4.AutoSize = true;
+            this.radioButton4.Location = new System.Drawing.Point(222, 9);
+            this.radioButton4.Name = "radioButton4";
+            this.radioButton4.Size = new System.Drawing.Size(71, 16);
+            this.radioButton4.TabIndex = 12;
+            this.radioButton4.Text = "繁體中文";
+            this.radioButton4.UseVisualStyleBackColor = true;
+            // 
+            // radioButton5
+            // 
+            this.radioButton5.AutoSize = true;
+            this.radioButton5.Location = new System.Drawing.Point(365, 10);
+            this.radioButton5.Name = "radioButton5";
+            this.radioButton5.Size = new System.Drawing.Size(65, 16);
+            this.radioButton5.TabIndex = 11;
+            this.radioButton5.Text = "English";
+            this.radioButton5.UseVisualStyleBackColor = true;
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Location = new System.Drawing.Point(8, 11);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(65, 12);
+            this.label6.TabIndex = 13;
+            this.label6.Text = "语言设置:";
+            // 
+            // radioButton6
+            // 
+            this.radioButton6.AutoSize = true;
+            this.radioButton6.Checked = true;
+            this.radioButton6.Location = new System.Drawing.Point(79, 9);
+            this.radioButton6.Name = "radioButton6";
+            this.radioButton6.Size = new System.Drawing.Size(71, 16);
+            this.radioButton6.TabIndex = 10;
+            this.radioButton6.TabStop = true;
+            this.radioButton6.Text = "简体中文";
+            this.radioButton6.UseVisualStyleBackColor = true;
+            // 
+            // AISettingForm
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(784, 263);
+            this.Controls.Add(this.button1);
+            this.Controls.Add(this.panel5);
+            this.Controls.Add(this.panel4);
+            this.Controls.Add(this.panel3);
+            this.Controls.Add(this.panel2);
+            this.Controls.Add(this.panel1);
+            this.Name = "AISettingForm";
+            this.Text = "AI题目设置";
+            this.panel1.ResumeLayout(false);
+            this.panel1.PerformLayout();
+            this.panel2.ResumeLayout(false);
+            this.panel2.PerformLayout();
+            this.panel3.ResumeLayout(false);
+            this.panel3.PerformLayout();
+            this.panel4.ResumeLayout(false);
+            this.panel5.ResumeLayout(false);
+            this.panel6.ResumeLayout(false);
+            this.panel6.PerformLayout();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+        private System.Windows.Forms.Panel panel1;
+        private System.Windows.Forms.RadioButton radioButton2;
+        private System.Windows.Forms.RadioButton radioButton1;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Panel panel2;
+        private System.Windows.Forms.RadioButton radioButton3;
+        private System.Windows.Forms.ComboBox comboBoxPeriod;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.ComboBox comboBoxSubject;
+        private System.Windows.Forms.Panel panel3;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.ComboBox comboBoxItemTypes;
+        private System.Windows.Forms.Panel panel4;
+        private System.Windows.Forms.Panel panel5;
+        private System.Windows.Forms.ListBox listBox_itemList;
+        private System.Windows.Forms.Button button1;
+        private RichTextBoxEx richTextBoxEx1;
+        private System.Windows.Forms.Panel panel6;
+        private System.Windows.Forms.RadioButton radioButton4;
+        private System.Windows.Forms.RadioButton radioButton5;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.RadioButton radioButton6;
+    }
+}

+ 228 - 0
HTEXMark/AISettingForm.cs

@@ -0,0 +1,228 @@
+using Microsoft.IdentityModel.Tokens;
+using Microsoft.Office.Tools.Ribbon;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.IdentityModel.Tokens.Jwt;
+using System.Linq;
+using System.Net.Http;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using static HTEXMark.AI_Form;
+using static HTEXMark.QRCodeForm;
+
+namespace HTEXMark
+{
+    public partial class AISettingForm : Form
+    {
+        public string domain;
+        public MarkLanguage lang;
+        private HttpClient httpClient;
+        public List<IdCodeNameCount> periodSubjects = new List<IdCodeNameCount>();
+        
+        BindingList<CodeName> bindingList = new BindingList<CodeName>();
+        private RibbonDropDown schoolDropDown;
+        public AISettingForm(RibbonDropDown schoolDropDown,List<IdCodeNameCount> periodSubjects,    MarkLanguage lang, MarkRibbon markRibbon, string domain)
+        {
+            this.lang= lang;
+            this.periodSubjects = periodSubjects;
+            this.domain = domain;
+            this.schoolDropDown = schoolDropDown;
+            httpClient= HttpClientFactory.Create();
+            InitializeComponent();
+            this.Load+=FormLoad;
+        }
+        public class CodeName { 
+            public string code { get; set; }
+            public string name { get; set; }
+            public int order {  get; set; }
+        }
+
+        private  async void FormLoad(object sender, EventArgs e) {
+            var periodTypes = periodSubjects.Where(x => !string.IsNullOrWhiteSpace(x.periodType)).Select(z => z.periodType);
+
+            List<CodeName> periods = new List<CodeName>();
+            List<CodeName> subjects = new List<CodeName>();
+            List<ItemType> items = new List<ItemType>() {
+                new ItemType { name=lang.single,type= "single" },
+                new ItemType { name=lang.multiple,type= "multiple" },
+                new ItemType { name=lang.sortmultiple,type= "sortmultiple" },
+                new ItemType { name=lang.judge,type= "judge" },
+                new ItemType { name=lang.complete,type= "complete" },
+                new ItemType { name=lang.subjective,type= "subjective" },
+                new ItemType { name=lang.draw,type= "draw" },
+                new ItemType { name=lang.connector,type= "connector" },
+                new ItemType { name=lang.compose,type= "compose" },
+            };
+            comboBoxItemTypes.DataSource= items;
+            comboBoxItemTypes.DisplayMember="name";
+            comboBoxItemTypes.ValueMember="type";
+            if (periodTypes!=null  && periodTypes.Count()>0)
+            {
+                periods.Add(new CodeName { order= periodTypes.Contains("pre") ? 1 : 0, name= periodTypes.Contains("pre") ? lang.pre : lang.pre+lang.unmatched, code="pre" });
+                periods.Add(new CodeName { order= periodTypes.Contains("primary") ? 1 : 0, name= periodTypes.Contains("primary") ? lang.primary : lang.primary+lang.unmatched, code="primary" });
+                periods.Add(new CodeName { order= periodTypes.Contains("junior") ? 1 : 0, name= periodTypes.Contains("junior") ? lang.junior : lang.junior+lang.unmatched, code="junior" });
+                periods.Add(new CodeName { order = periodTypes.Contains("senior") ? 1 : 0, name = periodTypes.Contains("senior") ? lang.senior : lang.senior+lang.unmatched, code="senior" });
+                periods.Add(new CodeName { order = periodTypes.Contains("secondary") ? 1 : 0, name = periodTypes.Contains("secondary") ? lang.secondary : lang.secondary+lang.unmatched, code="secondary" });
+                periods.Add(new CodeName { order = periodTypes.Contains("college") ? 1 : 0, name = periodTypes.Contains("college") ? lang.college : lang.college+lang.unmatched, code="college" });
+                periods.Add(new CodeName { order = periodTypes.Contains("university") ? 1 : 0, name = periodTypes.Contains("university") ? lang.university : lang.university+lang.unmatched, code="university" });
+                periods.Add(new CodeName { order = periodTypes.Contains("special") ? 1 : 0, name = periodTypes.Contains("special") ? lang.special : lang.special+lang.unmatched, code="special" });
+                periods.Add(new CodeName { order= periodTypes.Contains("edu_bureau") ? 1 : 0, name= periodTypes.Contains("edu_bureau") ? lang.edu_bureau : lang.edu_bureau+lang.unmatched, code="edu_bureau" });
+                periods.Add(new CodeName { order= periodTypes.Contains("elecedu_dept") ? 1 : 0, name= periodTypes.Contains("elecedu_dept") ? lang.elecedu_dept : lang.elecedu_dept+lang.unmatched, code="elecedu_dept" });
+                periods.Add(new CodeName { order= periodTypes.Contains("adult_secondary") ? 1 : 0, name= periodTypes.Contains("adult_secondary") ? lang.adult_secondary : lang.adult_secondary+lang.unmatched, code="adult_secondary" });
+                periods.Add(new CodeName { order= periodTypes.Contains("adult_higher") ? 1 : 0, name= periodTypes.Contains("adult_higher") ? lang.adult_higher : lang.adult_higher+lang.unmatched, code="adult_higher" });
+                periods.Add(new CodeName { order= periodTypes.Contains("master") ? 1 : 0, name= periodTypes.Contains("master") ? lang.master : lang.master+lang.unmatched, code="master" });
+                periods.Add(new CodeName { order = periodTypes.Contains("doctor") ? 1 : 0, name = periodTypes.Contains("doctor") ? lang.doctor : lang.doctor+lang.unmatched, code="doctor" });
+                periods.Add(new CodeName { order = periodTypes.Contains("enterprise") ? 1 : 0, name = periodTypes.Contains("enterprise") ? lang.enterprise : lang.enterprise+lang.unmatched, code="enterprise" });
+                periods= periods.OrderByDescending(x => x.order).ToList();
+            }
+            else {
+                periods.Add(new CodeName { name= lang.pre+lang.unmatched, code="pre"});
+                periods.Add(new CodeName { name= lang.primary+lang.unmatched, code="primary" });
+                periods.Add(new CodeName { name= lang.junior+lang.unmatched, code="junior" });
+                periods.Add(new CodeName { name= lang.senior + lang.unmatched, code="senior" });
+                periods.Add(new CodeName { name= lang.secondary + lang.unmatched, code="secondary" });
+                periods.Add(new CodeName { name= lang.college + lang.unmatched, code="college" });
+                periods.Add(new CodeName { name= lang.university +lang.unmatched, code="university" });
+                periods.Add(new CodeName { name= lang.special+lang.unmatched, code="special" });
+                periods.Add(new CodeName { name= lang.edu_bureau+lang.unmatched, code="edu_bureau" });
+                periods.Add(new CodeName { name= lang.elecedu_dept+lang.unmatched, code="elecedu_dept" });
+                periods.Add(new CodeName { name= lang.adult_secondary + lang.unmatched, code="adult_secondary" });
+                periods.Add(new CodeName { name= lang.adult_higher + lang.unmatched, code="adult_higher" });
+                periods.Add(new CodeName { name= lang.master+lang.unmatched, code="master" });
+                periods.Add(new CodeName { name= lang.doctor + lang.unmatched, code="doctor" });
+                periods.Add(new CodeName { name= lang.enterprise+lang.unmatched, code="enterprise" });
+            }
+            var period = periods.First();
+            if (period.order==1){
+               var subject=  periodSubjects.FindAll(x => x.periodType.Equals(period.code));
+                if (subject!=null) {
+                    subject.ForEach(x => {
+                        subjects.Add(new CodeName { name=x.subjectName, code=x.subjectId });
+                    });
+
+                    bindingList = new BindingList<CodeName>(subjects);
+                    comboBoxSubject.DataSource=bindingList;
+                    comboBoxSubject.DisplayMember="name";
+                    comboBoxSubject.ValueMember="code";
+                }
+            }
+            comboBoxPeriod.DataSource=periods;
+            comboBoxPeriod.DisplayMember="name";
+            comboBoxPeriod.ValueMember="code";
+            comboBoxPeriod.SelectedIndexChanged+=PeriodSelectedIndexChanged;
+            string schoolId = schoolDropDown.SelectedItem.Tag.ToString() ;
+            string aidomian = "https://appraisal-test.teammodel.cn";
+            var  tokenData = await HttpClientHelper. CheckToken(UserSettings.Default.access_token, domain, UserSettings.Default.x_auth_token, httpClient);
+            if (tokenData.ok) {
+                httpClient= tokenData.httpClient;
+                ///school admin
+                ///
+                List<AiApp> apps =new List<AiApp>();
+                var jwt = new JwtSecurityToken(UserSettings.Default.x_auth_token);
+                jwt.Payload.TryGetValue("roles", out object _roles);
+                List<string> roles = JsonSerializer.Deserialize<List<string>>($"{_roles}");
+                if (roles.Contains("admin")  &&!string.IsNullOrWhiteSpace(jwt.Payload.Azp))
+                {
+                    try {
+                        var response = await httpClient.PostAsJsonAsync($"{aidomian}/ai/app/list", new { scope = "school", });
+                        if (response.IsSuccessStatusCode)
+                        {
+                            string content = await response.Content.ReadAsStringAsync();
+                            var json = JsonSerializer.Deserialize<JsonElement>(content);
+                            json.TryGetProperty("data", out JsonElement _json);
+                            var aiApps = JsonSerializer.Deserialize<List<AiApp>>(_json);
+                            if (!aiApps.IsNullOrEmpty()) { 
+                                apps.AddRange(aiApps);
+                            }
+                        }
+                    } catch (Exception ex) { }
+                }
+                if (jwt.Payload.Sub.Contains("1595321354"))
+                {
+                    try {
+                        var response = await httpClient.PostAsJsonAsync($"{aidomian}/ai/app/list", new { scope = "public", });
+                        if (response.IsSuccessStatusCode)
+                        {
+                            string content = await response.Content.ReadAsStringAsync(); 
+                            var json = JsonSerializer.Deserialize<JsonElement>(content);
+                            json.TryGetProperty("data", out JsonElement _json);
+                            var aiApps = JsonSerializer.Deserialize<List<AiApp>>(_json);
+                            if (!aiApps.IsNullOrEmpty())
+                            {
+                                apps.AddRange(aiApps);
+                            }
+                        }
+                    } catch (Exception ex ) { }
+                }
+                {
+                    try
+                    {
+                        var response = await httpClient.PostAsJsonAsync($"{aidomian}/ai/app/list", new { scope = "private", });
+                        if (response.IsSuccessStatusCode)
+                        {
+                            string content = await response.Content.ReadAsStringAsync();
+                            var json = JsonSerializer.Deserialize<JsonElement>(content);
+                            json.TryGetProperty("data", out JsonElement _json);
+                            var aiApps = JsonSerializer.Deserialize<List<AiApp>>(_json);
+                            if (!aiApps.IsNullOrEmpty())
+                            {
+                                apps.AddRange(aiApps);
+                            }
+                        }
+                    }
+                    catch (Exception ex) { }
+                }
+                listBox_itemList.DataSource = apps;
+                listBox_itemList.DisplayMember="name";
+                listBox_itemList.ValueMember="id";
+            }
+        }
+
+
+        public class AiApp 
+        { 
+            public string id { get; set; }
+            public string code { get; set; }
+            public string schoolId { get; set; }
+            public string icon { get; set; }
+            public string name  { get; set; }
+            public string bizType { get; set; }
+            public string scope { get; set; }
+            public string lang { get; set; }
+            public string itemType { get; set; }
+            public string period { get; set; }
+            public string subject { get; set; }
+            public string description { get; set; }
+            public string prompt { get; set; }
+            public string creator { get; set; }
+            public string creatorId { get; set; }
+            public long createTime { get; set; }
+        }
+        private void PeriodSelectedIndexChanged(object sender, EventArgs e)
+        {
+           // comboBoxSubject.Items.Clear();
+            List<CodeName> subjects = new List<CodeName>();
+            CodeName period =(CodeName) comboBoxPeriod.SelectedItem;
+            if (period.order==1)
+            {
+                var subject = periodSubjects.FindAll(x => x.periodType.Equals(period.code));
+                if (subject!=null)
+                {
+                    subject.ForEach(x => {
+                        subjects.Add(new CodeName { name=x.subjectName, code=x.subjectId });
+                    });
+                }
+            }
+            comboBoxSubject.SelectedItem=null;
+            bindingList = new BindingList<CodeName>(subjects);
+            comboBoxSubject.DataSource=bindingList;
+            comboBoxSubject.DisplayMember="name";
+            comboBoxSubject.ValueMember="code";
+        }
+    }
+}

+ 120 - 0
HTEXMark/AISettingForm.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 173 - 0
HTEXMark/AI_Form.Designer.cs

@@ -0,0 +1,173 @@
+using HTEXMark.Properties;
+
+namespace HTEXMark
+{
+    partial class AI_Form
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.webView21 = new Microsoft.Web.WebView2.WinForms.WebView2();
+            this.addAIItem = new System.Windows.Forms.Button();
+            this.comboBox_item_type = new System.Windows.Forms.ComboBox();
+            this.numericUpDownItemCount = new System.Windows.Forms.NumericUpDown();
+            this.comboBox_subject = new System.Windows.Forms.ComboBox();
+            this.genAIItem = new System.Windows.Forms.Button();
+            this.button_AI_Option = new System.Windows.Forms.Button();
+            this.richTextBoxEx = new HTEXMark.RichTextBoxEx();
+            ((System.ComponentModel.ISupportInitialize)(this.webView21)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.numericUpDownItemCount)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // webView21
+            // 
+            this.webView21.AllowExternalDrop = true;
+            this.webView21.CreationProperties = null;
+            this.webView21.DefaultBackgroundColor = System.Drawing.Color.White;
+            this.webView21.Location = new System.Drawing.Point(0, 107);
+            this.webView21.Name = "webView21";
+            this.webView21.Size = new System.Drawing.Size(800, 505);
+            this.webView21.TabIndex = 0;
+            this.webView21.ZoomFactor = 1D;
+            // 
+            // addAIItem
+            // 
+            this.addAIItem.Location = new System.Drawing.Point(52, 81);
+            this.addAIItem.Name = "addAIItem";
+            this.addAIItem.Size = new System.Drawing.Size(39, 23);
+            this.addAIItem.TabIndex = 1;
+            this.addAIItem.Text = "Add";
+            this.addAIItem.UseVisualStyleBackColor = true;
+            this.addAIItem.Click += new System.EventHandler(this.AddAIItem_Click);
+            // 
+            // comboBox_item_type
+            // 
+            this.comboBox_item_type.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox_item_type.FormattingEnabled = true;
+            this.comboBox_item_type.Location = new System.Drawing.Point(7, 29);
+            this.comboBox_item_type.Name = "comboBox_item_type";
+            this.comboBox_item_type.Size = new System.Drawing.Size(136, 20);
+            this.comboBox_item_type.TabIndex = 2;
+            // 
+            // numericUpDownItemCount
+            // 
+            this.numericUpDownItemCount.Location = new System.Drawing.Point(7, 55);
+            this.numericUpDownItemCount.Maximum = new decimal(new int[] {
+            20,
+            0,
+            0,
+            0});
+            this.numericUpDownItemCount.Minimum = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+            this.numericUpDownItemCount.Name = "numericUpDownItemCount";
+            this.numericUpDownItemCount.Size = new System.Drawing.Size(137, 21);
+            this.numericUpDownItemCount.TabIndex = 3;
+            this.numericUpDownItemCount.Tag = "数量";
+            this.numericUpDownItemCount.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            this.numericUpDownItemCount.Value = new decimal(new int[] {
+            5,
+            0,
+            0,
+            0});
+            // 
+            // comboBox_subject
+            // 
+            this.comboBox_subject.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox_subject.FormattingEnabled = true;
+            this.comboBox_subject.Location = new System.Drawing.Point(7, 4);
+            this.comboBox_subject.Name = "comboBox_subject";
+            this.comboBox_subject.Size = new System.Drawing.Size(136, 20);
+            this.comboBox_subject.TabIndex = 5;
+            // 
+            // genAIItem
+            // 
+            this.genAIItem.Location = new System.Drawing.Point(7, 81);
+            this.genAIItem.Name = "genAIItem";
+            this.genAIItem.Size = new System.Drawing.Size(39, 23);
+            this.genAIItem.TabIndex = 6;
+            this.genAIItem.Text = "Gen";
+            this.genAIItem.UseVisualStyleBackColor = true;
+            this.genAIItem.Click += new System.EventHandler(this.GenAIItem_Click);
+            // 
+            // button_AI_Option
+            // 
+            this.button_AI_Option.Font = new System.Drawing.Font("宋体", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.button_AI_Option.Location = new System.Drawing.Point(97, 81);
+            this.button_AI_Option.Name = "button_AI_Option";
+            this.button_AI_Option.Size = new System.Drawing.Size(47, 23);
+            this.button_AI_Option.TabIndex = 7;
+            this.button_AI_Option.Text = "Option";
+            this.button_AI_Option.UseVisualStyleBackColor = true;
+            this.button_AI_Option.Click += new System.EventHandler(this.Button_AI_Option_Click);
+            // 
+            // richTextBoxEx
+            // 
+            this.richTextBoxEx.Location = new System.Drawing.Point(150, 1);
+            this.richTextBoxEx.Name = "richTextBoxEx";
+            this.richTextBoxEx.PlaceHolder = "请输入题目描述信息......";
+            this.richTextBoxEx.Size = new System.Drawing.Size(649, 105);
+            this.richTextBoxEx.TabIndex = 4;
+            this.richTextBoxEx.Text = "";
+            // 
+            // AI_Form
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(800, 612);
+            this.Controls.Add(this.button_AI_Option);
+            this.Controls.Add(this.genAIItem);
+            this.Controls.Add(this.comboBox_subject);
+            this.Controls.Add(this.richTextBoxEx);
+            this.Controls.Add(this.numericUpDownItemCount);
+            this.Controls.Add(this.comboBox_item_type);
+            this.Controls.Add(this.addAIItem);
+            this.Controls.Add(this.webView21);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
+            this.MaximizeBox = false;
+            this.MinimizeBox = false;
+            this.Name = "AI_Form";
+            this.Text = "AI生成题目";
+            ((System.ComponentModel.ISupportInitialize)(this.webView21)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.numericUpDownItemCount)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private Microsoft.Web.WebView2.WinForms.WebView2 webView21;
+        private System.Windows.Forms.Button addAIItem;
+        private System.Windows.Forms.ComboBox comboBox_item_type;
+        private System.Windows.Forms.NumericUpDown numericUpDownItemCount;
+        private RichTextBoxEx  richTextBoxEx;
+        private System.Windows.Forms.ComboBox comboBox_subject;
+        private System.Windows.Forms.Button genAIItem;
+        private System.Windows.Forms.Button button_AI_Option;
+    }
+}

+ 206 - 0
HTEXMark/AI_Form.cs

@@ -0,0 +1,206 @@
+using Microsoft.Office.Tools.Ribbon;
+using Microsoft.Web.WebView2.Core;
+using PdfSharp.Drawing;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Diagnostics;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Net.Http.Headers;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using static HTEXMark.QRCodeForm;
+
+namespace HTEXMark
+{
+    public partial class AI_Form : Form
+    {
+        public RibbonButton ai_button;
+        public RibbonButton user_button;
+        public MarkLanguage lang;
+        public MarkRibbon markRibbon;
+        public RibbonDropDown schoolDropDown;
+        public RibbonDropDown subjectDropDown;
+        public string domain;
+        private HttpClient httpClient;
+        public List<IdCodeNameCount> periodSubjects = new List<IdCodeNameCount>();
+        public AI_Form(List<IdCodeNameCount> periodSubjects, RibbonButton ai_button, RibbonButton user_button, RibbonDropDown schoolDropDown, RibbonDropDown subjectDropDown, MarkLanguage lang, MarkRibbon markRibbon, Microsoft.Office.Tools.CustomTaskPane customTaskPane, string domain)
+        {
+            this.ai_button=ai_button;
+            this.user_button=user_button;
+            this.lang = lang;
+            this.markRibbon = markRibbon;
+            this.schoolDropDown=schoolDropDown;
+            this.subjectDropDown=subjectDropDown;
+            this.periodSubjects=periodSubjects;
+            this.httpClient=HttpClientFactory.Create();
+            InitializeComponent();
+            this.Load+=FormLoad;
+            this.domain=domain;
+            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.AI_FormClosed);
+        }
+
+        public class ItemType {
+            public string name { get; set; }
+            public string type { get; set; }
+        }
+
+        private async void FormLoad(object sender, EventArgs e)
+        {
+            List<ItemType> items = new List<ItemType>() {
+                new ItemType { name=lang.single,type= "single" },
+                new ItemType { name=lang.multiple,type= "multiple" },
+                new ItemType { name=lang.sortmultiple,type= "sortmultiple" },
+                new ItemType { name=lang.judge,type= "judge" },
+                new ItemType { name=lang.complete,type= "complete" },
+                new ItemType { name=lang.subjective,type= "subjective" },
+                new ItemType { name=lang.draw,type= "draw" },
+                new ItemType { name=lang.connector,type= "connector" },
+                new ItemType { name=lang.compose,type= "compose" },
+            };
+            comboBox_item_type.DataSource= items;
+            comboBox_item_type.DisplayMember="name";
+            comboBox_item_type.ValueMember="type";
+            comboBox_subject.DataSource= periodSubjects;
+            comboBox_subject.DisplayMember="name";
+            comboBox_subject.ValueMember="periodType";
+            //  this.Text = lang.ai_title;
+            //  Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions options = new Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions();
+            //options.AdditionalBrowserArguments = "--disable-web-security"; // 仅在开发/测试中使用,禁用同源策略
+            //Microsoft.Web.WebView2.Core.CoreWebView2Environment env = await Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(null, null, options);
+
+            var userDataFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Temp/webview2_temp");
+            var environment = await CoreWebView2Environment.CreateAsync(null, userDataFolder);
+            await webView21.EnsureCoreWebView2Async(environment);
+            // await SparkAI("");
+            // webView2.Source = new Uri("https://www.baidu.com");
+            if (webView21 != null)
+            {
+
+                //webView21.Source = new Uri("about:blank"); // 设置源 URL
+
+                //  webView21.NavigationCompleted += WebView_NavigationCompleted; // 导航完成事件处理函数
+
+                // string htmlContent = "<html><body><h1>Hello World!</h1></body></html>"; // 自定义 HTML 内容
+                // webView21.NavigateToString(htmlContent); // 通过字符串形式传入 HTML 内容
+                await SparkAI("");
+            }
+        }
+        private void WebView_NavigationCompleted(object sender, CoreWebView2NavigationCompletedEventArgs e)
+        {
+            // 当导航完成时触发该事件,此时可以对 WebView2 进行更多操作
+            Console.WriteLine($"Navigation completed with status code: {e}");
+        }
+        private async Task SparkAI(string name)
+        {
+            webView21.Source = new Uri("about:blank"); // 设置源 URL
+            // InsertHtmlIntoWord(wordApp, processedHtml);
+            string url = "https://appraisal-test.teammodel.cn/ai/chat/completion";
+            if (QRCodeForm.token!= null)
+            {
+                var checkResult = await HttpClientHelper.CheckToken(UserSettings.Default.access_token, domain, UserSettings.Default.x_auth_token, httpClient);
+                if (checkResult.ok)
+                {
+                    QRCodeForm.token.access_token= checkResult.AuthorizationToken;
+                    StringBuilder data = new StringBuilder();
+                    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
+                    var content = new StringContent(JsonSerializer.Serialize(new { appId = "533233bf-4605-4264-ab2d-e57a8084767a", sessionId = "", text = "请按照模板创建10个小学数学题" }), Encoding.UTF8, "application/json");
+
+                    var httpreq = new HttpRequestMessage(HttpMethod.Post, url) { Content = content };
+                    checkResult.httpClient.DefaultRequestHeaders.AcceptCharset.Add(new StringWithQualityHeaderValue("utf-8"));
+                    var response = await checkResult.httpClient.SendAsync(httpreq, HttpCompletionOption.ResponseHeadersRead);
+
+                    // 读取响应内容的异步流
+                    using (var responseStream = await response.Content.ReadAsStreamAsync())
+                    {
+                        //Debug.Print("============start response use minseconds=" + (DateTime.Now - d).TotalMilliseconds + "  =================\r\n");
+                        // 逐块读取并处理响应内容
+                        var buffer = new byte[102];
+                        int bytesRead;
+                        while ((bytesRead = await responseStream.ReadAsync(buffer, 0, buffer.Length)) > 0)
+                        {
+                            // 处理响应内容
+                            string contentData = System.Text.Encoding.UTF8.GetString(buffer, 0, bytesRead);
+
+
+                            if (contentData.Contains("data:"))
+                            {
+                                contentData = contentData.Replace("data:", "").Replace("[DONE]", "");
+
+                            }
+                            if (contentData.Contains("[DONE]"))
+                            {
+                                contentData = contentData.Replace("data:", "").Replace("[DONE]", "");
+
+                            }
+                            data.Append(contentData);
+                            webView21.NavigateToString(data.ToString());
+                            var webView2 = webView21.CoreWebView2;
+                            await webView2.ExecuteScriptAsync("window.scrollTo(0, document.body.scrollHeight);");
+                        }
+                    }
+                    webView21.NavigationCompleted += WebView_NavigationCompleted; // 导航完成事件处理函数
+                }
+                else { MessageBox.Show(lang.unlogin); }
+            }
+            else { MessageBox.Show(lang.unlogin); }
+        }
+
+        private   void AI_FormClosed(object sender, FormClosedEventArgs e) {
+            
+        }
+
+        private async void AddAIItem_Click(object sender, EventArgs e)
+        {
+            // 使用 JavaScript 选择整个网页内容
+            await webView21.CoreWebView2.ExecuteScriptAsync("document.execCommand('selectall')");
+            // 使用 JavaScript 复制选定的内容到剪贴板
+            await webView21.CoreWebView2.ExecuteScriptAsync("document.execCommand('copy')");
+            IDataObject dataObject = Clipboard.GetDataObject();
+
+            // 检查是否有图像数据
+            if (dataObject != null && dataObject.GetDataPresent(DataFormats.Bitmap))
+            {
+                // 如果有图像数据,粘贴图像
+                Bitmap bitmap = (Bitmap)dataObject.GetData(DataFormats.Bitmap);
+                Globals.ThisAddIn.Application.ActiveDocument.Application.Selection.InlineShapes.AddPicture("", false, true).Range.PasteSpecial(DataType: Microsoft.Office.Interop.Word.WdPasteDataType.wdPasteBitmap);
+            }
+            else
+            {
+                // 如果没有图像数据,可以尝试其他格式的粘贴
+                Globals.ThisAddIn.Application.ActiveDocument.Application.Selection.Paste();
+            }
+        }
+
+        private void GenAIItem_Click(object sender, EventArgs e)
+        {
+            if (!string.IsNullOrWhiteSpace(richTextBoxEx.Text)  && comboBox_subject.SelectedItem!=null  &&  comboBox_item_type.SelectedItem!=null) { 
+                
+            }
+        }
+        public void CenterFormOnScreen(Control qrCodeForm)
+        {
+            // 获取屏幕的工作区域
+            var workingArea = System.Windows.Forms.Screen.GetWorkingArea(qrCodeForm);
+            // 计算窗体应该显示的位置
+            int x = (workingArea.Width - qrCodeForm.Width) / 2 + workingArea.Left;
+            int y = (workingArea.Height - qrCodeForm.Height) / 2 + workingArea.Top;
+            // 设置窗体位置
+            qrCodeForm.Location = new System.Drawing.Point(x, y);
+        }
+       
+        private void Button_AI_Option_Click(object sender, EventArgs e)
+        {
+            AISettingForm settingForm = new AISettingForm(schoolDropDown, periodSubjects,lang,markRibbon,domain);
+            CenterFormOnScreen(settingForm);
+            settingForm.ShowDialog();
+        }
+    }
+}

+ 120 - 0
HTEXMark/AI_Form.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 44 - 1
HTEXMark/HTEXMark.csproj

@@ -29,6 +29,8 @@
     <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
     <DefineConstants>VSTO40</DefineConstants>
     <IsWebBootstrapper>False</IsWebBootstrapper>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
     <BootstrapperEnabled>true</BootstrapperEnabled>
     <PublishUrl>publish\</PublishUrl>
     <InstallUrl />
@@ -144,6 +146,15 @@
     <Reference Include="Microsoft.IdentityModel.Tokens, Version=7.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
       <HintPath>F:\NuGet\packages\Microsoft.IdentityModel.Tokens.7.2.0\lib\net472\Microsoft.IdentityModel.Tokens.dll</HintPath>
     </Reference>
+    <Reference Include="Microsoft.Web.WebView2.Core, Version=1.0.2210.55, Culture=neutral, PublicKeyToken=2a8ab48044d2601e, processorArchitecture=MSIL">
+      <HintPath>F:\NuGet\packages\Microsoft.Web.WebView2.1.0.2210.55\lib\net45\Microsoft.Web.WebView2.Core.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.Web.WebView2.WinForms, Version=1.0.2210.55, Culture=neutral, PublicKeyToken=2a8ab48044d2601e, processorArchitecture=MSIL">
+      <HintPath>F:\NuGet\packages\Microsoft.Web.WebView2.1.0.2210.55\lib\net45\Microsoft.Web.WebView2.WinForms.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.Web.WebView2.Wpf, Version=1.0.2210.55, Culture=neutral, PublicKeyToken=2a8ab48044d2601e, processorArchitecture=MSIL">
+      <HintPath>F:\NuGet\packages\Microsoft.Web.WebView2.1.0.2210.55\lib\net45\Microsoft.Web.WebView2.Wpf.dll</HintPath>
+    </Reference>
     <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL" />
     <Reference Include="PdfSharp, Version=1.50.4000.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
       <HintPath>F:\NuGet\packages\PDFsharp.1.50.4000-beta3b\lib\net20\PdfSharp.dll</HintPath>
@@ -293,6 +304,19 @@
     can be found.
   -->
   <ItemGroup>
+    <Compile Include="AISettingForm.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="AISettingForm.Designer.cs">
+      <DependentUpon>AISettingForm.cs</DependentUpon>
+    </Compile>
+    <Compile Include="AI_Form.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="AI_Form.Designer.cs">
+      <DependentUpon>AI_Form.cs</DependentUpon>
+    </Compile>
+    <Compile Include="HttpClientHelper.cs" />
     <Compile Include="KnowledgeUserControl.cs">
       <SubType>UserControl</SubType>
     </Compile>
@@ -311,6 +335,13 @@
     <Compile Include="Properties\AssemblyInfo.cs">
       <SubType>Code</SubType>
     </Compile>
+    <Compile Include="UserSettings.cs" />
+    <EmbeddedResource Include="AISettingForm.resx">
+      <DependentUpon>AISettingForm.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="AI_Form.resx">
+      <DependentUpon>AI_Form.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="KnowledgeUserControl.resx">
       <DependentUpon>KnowledgeUserControl.cs</DependentUpon>
     </EmbeddedResource>
@@ -345,6 +376,7 @@
     <Compile Include="Properties\Settings.Designer.cs">
       <AutoGen>True</AutoGen>
       <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
     </Compile>
     <Compile Include="QRCodeForm.cs">
       <SubType>Form</SubType>
@@ -352,6 +384,10 @@
     <Compile Include="QRCodeForm.Designer.cs">
       <DependentUpon>QRCodeForm.cs</DependentUpon>
     </Compile>
+    <Compile Include="RichTextBoxEx.cs">
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="Settings.cs" />
     <Compile Include="ThisAddIn.cs">
       <SubType>Code</SubType>
     </Compile>
@@ -433,9 +469,16 @@
       <FlavorProperties GUID="{BAA0C2D2-18E2-41B9-852F-F413020CAA33}">
         <ProjectProperties HostName="Word" HostPackage="{29A7B9D7-A7F1-4328-8EF0-6B2D1A56B2C1}" OfficeVersion="15.0" VstxVersion="4.0" ApplicationType="Word" Language="cs" TemplatesPath="" DebugInfoExeName="#Software\Microsoft\Office\16.0\Word\InstallRoot\Path#WINWORD.EXE" DebugInfoCommandLine="/x" AddItemTemplatesGuid="{51063C3A-E220-4D12-8922-BDA915ACD783}" />
         <Host Name="Word" GeneratedCodeNamespace="HTEXMark" PublishedHash="69C324AB27932AA2FBF2B7EA72250886FF164DE6" IconIndex="0">
-          <HostItem Name="ThisAddIn" Code="ThisAddIn.cs" CanonicalName="AddIn" CanActivate="false" IconIndex="1" Blueprint="ThisAddIn.Designer.xml" GeneratedCode="ThisAddIn.Designer.cs" PublishedHash="AA0118D4DD3E7D57827217845DDCCFD42750B25B" />
+          <HostItem Name="ThisAddIn" Code="ThisAddIn.cs" CanonicalName="AddIn" PublishedHash="AA0118D4DD3E7D57827217845DDCCFD42750B25B" CanActivate="false" IconIndex="1" Blueprint="ThisAddIn.Designer.xml" GeneratedCode="ThisAddIn.Designer.cs" />
         </Host>
       </FlavorProperties>
     </VisualStudio>
   </ProjectExtensions>
+  <Import Project="F:\NuGet\packages\Microsoft.Web.WebView2.1.0.2210.55\build\Microsoft.Web.WebView2.targets" Condition="Exists('F:\NuGet\packages\Microsoft.Web.WebView2.1.0.2210.55\build\Microsoft.Web.WebView2.targets')" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('F:\NuGet\packages\Microsoft.Web.WebView2.1.0.2210.55\build\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', 'F:\NuGet\packages\Microsoft.Web.WebView2.1.0.2210.55\build\Microsoft.Web.WebView2.targets'))" />
+  </Target>
 </Project>

+ 54 - 0
HTEXMark/HttpClientHelper.cs

@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.IdentityModel.Tokens.Jwt;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+using ZXing.Aztec.Internal;
+
+namespace HTEXMark
+{
+    public static class HttpClientHelper
+    {
+        public static async Task<(HttpClient httpClient,string AuthorizationToken,bool ok)> CheckToken (string AuthorizationToken,string domian ,string X_Auth_Authtoken, HttpClient httpClient)
+        {
+            bool ok = false;
+            long now =DateTimeOffset.Now.ToUnixTimeSeconds();
+            var jwt = new JwtSecurityToken(AuthorizationToken);
+            if (!httpClient.DefaultRequestHeaders.Contains("X-Auth-Authtoken"))
+            {
+                httpClient.DefaultRequestHeaders.Add("X-Auth-Authtoken", X_Auth_Authtoken);
+            }
+            if (jwt.Payload.Expiration.HasValue  && jwt.Payload.Expiration.Value>now)
+            {
+                if (httpClient.DefaultRequestHeaders.Contains("Authorization"))
+                {
+                    httpClient.DefaultRequestHeaders.Remove("Authorization");
+                }
+                httpClient.DefaultRequestHeaders.Add("Authorization",$"Bearer {AuthorizationToken}" );
+                ok = true;
+            }
+            else {
+                ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
+                string url = $"https://{domian}/hita/refresh-access-token";
+                var  response =  await httpClient.PostAsJsonAsync(url, new Dictionary<string, string> { { "refresh-token", AuthorizationToken } });
+                if (response.IsSuccessStatusCode) {
+                    string content = await response.Content.ReadAsStringAsync();
+                    JsonElement json = JsonSerializer.Deserialize<JsonElement>(content);
+                    if (json.TryGetProperty("code", out JsonElement _code)&& $"{_code}".Equals("200")  && json.TryGetProperty("access_token", out JsonElement _access_token)) {
+                        AuthorizationToken= _access_token.GetString();
+                        if (httpClient.DefaultRequestHeaders.Contains("Authorization")) {
+                            httpClient.DefaultRequestHeaders.Remove("Authorization");
+                        }
+                        httpClient.DefaultRequestHeaders.Add("Authorization", $"Bearer {AuthorizationToken}");
+                        ok = true;
+                    }
+                }
+            }
+            return (httpClient, AuthorizationToken,ok);
+        }
+    }
+}

+ 18 - 0
HTEXMark/MarkLanguage.cs

@@ -52,5 +52,23 @@ namespace HTEXMark
         public string dataCenter { get; set; }
         public string china { get; set; }
         public string global { get; set; }
+        public string ai_title { get; set; }
+
+        public string pre { get; set; }
+        public string primary { get; set; }
+        public string junior { get; set; }
+        public string senior { get; set; }
+        public string secondary { get; set; }
+        public string college { get; set; }
+        public string university { get; set; }
+        public string special { get; set; }
+        public string edu_bureau { get; set; }
+        public string elecedu_dept { get; set; }
+        public string adult_secondary { get; set; }
+        public string adult_higher { get; set; }
+        public string master { get; set; }
+        public string doctor { get; set; }
+        public string enterprise { get; set; }
+        public string unmatched { get; set; }
     }
 }

+ 13 - 12
HTEXMark/MarkRibbon.Designer.cs

@@ -49,6 +49,7 @@ namespace HTEXMark
             this.draw = this.Factory.CreateRibbonButton();
             this.compose = this.Factory.CreateRibbonButton();
             this.sortmultiple = this.Factory.CreateRibbonButton();
+            this.AI = this.Factory.CreateRibbonButton();
             this.item_taxonomy = this.Factory.CreateRibbonGroup();
             this.remember = this.Factory.CreateRibbonButton();
             this.understand = this.Factory.CreateRibbonButton();
@@ -73,7 +74,6 @@ namespace HTEXMark
             this.schoolDropDown = this.Factory.CreateRibbonDropDown();
             this.subjectDropDown = this.Factory.CreateRibbonDropDown();
             this.dataCenter = this.Factory.CreateRibbonDropDown();
-            this.xkw = this.Factory.CreateRibbonButton();
             this.item_mark_tab.SuspendLayout();
             this.item_type.SuspendLayout();
             this.item_taxonomy.SuspendLayout();
@@ -102,6 +102,7 @@ namespace HTEXMark
             this.item_type.Items.Add(this.draw);
             this.item_type.Items.Add(this.compose);
             this.item_type.Items.Add(this.sortmultiple);
+            this.item_type.Items.Add(this.AI);
             this.item_type.Label = "题目类型";
             this.item_type.Name = "item_type";
             // 
@@ -195,6 +196,16 @@ namespace HTEXMark
             this.sortmultiple.ShowImage = true;
             this.sortmultiple.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.MarkTags_Click);
             // 
+            // AI
+            // 
+            this.AI.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
+            this.AI.Image = global::HTEXMark.Properties.Resources.AI;
+            this.AI.Label = "智能出题\n";
+            this.AI.Name = "AI";
+            this.AI.ShowImage = true;
+            this.AI.Visible = false;
+            this.AI.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.AI_Click);
+            // 
             // item_taxonomy
             // 
             this.item_taxonomy.Items.Add(this.remember);
@@ -372,7 +383,6 @@ namespace HTEXMark
             this.item_user.Items.Add(this.schoolDropDown);
             this.item_user.Items.Add(this.subjectDropDown);
             this.item_user.Items.Add(this.dataCenter);
-            this.item_user.Items.Add(this.xkw);
             this.item_user.Label = "用户信息";
             this.item_user.Name = "item_user";
             // 
@@ -417,15 +427,6 @@ namespace HTEXMark
             this.dataCenter.Name = "dataCenter";
             this.dataCenter.ShowImage = true;
             // 
-            // xkw
-            // 
-            this.xkw.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
-            this.xkw.Image = global::HTEXMark.Properties.Resources.共享数据;
-            this.xkw.Label = "学科网";
-            this.xkw.Name = "xkw";
-            this.xkw.ShowImage = true;
-            this.xkw.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.XKW_Click);
-            // 
             // MarkRibbon
             // 
             this.Name = "MarkRibbon";
@@ -484,7 +485,7 @@ namespace HTEXMark
         internal Microsoft.Office.Tools.Ribbon.RibbonDropDown schoolDropDown;
         internal Microsoft.Office.Tools.Ribbon.RibbonDropDown subjectDropDown;
         internal Microsoft.Office.Tools.Ribbon.RibbonDropDown dataCenter;
-        internal Microsoft.Office.Tools.Ribbon.RibbonButton xkw;
+        internal Microsoft.Office.Tools.Ribbon.RibbonButton AI;
     }
 
     partial class ThisRibbonCollection

+ 32 - 20
HTEXMark/MarkRibbon.cs

@@ -31,6 +31,7 @@ namespace HTEXMark
         public  System.Windows.Forms.ListBox knowledgeListBox;
         private HttpClient httpClient;
         public Microsoft.Office.Tools.CustomTaskPane customTaskPane;
+        public static List<IdCodeNameCount> periodSubjects = new List<IdCodeNameCount>();
         public static string domain;
         private void MarkRibbon_Load(object sender, RibbonUIEventArgs e)
         {
@@ -126,20 +127,24 @@ namespace HTEXMark
             await AppendSubjectDropDown(data.SelectedItem.Tag.ToString(), httpClient);
 
         }
-        public async Task AppendSubjectDropDown(string school, HttpClient httpClient)
+        public async Task AppendSubjectDropDown(string school,HttpClient httpClient)
         {
             subjectDropDown.Items.Clear();
             subjectDropDown.SelectionChanged-=SubjectSelectionChanged;
             knowledgeListBox.SelectedValueChanged-= KnowledgeListBoxSelectedValueChanged;
             knowledgeListBox.Items.Clear();
-            var response = await httpClient.GetAsync($"https://{domain}/hita/get-school-data?school={school}");
+            var response = await httpClient.GetAsync($"https://{domain}/hita/get-school-data?school={school}&id_token={UserSettings.Default.id_token}");
             if (response.IsSuccessStatusCode)
             {
                 string content = await response.Content.ReadAsStringAsync();
                 if (!string.IsNullOrWhiteSpace(content))
                 {
                     var json = JsonSerializer.Deserialize<JsonElement>(content);
-                    var periodSubjects = JsonSerializer.Deserialize<List<IdCodeNameCount>>(json.GetProperty("periodSubjects"));
+                    periodSubjects = JsonSerializer.Deserialize<List<IdCodeNameCount>>(json.GetProperty("periodSubjects"));
+                    string auth_token = $"{json.GetProperty("auth_token")}";
+                    if (!string.IsNullOrWhiteSpace(auth_token)) {
+                        UserSettings.Default.x_auth_token= auth_token;
+                    }
                     if (periodSubjects!=null  && periodSubjects.Count>0)
                     {
                         var data = periodSubjects.OrderByDescending(x => x.count);
@@ -147,11 +152,11 @@ namespace HTEXMark
                         {
                             var item = this.Factory.CreateRibbonDropDownItem();
                             item.Label=$"{subject.name}({subject.count})";
-                            item.Tag=$"{school}:{subject.id}:{subject.code}";
+                            item.Tag=$"{school}:{subject.periodId}:{subject.subjectId}";
                             subjectDropDown.Items.Add(item);
                         }
                         subjectDropDown.SelectionChanged+=SubjectSelectionChanged;
-                        var blocks= await AppendKnowledge(school, data.First().id, data.First().code, httpClient);
+                        var blocks= await AppendKnowledge(school, data.First().periodId, data.First().subjectId, httpClient);
                         knowledgeUserControl.InitializeTreeView(knowledgeListBox, blocks);
                         knowledgeListBox.SelectedValueChanged+= KnowledgeListBoxSelectedValueChanged;
                     }
@@ -216,9 +221,9 @@ namespace HTEXMark
                 knowledgeListBox.SelectedValueChanged+= KnowledgeListBoxSelectedValueChanged;
             }
         }
-        public async Task<List<Block>> AppendKnowledge(string school, string code, string id, HttpClient httpClient)
+        public async Task<List<Block>> AppendKnowledge(string school, string periodId, string subjectId, HttpClient httpClient)
         {
-            var response = await httpClient.GetAsync($"https://{domain}/hita/get-school-knowledge?school={school}&id={id}&code={code}");
+            var response = await httpClient.GetAsync($"https://{domain}/hita/get-school-knowledge?school={school}&id={subjectId}&code={periodId}");
             if (response.IsSuccessStatusCode)
             {
 
@@ -322,13 +327,11 @@ namespace HTEXMark
         private void QRCode_Click(object sender, RibbonControlEventArgs e) {
             // 创建 Windows Forms 窗口
             var qrcode_button = sender as  RibbonButton;
-
-            QRCodeForm qrCodeForm = new QRCodeForm(qrcode_button, user, schoolDropDown, subjectDropDown, lang, this, customTaskPane,domain);
-             
+            QRCodeForm qrCodeForm = new QRCodeForm(AI, qrcode_button, user, schoolDropDown, subjectDropDown, lang, this, customTaskPane,domain);
             CenterFormOnScreen(qrCodeForm);
             qrCodeForm.ShowDialog();
         }
-        public void CenterFormOnScreen(QRCodeForm qrCodeForm)
+        public void CenterFormOnScreen(Control qrCodeForm)
         {
             // 获取屏幕的工作区域
             var workingArea = System.Windows.Forms.Screen.GetWorkingArea(qrCodeForm);
@@ -439,20 +442,20 @@ namespace HTEXMark
             }
         }
 
-        private void XKW_Click(object sender, RibbonControlEventArgs e)
+        private   async void XKW_Click(object sender, RibbonControlEventArgs e)
         {
-            string html = "<html><body><h1>Hello, World!</h1></body></html>";
-            // 处理远程图片并将HTML内容放入剪贴板
-            string processedHtml = ProcessRemoteImages(html);
-
-           
-
+            
+      
+          
             Microsoft.Office.Interop.Word.Application wordApp = Globals.ThisAddIn.Application;
-
-            InsertHtmlIntoWord(wordApp, processedHtml);
+           // string html = await SparkAI("");
+            //string processedHtml = ProcessRemoteImages(html);
+            //InsertHtmlIntoWord(wordApp, processedHtml);
             // 在Word中粘贴HTML内容
 
         }
+
+        
      
         private string ConvertHtmlToDocx(string htmlContent)
         {
@@ -530,5 +533,14 @@ namespace HTEXMark
 
             return base64Image;
         }
+
+        private void AI_Click(object sender, RibbonControlEventArgs e)
+        {
+            var ai_button = sender as  RibbonButton;
+            AI_Form aiForm = new AI_Form(periodSubjects, ai_button, user, schoolDropDown, subjectDropDown, lang, this, customTaskPane, domain);
+            CenterFormOnScreen(aiForm);
+            aiForm.ShowDialog();
+        }
+        
     }
 }

+ 10 - 0
HTEXMark/Properties/Resources.Designer.cs

@@ -60,6 +60,16 @@ namespace HTEXMark.Properties {
             }
         }
         
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap AI {
+            get {
+                object obj = ResourceManager.GetObject("AI", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>

+ 5 - 2
HTEXMark/Properties/Resources.resx

@@ -172,6 +172,9 @@
   <data name="多选题" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>..\Images\多选题.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
+  <data name="共享数据" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Images\共享数据.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
   <data name="分析" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>..\Images\分析.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
@@ -214,7 +217,7 @@
   <data name="难度" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>..\Images\难度.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
-  <data name="共享数据" type="System.Resources.ResXFileRef, System.Windows.Forms">
-    <value>..\Images\共享数据.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  <data name="AI" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Images\AI.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
 </root>

+ 5 - 5
HTEXMark/Properties/Settings.Designer.cs

@@ -1,10 +1,10 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:4.0.30319.42000
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
 //
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
 // </auto-generated>
 //------------------------------------------------------------------------------
 
@@ -12,7 +12,7 @@ namespace HTEXMark.Properties {
     
     
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.0.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.8.0.0")]
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
         
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));

+ 2 - 4
HTEXMark/Properties/Settings.settings

@@ -1,7 +1,5 @@
 <?xml version='1.0' encoding='utf-8'?>
 <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
-  <Profiles>
-    <Profile Name="(Default)" />
-  </Profiles>
+  <Profiles />
   <Settings />
-</SettingsFile>
+</SettingsFile>

+ 21 - 8
HTEXMark/QRCodeForm.cs

@@ -42,10 +42,12 @@ namespace HTEXMark
         public MarkRibbon markRibbon;
         public RibbonDropDown schoolDropDown;
         public RibbonDropDown subjectDropDown;
+        public RibbonButton AI;
         private HttpClient httpClient;
         private Microsoft.Office.Tools.CustomTaskPane customTaskPane;
+     
         public string domain { get; set; }
-        public QRCodeForm(RibbonButton qrcode_button, RibbonButton user_button, RibbonDropDown schoolDropDown, RibbonDropDown subjectDropDown, MarkLanguage lang, MarkRibbon markRibbon, Microsoft.Office.Tools.CustomTaskPane customTaskPane,string domain)
+        public QRCodeForm(RibbonButton AI, RibbonButton qrcode_button, RibbonButton user_button, RibbonDropDown schoolDropDown, RibbonDropDown subjectDropDown, MarkLanguage lang, MarkRibbon markRibbon, Microsoft.Office.Tools.CustomTaskPane customTaskPane,string domain)
         {
             this.qrcode_button=qrcode_button;
             this.user_button=user_button;
@@ -53,6 +55,7 @@ namespace HTEXMark
             this.markRibbon = markRibbon;
             this.schoolDropDown=schoolDropDown;
             this.subjectDropDown=subjectDropDown;
+            this.AI = AI;
             this.customTaskPane=customTaskPane;
             this.domain=domain;
             httpClient = HttpClientFactory.Create();
@@ -82,12 +85,16 @@ namespace HTEXMark
 
         public class IdCodeNameCount
         {
-            public string id { get; set; }
-            public string code { get; set; }
-            public string name { get; set; }
-            public int count { get; set; }
-        }
-        public static Bitmap GetBitmap(string sContent, int iWidth, int iHeight)
+
+        public string periodId { get; set; }
+        public string periodName { get; set; }
+        public string periodType { get; set; }
+        public string subjectId { get; set; }
+        public string subjectName { get; set; }
+        public string name { get; set; }
+        public int count { get; set; }
+    }
+    public static Bitmap GetBitmap(string sContent, int iWidth, int iHeight)
         {
             BarcodeWriter writer = new BarcodeWriter();
             writer.Format = BarcodeFormat.QR_CODE;
@@ -142,9 +149,14 @@ namespace HTEXMark
                     {
                         var json = JsonSerializer.Deserialize<JsonElement>(content);
                         token= JsonSerializer.Deserialize<TmdidImplicit>(json.GetProperty("implicit_token"));
-                        schools= JsonSerializer.Deserialize<List<School>>(json.GetProperty("schools"));
+                        string x_auth_token = $"{json.GetProperty("x_auth_token")}";
+                        schools = JsonSerializer.Deserialize<List<School>>(json.GetProperty("schools"));
                         if (token!= null)
                         {
+                            UserSettings.Default.access_token=token.access_token;
+                            UserSettings.Default.id_token=token.id_token;
+                            UserSettings.Default.x_auth_token=x_auth_token;
+                            UserSettings.Default.is_login=true;
                             var jwt = new JwtSecurityToken(token.id_token);
                             var id = jwt.Payload.Sub;
                             jwt.Payload.TryGetValue("name", out object name);
@@ -159,6 +171,7 @@ namespace HTEXMark
                             qrcode_button.Visible=false;
                             schoolDropDown.Visible=true;
                             subjectDropDown.Visible=true;
+                            AI.Visible=true;
                             schoolDropDown.Items.Clear();
                             subjectDropDown.Items.Clear();
                             if (schools!=null && schools.Count>0)

+ 29 - 0
HTEXMark/RichTextBoxEx.cs

@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HTEXMark
+{
+    public class RichTextBoxEx : RichTextBox
+    {
+        public string PlaceHolder { get; set; }
+        protected override void WndProc(ref Message m)
+        {
+            base.WndProc(ref m);
+            if (m.Msg == 0xF || m.Msg == 0x133)
+            {
+                WmPaint(ref m);
+            }
+        }
+        private void WmPaint(ref Message m)
+        {
+            Graphics g = Graphics.FromHwnd(base.Handle);
+            if (!String.IsNullOrEmpty(this.PlaceHolder) && string.IsNullOrEmpty(this.Text))
+                g.DrawString(this.PlaceHolder, this.Font, new SolidBrush(Color.LightGray), 0, 0);
+        }
+    }
+}

+ 28 - 0
HTEXMark/Settings.cs

@@ -0,0 +1,28 @@
+namespace HTEXMark.Properties {
+    
+    
+    // 通过此类可以处理设置类的特定事件: 
+    //  在更改某个设置的值之前将引发 SettingChanging 事件。
+    //  在更改某个设置的值之后将引发 PropertyChanged 事件。
+    //  在加载设置值之后将引发 SettingsLoaded 事件。
+    //  在保存设置值之前将引发 SettingsSaving 事件。
+    internal sealed partial class Settings {
+        
+        public Settings() {
+            // // 若要为保存和更改设置添加事件处理程序,请取消注释下列行: 
+            //
+            // this.SettingChanging += this.SettingChangingEventHandler;
+            //
+            // this.SettingsSaving += this.SettingsSavingEventHandler;
+            //
+        }
+        
+        private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
+            // 在此处添加用于处理 SettingChangingEvent 事件的代码。
+        }
+        
+        private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
+            // 在此处添加用于处理 SettingsSaving 事件的代码。
+        }
+    }
+}

+ 49 - 0
HTEXMark/UserSettings.cs

@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HTEXMark
+{
+    public sealed  class UserSettings : ApplicationSettingsBase
+    {
+        private static UserSettings _defaultInstance = ((UserSettings)(Synchronized(new UserSettings())));
+
+        public static UserSettings Default
+        {
+            get { return _defaultInstance; }
+        }
+        [UserScopedSetting()]
+        [DefaultSettingValue("")]
+        public string access_token
+        {
+            get { return (string)this["access_token"]; }
+            set { this["access_token"] = value; }
+        }
+        [UserScopedSetting()]
+        [DefaultSettingValue("")]
+        public string id_token
+        {
+            get { return (string)this["id_token"]; }
+            set { this["id_token"] = value; }
+        }
+        [UserScopedSetting()]
+        [DefaultSettingValue("")]
+        public string x_auth_token
+        {
+            get { return (string)this["x_auth_token"]; }
+            set { this["x_auth_token"] = value; }
+        }
+       
+
+        [UserScopedSetting()]
+        [DefaultSettingValue("false")]
+        public bool is_login
+        {
+            get { return (bool)this["is_login"]; }
+            set { this["is_login"] = value; }
+        }
+    }
+}

+ 2 - 0
HTEXMark/app.config

@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <configuration>
+  <configSections>
+  </configSections>
   <runtime>
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>

+ 52 - 3
HTEXMark/lang.json

@@ -43,7 +43,24 @@
     "privacyPolicy": "隐私权政策",
     "dataCenter": "站点",
     "china": "中国大陆",
-    "global": "国际"
+    "global": "国际",
+    "pre": "学前",
+    "primary": "小学",
+    "junior": "初中",
+    "senior": "高中",
+    "secondary": "中职(中专,技校,职高)",
+    "college": "高职(专科)",
+    "university": "大学本科",
+    "special": "特殊教育",
+    "edu_bureau": "教育局",
+    "elecedu_dept": "电教部门",
+    "adult_secondary": "成人中专",
+    "adult_higher": "成人高教",
+    "master": "硕士研究生",
+    "doctor": "博士研究生",
+    "enterprise": "企业",
+    "unmatched": "(未匹配)"
+
   },
   "tw": {
     "single": "選擇題",
@@ -89,7 +106,23 @@
     "privacyPolicy": "隱私權政策",
     "dataCenter": "站點",
     "china": "中國大陸",
-    "global": "國際"
+    "global": "國際",
+    "pre": "學前",
+    "primary": "小學",
+    "junior": "初中",
+    "senior": "高中",
+    "secondary": "中職(中專,技校,職高)",
+    "college": "高職(專科)",
+    "university": "大學本科",
+    "special": "特殊教育",
+    "edu_bureau": "教育局",
+    "elecedu_dept": "電教部門",
+    "adult_secondary": "成人中專",
+    "adult_higher": "成人高教",
+    "master": "碩士研究生",
+    "doctor": "博士研究生",
+    "enterprise": "企業",
+    "unmatched": "(未匹配)"
   },
   "en": {
     "single": "MultipleChoice",
@@ -135,6 +168,22 @@
     "privacyPolicy": "Privacy Policy",
     "dataCenter": "Website",
     "china": "Chinese Mainland",
-    "global": "Global"
+    "global": "Global",
+    "pre": "Pre-school",
+    "primary": "Primary School",
+    "junior": "Junior High School",
+    "senior": "Senior High School",
+    "secondary": "Vocational High School",
+    "college": "College",
+    "university": "University",
+    "special": "Special Education",
+    "edu_bureau": "Education Department",
+    "elecedu_dept": "E-learning Department",
+    "adult_secondary": "Adult Specialized Secondary Schools",
+    "adult_higher": "Adult Higher Education",
+    "master": "Graduate school (Master's Degree)",
+    "doctor": "Graduate school (Doctorate)",
+    "enterprise": "Company",
+    "unmatched": "(Unmatched)"
   }
 }

+ 1 - 0
HTEXMark/packages.config

@@ -8,6 +8,7 @@
   <package id="Microsoft.IdentityModel.JsonWebTokens" version="7.2.0" targetFramework="net48" />
   <package id="Microsoft.IdentityModel.Logging" version="7.2.0" targetFramework="net48" />
   <package id="Microsoft.IdentityModel.Tokens" version="7.2.0" targetFramework="net48" />
+  <package id="Microsoft.Web.WebView2" version="1.0.2210.55" targetFramework="net48" />
   <package id="PDFsharp" version="1.50.4000-beta3b" targetFramework="net48" />
   <package id="System.Buffers" version="4.5.1" targetFramework="net48" />
   <package id="System.IdentityModel.Tokens.Jwt" version="7.2.0" targetFramework="net48" />

+ 244 - 0
HTEXTeach/HTEXTeach.csproj

@@ -0,0 +1,244 @@
+<Project ToolsVersion="17.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <!--
+    This section defines project-level properties.
+
+    AssemblyName
+      Name of the output assembly.
+    Configuration
+      Specifies a default value for debug.
+    OutputType
+      Must be "Library" for VSTO.
+    Platform
+      Specifies what CPU the output of this project can run on.
+    NoStandardLibraries
+      Set to "false" for VSTO.
+    RootNamespace
+      In C#, this specifies the namespace given to new files. In VB, all objects are
+      wrapped in this namespace at runtime.
+  -->
+  <PropertyGroup>
+    <ProjectTypeGuids>{BAA0C2D2-18E2-41B9-852F-F413020CAA33};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{BD8A4D64-9EE5-443E-9184-EE7E81FF53CF}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <NoStandardLibraries>false</NoStandardLibraries>
+    <RootNamespace>HTEXTeach</RootNamespace>
+    <AssemblyName>HTEXTeach</AssemblyName>
+    <LoadBehavior>3</LoadBehavior>
+    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
+    <DefineConstants>VSTO40;UseOfficeInterop</DefineConstants>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+    <BootstrapperComponentsLocation>HomeSite</BootstrapperComponentsLocation>
+    <ResolveComReferenceSilent>true</ResolveComReferenceSilent>
+  </PropertyGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.VSTORuntime.4.0">
+      <Visible>False</Visible>
+      <ProductName>Microsoft Visual Studio 2010 Tools for Office Runtime %28x86 and x64%29</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <PropertyGroup>
+    <!--
+      OfficeApplication
+        Add-in host application
+    -->
+    <OfficeApplication>PowerPoint</OfficeApplication>
+  </PropertyGroup>
+  <!--
+    This section defines properties that are set when the "Debug" configuration is selected.
+
+    DebugSymbols
+      If "true", create symbols (.pdb). If "false", do not create symbols.
+    DefineConstants
+      Constants defined for the preprocessor.
+    EnableUnmanagedDebugging
+      If "true", starting the debugger will attach both managed and unmanaged debuggers.
+    Optimize
+      If "true", optimize the build output. If "false", do not optimize.
+    OutputPath
+      Output path of project relative to the project file.
+    WarningLevel
+      Warning level for the compiler.
+  -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
+    <DefineConstants>$(DefineConstants);DEBUG;TRACE</DefineConstants>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <!--
+    This section defines properties that are set when the "Release" configuration is selected.
+
+    DebugSymbols
+      If "true", create symbols (.pdb). If "false", do not create symbols.
+    DefineConstants
+      Constants defined for the preprocessor.
+    EnableUnmanagedDebugging
+      If "true", starting the debugger will attach both managed and unmanaged debuggers.
+    Optimize
+      If "true", optimize the build output. If "false", do not optimize.
+    OutputPath
+      Output path of project relative to the project file.
+    WarningLevel
+      Warning level for the compiler.
+  -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
+    <DefineConstants>$(DefineConstants);TRACE</DefineConstants>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <!--
+    This section specifies references for the project.
+  -->
+  <ItemGroup>
+    <Reference Include="Accessibility" />
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.Office.Tools.v4.0.Framework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.VisualStudio.Tools.Applications.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Office.Tools, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Office.Tools.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.Office.Tools.Common.v4.0.Utilities, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <Private>True</Private>
+    </Reference>
+  </ItemGroup>
+  <Choose>
+    <When Condition="$([System.String]::Copy(&quot;;$(DefineConstants);&quot;).ToLower().Contains(';useofficeinterop;')) or $([System.String]::Copy(&quot;,$(DefineConstants),&quot;).ToLower().Contains(',useofficeinterop,'))">
+      <ItemGroup>
+        <Reference Include="Office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
+          <Private>False</Private>
+          <EmbedInteropTypes>true</EmbedInteropTypes>
+        </Reference>
+        <Reference Include="Microsoft.Office.Interop.PowerPoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
+          <Private>False</Private>
+          <EmbedInteropTypes>true</EmbedInteropTypes>
+        </Reference>
+      </ItemGroup>
+    </When>
+    <Otherwise>
+      <ItemGroup>
+        <COMReference Include="Microsoft.Office.Core">
+          <Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid>
+          <VersionMajor>2</VersionMajor>
+          <VersionMinor>7</VersionMinor>
+          <Lcid>0</Lcid>
+          <WrapperTool>tlbimp</WrapperTool>
+          <Isolated>False</Isolated>
+          <EmbedInteropTypes>true</EmbedInteropTypes>
+        </COMReference>
+        <COMReference Include="Microsoft.Office.Interop.PowerPoint">
+          <Guid>{91493440-5A91-11CF-8700-00AA0060263B}</Guid>
+          <VersionMajor>2</VersionMajor>
+          <VersionMinor>11</VersionMinor>
+          <Lcid>0</Lcid>
+          <WrapperTool>tlbimp</WrapperTool>
+          <Isolated>False</Isolated>
+          <EmbedInteropTypes>true</EmbedInteropTypes>
+        </COMReference>
+      </ItemGroup>
+    </Otherwise>
+  </Choose>
+  <ItemGroup>
+    <Reference Include="stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+      <Private>False</Private>
+    </Reference>
+  </ItemGroup>
+  <!--
+    This section defines the user source files that are part of the project.
+     
+    A "Compile" element specifies a source file to compile.
+    An "EmbeddedResource" element specifies an .resx file for embedded resources.
+    A "None" element specifies a file that is not to be passed to the compiler (for instance, 
+    a text file or XML file).
+    The "AppDesigner" element specifies the directory where the application properties files
+    can be found.
+  -->
+  <ItemGroup>
+    <Compile Include="MainRibbon.cs">
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="MainRibbon.Designer.cs">
+      <DependentUpon>MainRibbon.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\AssemblyInfo.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <EmbeddedResource Include="MainRibbon.resx">
+      <DependentUpon>MainRibbon.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+    </Compile>
+    <Compile Include="ThisAddIn.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <None Include="ThisAddIn.Designer.xml">
+      <DependentUpon>ThisAddIn.cs</DependentUpon>
+    </None>
+    <Compile Include="ThisAddIn.Designer.cs">
+      <DependentUpon>ThisAddIn.Designer.xml</DependentUpon>
+    </Compile>
+    <AppDesigner Include="Properties\" />
+  </ItemGroup>
+  <PropertyGroup>
+    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
+    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+  </PropertyGroup>
+  <!-- Include the build rules for a C# project. -->
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- Include additional build rules for an Office application add-in. -->
+  <Import Project="$(VSToolsPath)\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets" Condition="'$(VSToolsPath)' != ''" />
+  <!-- This section defines VSTO properties that describe the host-changeable project properties. -->
+  <ProjectExtensions>
+    <VisualStudio>
+      <FlavorProperties GUID="{BAA0C2D2-18E2-41B9-852F-F413020CAA33}">
+        <ProjectProperties HostName="PowerPoint" HostPackage="{29A7B9D7-A7F1-4328-8EF0-6B2D1A56B2C1}" OfficeVersion="15.0" VstxVersion="4.0" ApplicationType="PowerPoint" Language="cs" TemplatesPath="" DebugInfoExeName="#Software\Microsoft\Office\16.0\PowerPoint\InstallRoot\Path#powerpnt.exe" AddItemTemplatesGuid="{51063C3A-E220-4D12-8922-BDA915ACD783}" />
+        <Host Name="PowerPoint" GeneratedCodeNamespace="HTEXTeach" IconIndex="0">
+          <HostItem Name="ThisAddIn" Code="ThisAddIn.cs" CanonicalName="AddIn" CanActivate="false" IconIndex="1" Blueprint="ThisAddIn.Designer.xml" GeneratedCode="ThisAddIn.Designer.cs" />
+        </Host>
+      </FlavorProperties>
+    </VisualStudio>
+  </ProjectExtensions>
+</Project>

+ 79 - 0
HTEXTeach/MainRibbon.Designer.cs

@@ -0,0 +1,79 @@
+namespace HTEXTeach
+{
+    partial class MainRibbon : Microsoft.Office.Tools.Ribbon.RibbonBase
+    {
+        /// <summary>
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        public MainRibbon()
+            : base(Globals.Factory.GetRibbonFactory())
+        {
+            InitializeComponent();
+        }
+
+        /// <summary> 
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region 组件设计器生成的代码
+
+        /// <summary>
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.tab1 = this.Factory.CreateRibbonTab();
+            this.group1 = this.Factory.CreateRibbonGroup();
+            this.tab1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // tab1
+            // 
+           // this.tab1.ControlId.ControlIdType = Microsoft.Office.Tools.Ribbon.RibbonControlIdType.Office;
+            this.tab1.Groups.Add(this.group1);
+            this.tab1.Label = "教学助手";
+            this.tab1.Name = "TeachAssistant";
+            // 
+            // group1
+            // 
+            this.group1.Label = "group1";
+            this.group1.Name = "group1";
+            // 
+            // MainRibbon
+            // 
+            this.Name = "MainRibbon";
+            this.RibbonType = "Microsoft.PowerPoint.Presentation";
+            this.Tabs.Add(this.tab1);
+            this.Load += new Microsoft.Office.Tools.Ribbon.RibbonUIEventHandler(this.MainRibbon_Load);
+            this.tab1.ResumeLayout(false);
+            this.tab1.PerformLayout();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        internal Microsoft.Office.Tools.Ribbon.RibbonTab tab1;
+        internal Microsoft.Office.Tools.Ribbon.RibbonGroup group1;
+    }
+
+    partial class ThisRibbonCollection
+    {
+        internal MainRibbon MainRibbon
+        {
+            get { return this.GetRibbon<MainRibbon>(); }
+        }
+    }
+}

+ 16 - 0
HTEXTeach/MainRibbon.cs

@@ -0,0 +1,16 @@
+using Microsoft.Office.Tools.Ribbon;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HTEXTeach
+{
+    public partial class MainRibbon
+    {
+        private void MainRibbon_Load(object sender, RibbonUIEventArgs e)
+        {
+
+        }
+    }
+}

+ 120 - 0
HTEXTeach/MainRibbon.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 38 - 0
HTEXTeach/Properties/AssemblyInfo.cs

@@ -0,0 +1,38 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Security;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("HTEXTeach")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HTEXTeach")]
+[assembly: AssemblyCopyright("Copyright ©  2024")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//将 ComVisible 设置为 false 将使此程序集中的类型
+//对 COM 组件不可见。  如果需要从 COM 访问此程序集中的类型,
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("ac0245be-d949-461b-8dd8-effa02bb5fef")]
+
+// 程序集的版本信息由下列四个值组成:
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+

+ 62 - 0
HTEXTeach/Properties/Resources.Designer.cs

@@ -0,0 +1,62 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace HTEXTeach.Properties {
+    
+    
+    /// <summary>
+    ///   A strongly-typed resource class, for looking up localized strings, etc.
+    /// </summary>
+    // This class was auto-generated by the StronglyTypedResourceBuilder
+    // class via a tool like ResGen or Visual Studio.
+    // To add or remove a member, edit your .ResX file then rerun ResGen
+    // with the /str option, or rebuild your VS project.
+    
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources() {
+        }
+        
+        /// <summary>
+        ///   Returns the cached ResourceManager instance used by this class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HTEXTeach.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   Overrides the current thread's CurrentUICulture property for all
+        ///   resource lookups using this strongly typed resource class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 117 - 0
HTEXTeach/Properties/Resources.resx

@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 26 - 0
HTEXTeach/Properties/Settings.Designer.cs

@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace HTEXTeach.Properties {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+        
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+        
+        public static Settings Default {
+            get {
+                return defaultInstance;
+            }
+        }
+    }
+}

+ 7 - 0
HTEXTeach/Properties/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

+ 231 - 0
HTEXTeach/ThisAddIn.Designer.cs

@@ -0,0 +1,231 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+#pragma warning disable 414
+namespace HTEXTeach {
+    
+    
+    /// 
+    [Microsoft.VisualStudio.Tools.Applications.Runtime.StartupObjectAttribute(0)]
+    [global::System.Security.Permissions.PermissionSetAttribute(global::System.Security.Permissions.SecurityAction.Demand, Name="FullTrust")]
+    public sealed partial class ThisAddIn : Microsoft.Office.Tools.AddInBase {
+        
+        internal Microsoft.Office.Tools.CustomTaskPaneCollection CustomTaskPanes;
+        
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        private global::System.Object missing = global::System.Type.Missing;
+        
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        internal Microsoft.Office.Interop.PowerPoint.Application Application;
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        public ThisAddIn(global::Microsoft.Office.Tools.Factory factory, global::System.IServiceProvider serviceProvider) : 
+                base(factory, serviceProvider, "AddIn", "ThisAddIn") {
+            Globals.Factory = factory;
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        protected override void Initialize() {
+            base.Initialize();
+            this.Application = this.GetHostItem<Microsoft.Office.Interop.PowerPoint.Application>(typeof(Microsoft.Office.Interop.PowerPoint.Application), "Application");
+            Globals.ThisAddIn = this;
+            global::System.Windows.Forms.Application.EnableVisualStyles();
+            this.InitializeCachedData();
+            this.InitializeControls();
+            this.InitializeComponents();
+            this.InitializeData();
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        protected override void FinishInitialization() {
+            this.InternalStartup();
+            this.OnStartup();
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        protected override void InitializeDataBindings() {
+            this.BeginInitialization();
+            this.BindToData();
+            this.EndInitialization();
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        private void InitializeCachedData() {
+            if ((this.DataHost == null)) {
+                return;
+            }
+            if (this.DataHost.IsCacheInitialized) {
+                this.DataHost.FillCachedData(this);
+            }
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        private void InitializeData() {
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        private void BindToData() {
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        private void StartCaching(string MemberName) {
+            this.DataHost.StartCaching(this, MemberName);
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        private void StopCaching(string MemberName) {
+            this.DataHost.StopCaching(this, MemberName);
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        private bool IsCached(string MemberName) {
+            return this.DataHost.IsCached(this, MemberName);
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        private void BeginInitialization() {
+            this.BeginInit();
+            this.CustomTaskPanes.BeginInit();
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        private void EndInitialization() {
+            this.CustomTaskPanes.EndInit();
+            this.EndInit();
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        private void InitializeControls() {
+            this.CustomTaskPanes = Globals.Factory.CreateCustomTaskPaneCollection(null, null, "CustomTaskPanes", "CustomTaskPanes", this);
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        private void InitializeComponents() {
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        private bool NeedsFill(string MemberName) {
+            return this.DataHost.NeedsFill(this, MemberName);
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        protected override void OnShutdown() {
+            this.CustomTaskPanes.Dispose();
+            base.OnShutdown();
+        }
+    }
+    
+    /// 
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+    internal sealed partial class Globals {
+        
+        /// 
+        private Globals() {
+        }
+        
+        private static ThisAddIn _ThisAddIn;
+        
+        private static global::Microsoft.Office.Tools.Factory _factory;
+        
+        private static ThisRibbonCollection _ThisRibbonCollection;
+        
+        internal static ThisAddIn ThisAddIn {
+            get {
+                return _ThisAddIn;
+            }
+            set {
+                if ((_ThisAddIn == null)) {
+                    _ThisAddIn = value;
+                }
+                else {
+                    throw new System.NotSupportedException();
+                }
+            }
+        }
+        
+        internal static global::Microsoft.Office.Tools.Factory Factory {
+            get {
+                return _factory;
+            }
+            set {
+                if ((_factory == null)) {
+                    _factory = value;
+                }
+                else {
+                    throw new System.NotSupportedException();
+                }
+            }
+        }
+        
+        internal static ThisRibbonCollection Ribbons {
+            get {
+                if ((_ThisRibbonCollection == null)) {
+                    _ThisRibbonCollection = new ThisRibbonCollection(_factory.GetRibbonFactory());
+                }
+                return _ThisRibbonCollection;
+            }
+        }
+    }
+    
+    /// 
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+    internal sealed partial class ThisRibbonCollection : Microsoft.Office.Tools.Ribbon.RibbonCollectionBase {
+        
+        /// 
+        internal ThisRibbonCollection(global::Microsoft.Office.Tools.Ribbon.RibbonFactory factory) : 
+                base(factory) {
+        }
+    }
+}

+ 4 - 0
HTEXTeach/ThisAddIn.Designer.xml

@@ -0,0 +1,4 @@
+<hostitem:hostItem hostitem:baseType="Microsoft.Office.Tools.AddInBase" hostitem:namespace="HTEXTeach" hostitem:className="ThisAddIn" hostitem:identifier="ThisAddIn" hostitem:primaryCookie="AddIn" hostitem:master="true" hostitem:factoryType="Microsoft.Office.Tools.Factory" hostitem:startupIndex="0" xmlns:hostitem="http://schemas.microsoft.com/2004/VisualStudio/Tools/Applications/HostItem.xsd">
+  <hostitem:hostObject hostitem:name="Application" hostitem:identifier="Application" hostitem:type="Microsoft.Office.Interop.PowerPoint.Application" hostitem:cookie="Application" hostitem:modifier="Internal" />
+  <hostitem:hostControl hostitem:name="CustomTaskPanes" hostitem:identifier="CustomTaskPanes" hostitem:type="Microsoft.Office.Tools.CustomTaskPaneCollection" hostitem:primaryCookie="CustomTaskPanes" hostitem:modifier="Internal" />
+</hostitem:hostItem>

+ 36 - 0
HTEXTeach/ThisAddIn.cs

@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml.Linq;
+using PowerPoint = Microsoft.Office.Interop.PowerPoint;
+using Office = Microsoft.Office.Core;
+using  System.Windows;
+
+namespace HTEXTeach
+{
+    public partial class ThisAddIn
+    {
+        private void ThisAddIn_Startup(object sender, System.EventArgs e)
+        {
+        }
+
+        private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
+        {
+        }
+
+        #region VSTO 生成的代码
+
+        /// <summary>
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InternalStartup()
+        {
+            this.Startup += new System.EventHandler(ThisAddIn_Startup);
+            this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
+        }
+        
+        #endregion
+    }
+}

+ 12 - 14
HTEXWeb/Properties/launchSettings.json

@@ -1,17 +1,7 @@
 {
-  "$schema": "http://json.schemastore.org/launchsettings.json",
-  "iisSettings": {
-    "windowsAuthentication": false,
-    "anonymousAuthentication": true,
-    "iisExpress": {
-      "applicationUrl": "http://localhost:52242",
-      "sslPort": 44399
-    }
-  },
   "profiles": {
     "IIS Express": {
       "commandName": "IISExpress",
-      "launchBrowser": false,
       "launchUrl": "weatherforecast",
       "environmentVariables": {
         "ASPNETCORE_ENVIRONMENT": "Development"
@@ -19,12 +9,20 @@
     },
     "HTEXWeb": {
       "commandName": "Project",
-      "launchBrowser": false,
       "launchUrl": "weatherforecast",
-      "applicationUrl": "https://localhost:5001;http://localhost:5000",
       "environmentVariables": {
         "ASPNETCORE_ENVIRONMENT": "Development"
-      }
+      },
+      "applicationUrl": "https://localhost:5001;http://localhost:5000"
+    }
+  },
+  "$schema": "http://json.schemastore.org/launchsettings.json",
+  "iisSettings": {
+    "windowsAuthentication": false,
+    "anonymousAuthentication": true,
+    "iisExpress": {
+      "applicationUrl": "http://localhost:51230/",
+      "sslPort": 44373
     }
   }
-}
+}

+ 0 - 1
HTEXWordTest/Form1.cs

@@ -1,7 +1,6 @@
 using Microsoft.Office.Interop.Word;
 using Microsoft.Web.WebView2.WinForms;
 using Microsoft.Web.WebView2.Wpf;
-using RtfPipe;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;

+ 16 - 14
HTEXWordTest/HTEXWordTest.csproj

@@ -103,18 +103,20 @@
   <ItemGroup>
     <Reference Include="Accessibility" />
     <Reference Include="Microsoft.Web.WebView2.Core, Version=1.0.2210.55, Culture=neutral, PublicKeyToken=2a8ab48044d2601e, processorArchitecture=MSIL">
-      <HintPath>..\packages\Microsoft.Web.WebView2.1.0.2210.55\lib\net45\Microsoft.Web.WebView2.Core.dll</HintPath>
+      <HintPath>F:\NuGet\packages\Microsoft.Web.WebView2.1.0.2210.55\lib\net45\Microsoft.Web.WebView2.Core.dll</HintPath>
+      <Private>True</Private>
     </Reference>
     <Reference Include="Microsoft.Web.WebView2.WinForms, Version=1.0.2210.55, Culture=neutral, PublicKeyToken=2a8ab48044d2601e, processorArchitecture=MSIL">
-      <HintPath>..\packages\Microsoft.Web.WebView2.1.0.2210.55\lib\net45\Microsoft.Web.WebView2.WinForms.dll</HintPath>
+      <HintPath>F:\NuGet\packages\Microsoft.Web.WebView2.1.0.2210.55\lib\net45\Microsoft.Web.WebView2.WinForms.dll</HintPath>
+      <Private>True</Private>
     </Reference>
     <Reference Include="Microsoft.Web.WebView2.Wpf, Version=1.0.2210.55, Culture=neutral, PublicKeyToken=2a8ab48044d2601e, processorArchitecture=MSIL">
-      <HintPath>..\packages\Microsoft.Web.WebView2.1.0.2210.55\lib\net45\Microsoft.Web.WebView2.Wpf.dll</HintPath>
+      <HintPath>F:\NuGet\packages\Microsoft.Web.WebView2.1.0.2210.55\lib\net45\Microsoft.Web.WebView2.Wpf.dll</HintPath>
+      <Private>True</Private>
     </Reference>
-    <Reference Include="RtfPipe, Version=2.0.7677.4303, Culture=neutral, PublicKeyToken=5f6ab4ce530296d2, processorArchitecture=MSIL">
-      <HintPath>..\packages\RtfPipe.2.0.7677.4303\lib\net45\RtfPipe.dll</HintPath>
+    <Reference Include="System">
+      <HintPath>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.dll</HintPath>
     </Reference>
-    <Reference Include="System" />
     <Reference Include="System.Data" />
     <Reference Include="System.Drawing" />
     <Reference Include="System.Windows.Forms" />
@@ -235,7 +237,14 @@
     <ManifestKeyFile>HTEXWordTest_TemporaryKey.pfx</ManifestKeyFile>
   </PropertyGroup>
   <PropertyGroup>
-    <ManifestCertificateThumbprint>5A189EC8C289E2B0749F91590814690FB9372568</ManifestCertificateThumbprint>
+    <ManifestCertificateThumbprint>DFD37C78A474891A3A32305FA8F17A3ED973DB7A</ManifestCertificateThumbprint>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>
+    </AssemblyOriginatorKeyFile>
   </PropertyGroup>
   <!-- Include the build rules for a C# project. -->
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
@@ -252,11 +261,4 @@
       </FlavorProperties>
     </VisualStudio>
   </ProjectExtensions>
-  <Import Project="..\packages\Microsoft.Web.WebView2.1.0.2210.55\build\Microsoft.Web.WebView2.targets" Condition="Exists('..\packages\Microsoft.Web.WebView2.1.0.2210.55\build\Microsoft.Web.WebView2.targets')" />
-  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
-    <PropertyGroup>
-      <ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
-    </PropertyGroup>
-    <Error Condition="!Exists('..\packages\Microsoft.Web.WebView2.1.0.2210.55\build\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Web.WebView2.1.0.2210.55\build\Microsoft.Web.WebView2.targets'))" />
-  </Target>
 </Project>

+ 246 - 0
HTEXWordWps/HTEXWordWps.csproj

@@ -0,0 +1,246 @@
+<Project ToolsVersion="17.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <!--
+    This section defines project-level properties.
+
+    AssemblyName
+      Name of the output assembly.
+    Configuration
+      Specifies a default value for debug.
+    OutputType
+      Must be "Library" for VSTO.
+    Platform
+      Specifies what CPU the output of this project can run on.
+    NoStandardLibraries
+      Set to "false" for VSTO.
+    RootNamespace
+      In C#, this specifies the namespace given to new files. In VB, all objects are
+      wrapped in this namespace at runtime.
+  -->
+  <PropertyGroup>
+    <ProjectTypeGuids>{BAA0C2D2-18E2-41B9-852F-F413020CAA33};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{13B299BB-71CF-43B0-965B-D957F2E0427B}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <NoStandardLibraries>false</NoStandardLibraries>
+    <RootNamespace>HTEXWordWps</RootNamespace>
+    <AssemblyName>HTEXWordWps</AssemblyName>
+    <LoadBehavior>3</LoadBehavior>
+    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
+    <DefineConstants>VSTO40</DefineConstants>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+    <BootstrapperComponentsLocation>HomeSite</BootstrapperComponentsLocation>
+  </PropertyGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.VSTORuntime.4.0">
+      <Visible>False</Visible>
+      <ProductName>Microsoft Visual Studio 2010 Tools for Office Runtime %28x86 and x64%29</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <PropertyGroup>
+    <!--
+      OfficeApplication
+        Add-in host application
+    -->
+    <OfficeApplication>Word</OfficeApplication>
+  </PropertyGroup>
+  <!--
+    This section defines properties that are set when the "Debug" configuration is selected.
+
+    DebugSymbols
+      If "true", create symbols (.pdb). If "false", do not create symbols.
+    DefineConstants
+      Constants defined for the preprocessor.
+    EnableUnmanagedDebugging
+      If "true", starting the debugger will attach both managed and unmanaged debuggers.
+    Optimize
+      If "true", optimize the build output. If "false", do not optimize.
+    OutputPath
+      Output path of project relative to the project file.
+    WarningLevel
+      Warning level for the compiler.
+  -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
+    <DefineConstants>$(DefineConstants);DEBUG;TRACE</DefineConstants>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <!--
+    This section defines properties that are set when the "Release" configuration is selected.
+
+    DebugSymbols
+      If "true", create symbols (.pdb). If "false", do not create symbols.
+    DefineConstants
+      Constants defined for the preprocessor.
+    EnableUnmanagedDebugging
+      If "true", starting the debugger will attach both managed and unmanaged debuggers.
+    Optimize
+      If "true", optimize the build output. If "false", do not optimize.
+    OutputPath
+      Output path of project relative to the project file.
+    WarningLevel
+      Warning level for the compiler.
+  -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
+    <DefineConstants>$(DefineConstants);TRACE</DefineConstants>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <!--
+    This section specifies references for the project.
+  -->
+  <ItemGroup>
+    <Reference Include="Accessibility" />
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.Office.Tools.v4.0.Framework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.VisualStudio.Tools.Applications.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Office.Tools, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Office.Tools.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Office.Tools.Word, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.Office.Tools.Common.v4.0.Utilities, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <Private>True</Private>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="Office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
+      <Private>False</Private>
+      <EmbedInteropTypes>true</EmbedInteropTypes>
+    </Reference>
+    <Reference Include="Microsoft.Office.Interop.Word, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
+      <Private>False</Private>
+      <EmbedInteropTypes>true</EmbedInteropTypes>
+    </Reference>
+    <Reference Include="stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+      <Private>False</Private>
+    </Reference>
+  </ItemGroup>
+  <!--
+    This section defines the user source files that are part of the project.
+     
+    A "Compile" element specifies a source file to compile.
+    An "EmbeddedResource" element specifies an .resx file for embedded resources.
+    A "None" element specifies a file that is not to be passed to the compiler (for instance, 
+    a text file or XML file).
+    The "AppDesigner" element specifies the directory where the application properties files
+    can be found.
+  -->
+  <ItemGroup>
+    <Compile Include="MarkRibbon.cs">
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="MarkRibbon.Designer.cs">
+      <DependentUpon>MarkRibbon.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\AssemblyInfo.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <EmbeddedResource Include="MarkRibbon.resx">
+      <DependentUpon>MarkRibbon.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <None Include="HTEXWordWps.pfx" />
+    <None Include="HTEXWordWps_TemporaryKey.pfx" />
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+    </Compile>
+    <Compile Include="ThisAddIn.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <None Include="ThisAddIn.Designer.xml">
+      <DependentUpon>ThisAddIn.cs</DependentUpon>
+    </None>
+    <Compile Include="ThisAddIn.Designer.cs">
+      <DependentUpon>ThisAddIn.Designer.xml</DependentUpon>
+    </Compile>
+    <AppDesigner Include="Properties\" />
+  </ItemGroup>
+  <ItemGroup>
+    <COMReference Include="AddInDesignerObjects">
+      <Guid>{A537E638-AB2A-4308-A502-2EFF280C6E98}</Guid>
+      <VersionMajor>1</VersionMajor>
+      <VersionMinor>0</VersionMinor>
+      <Lcid>0</Lcid>
+      <WrapperTool>tlbimp</WrapperTool>
+      <Isolated>False</Isolated>
+      <EmbedInteropTypes>True</EmbedInteropTypes>
+    </COMReference>
+  </ItemGroup>
+  <PropertyGroup>
+    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
+    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>HTEXWordWps.pfx</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignManifests>true</SignManifests>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ManifestKeyFile>HTEXWordWps_TemporaryKey.pfx</ManifestKeyFile>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ManifestCertificateThumbprint>41ED2A4713D373DD8DA41D86E298F5ED411494A3</ManifestCertificateThumbprint>
+  </PropertyGroup>
+  <!-- Include the build rules for a C# project. -->
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- Include additional build rules for an Office application add-in. -->
+  <Import Project="$(VSToolsPath)\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets" Condition="'$(VSToolsPath)' != ''" />
+  <!-- This section defines VSTO properties that describe the host-changeable project properties. -->
+  <ProjectExtensions>
+    <VisualStudio>
+      <FlavorProperties GUID="{BAA0C2D2-18E2-41B9-852F-F413020CAA33}">
+        <ProjectProperties HostName="Word" HostPackage="{29A7B9D7-A7F1-4328-8EF0-6B2D1A56B2C1}" OfficeVersion="15.0" VstxVersion="4.0" ApplicationType="Word" Language="cs" TemplatesPath="" DebugInfoExeName="#Software\Microsoft\Office\16.0\Word\InstallRoot\Path#WINWORD.EXE" DebugInfoCommandLine="/x" AddItemTemplatesGuid="{51063C3A-E220-4D12-8922-BDA915ACD783}" />
+        <Host Name="Word" GeneratedCodeNamespace="HTEXWordWps" IconIndex="0">
+          <HostItem Name="ThisAddIn" Code="ThisAddIn.cs" CanonicalName="AddIn" CanActivate="false" IconIndex="1" Blueprint="ThisAddIn.Designer.xml" GeneratedCode="ThisAddIn.Designer.cs" />
+        </Host>
+      </FlavorProperties>
+    </VisualStudio>
+  </ProjectExtensions>
+</Project>

+ 79 - 0
HTEXWordWps/MarkRibbon.Designer.cs

@@ -0,0 +1,79 @@
+namespace HTEXWordWps
+{
+    partial class MarkRibbon : Microsoft.Office.Tools.Ribbon.RibbonBase
+    {
+        /// <summary>
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        public MarkRibbon()
+            : base(Globals.Factory.GetRibbonFactory())
+        {
+            InitializeComponent();
+        }
+
+        /// <summary> 
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region 组件设计器生成的代码
+
+        /// <summary>
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.tab1 = this.Factory.CreateRibbonTab();
+            this.group1 = this.Factory.CreateRibbonGroup();
+            this.tab1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // tab1
+            // 
+            this.tab1.ControlId.ControlIdType = Microsoft.Office.Tools.Ribbon.RibbonControlIdType.Office;
+            this.tab1.Groups.Add(this.group1);
+            this.tab1.Label = "TabAddIns";
+            this.tab1.Name = "tab1";
+            // 
+            // group1
+            // 
+            this.group1.Label = "group1";
+            this.group1.Name = "group1";
+            // 
+            // MarkRibbon
+            // 
+            this.Name = "MarkRibbon";
+            this.RibbonType = "Microsoft.Word.Document";
+            this.Tabs.Add(this.tab1);
+            this.Load += new Microsoft.Office.Tools.Ribbon.RibbonUIEventHandler(this.MarkRibbon_Load);
+            this.tab1.ResumeLayout(false);
+            this.tab1.PerformLayout();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        internal Microsoft.Office.Tools.Ribbon.RibbonTab tab1;
+        internal Microsoft.Office.Tools.Ribbon.RibbonGroup group1;
+    }
+
+    partial class ThisRibbonCollection
+    {
+        internal MarkRibbon MarkRibbon
+        {
+            get { return this.GetRibbon<MarkRibbon>(); }
+        }
+    }
+}

+ 16 - 0
HTEXWordWps/MarkRibbon.cs

@@ -0,0 +1,16 @@
+using Microsoft.Office.Tools.Ribbon;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HTEXWordWps
+{
+    public partial class MarkRibbon
+    {
+        private void MarkRibbon_Load(object sender, RibbonUIEventArgs e)
+        {
+
+        }
+    }
+}

+ 120 - 0
HTEXWordWps/MarkRibbon.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 38 - 0
HTEXWordWps/Properties/AssemblyInfo.cs

@@ -0,0 +1,38 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Security;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("HTEXWordWps")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HTEXWordWps")]
+[assembly: AssemblyCopyright("Copyright ©  2024")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//将 ComVisible 设置为 false 将使此程序集中的类型
+//对 COM 组件不可见。  如果需要从 COM 访问此程序集中的类型,
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(true)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("072bab69-60cc-4b4c-a209-040a9b895dde")]
+
+// 程序集的版本信息由下列四个值组成:
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+

+ 62 - 0
HTEXWordWps/Properties/Resources.Designer.cs

@@ -0,0 +1,62 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace HTEXWordWps.Properties {
+    
+    
+    /// <summary>
+    ///   A strongly-typed resource class, for looking up localized strings, etc.
+    /// </summary>
+    // This class was auto-generated by the StronglyTypedResourceBuilder
+    // class via a tool like ResGen or Visual Studio.
+    // To add or remove a member, edit your .ResX file then rerun ResGen
+    // with the /str option, or rebuild your VS project.
+    
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources() {
+        }
+        
+        /// <summary>
+        ///   Returns the cached ResourceManager instance used by this class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HTEXWordWps.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   Overrides the current thread's CurrentUICulture property for all
+        ///   resource lookups using this strongly typed resource class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 117 - 0
HTEXWordWps/Properties/Resources.resx

@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 26 - 0
HTEXWordWps/Properties/Settings.Designer.cs

@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace HTEXWordWps.Properties {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+        
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+        
+        public static Settings Default {
+            get {
+                return defaultInstance;
+            }
+        }
+    }
+}

+ 7 - 0
HTEXWordWps/Properties/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

+ 237 - 0
HTEXWordWps/ThisAddIn.Designer.cs

@@ -0,0 +1,237 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+#pragma warning disable 414
+namespace HTEXWordWps {
+    
+    
+    /// 
+    [Microsoft.VisualStudio.Tools.Applications.Runtime.StartupObjectAttribute(0)]
+    [global::System.Security.Permissions.PermissionSetAttribute(global::System.Security.Permissions.SecurityAction.Demand, Name="FullTrust")]
+    public sealed partial class ThisAddIn : Microsoft.Office.Tools.AddInBase {
+        
+        internal Microsoft.Office.Tools.CustomTaskPaneCollection CustomTaskPanes;
+        
+        internal Microsoft.Office.Tools.SmartTagCollection VstoSmartTags;
+        
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        private global::System.Object missing = global::System.Type.Missing;
+        
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        internal Microsoft.Office.Interop.Word.Application Application;
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        public ThisAddIn(global::Microsoft.Office.Tools.Word.ApplicationFactory factory, global::System.IServiceProvider serviceProvider) : 
+                base(factory, serviceProvider, "AddIn", "ThisAddIn") {
+            Globals.Factory = factory;
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        protected override void Initialize() {
+            base.Initialize();
+            this.Application = this.GetHostItem<Microsoft.Office.Interop.Word.Application>(typeof(Microsoft.Office.Interop.Word.Application), "Application");
+            Globals.ThisAddIn = this;
+            global::System.Windows.Forms.Application.EnableVisualStyles();
+            this.InitializeCachedData();
+            this.InitializeControls();
+            this.InitializeComponents();
+            this.InitializeData();
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        protected override void FinishInitialization() {
+            this.InternalStartup();
+            this.OnStartup();
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        protected override void InitializeDataBindings() {
+            this.BeginInitialization();
+            this.BindToData();
+            this.EndInitialization();
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        private void InitializeCachedData() {
+            if ((this.DataHost == null)) {
+                return;
+            }
+            if (this.DataHost.IsCacheInitialized) {
+                this.DataHost.FillCachedData(this);
+            }
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        private void InitializeData() {
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        private void BindToData() {
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        private void StartCaching(string MemberName) {
+            this.DataHost.StartCaching(this, MemberName);
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        private void StopCaching(string MemberName) {
+            this.DataHost.StopCaching(this, MemberName);
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        private bool IsCached(string MemberName) {
+            return this.DataHost.IsCached(this, MemberName);
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        private void BeginInitialization() {
+            this.BeginInit();
+            this.CustomTaskPanes.BeginInit();
+            this.VstoSmartTags.BeginInit();
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        private void EndInitialization() {
+            this.VstoSmartTags.EndInit();
+            this.CustomTaskPanes.EndInit();
+            this.EndInit();
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        private void InitializeControls() {
+            this.CustomTaskPanes = Globals.Factory.CreateCustomTaskPaneCollection(null, null, "CustomTaskPanes", "CustomTaskPanes", this);
+            this.VstoSmartTags = Globals.Factory.CreateSmartTagCollection(null, null, "VstoSmartTags", "VstoSmartTags", this);
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        private void InitializeComponents() {
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        private bool NeedsFill(string MemberName) {
+            return this.DataHost.NeedsFill(this, MemberName);
+        }
+        
+        /// 
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
+        protected override void OnShutdown() {
+            this.VstoSmartTags.Dispose();
+            this.CustomTaskPanes.Dispose();
+            base.OnShutdown();
+        }
+    }
+    
+    /// 
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+    internal sealed partial class Globals {
+        
+        /// 
+        private Globals() {
+        }
+        
+        private static ThisAddIn _ThisAddIn;
+        
+        private static global::Microsoft.Office.Tools.Word.ApplicationFactory _factory;
+        
+        private static ThisRibbonCollection _ThisRibbonCollection;
+        
+        internal static ThisAddIn ThisAddIn {
+            get {
+                return _ThisAddIn;
+            }
+            set {
+                if ((_ThisAddIn == null)) {
+                    _ThisAddIn = value;
+                }
+                else {
+                    throw new System.NotSupportedException();
+                }
+            }
+        }
+        
+        internal static global::Microsoft.Office.Tools.Word.ApplicationFactory Factory {
+            get {
+                return _factory;
+            }
+            set {
+                if ((_factory == null)) {
+                    _factory = value;
+                }
+                else {
+                    throw new System.NotSupportedException();
+                }
+            }
+        }
+        
+        internal static ThisRibbonCollection Ribbons {
+            get {
+                if ((_ThisRibbonCollection == null)) {
+                    _ThisRibbonCollection = new ThisRibbonCollection(_factory.GetRibbonFactory());
+                }
+                return _ThisRibbonCollection;
+            }
+        }
+    }
+    
+    /// 
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "17.0.0.0")]
+    internal sealed partial class ThisRibbonCollection : Microsoft.Office.Tools.Ribbon.RibbonCollectionBase {
+        
+        /// 
+        internal ThisRibbonCollection(global::Microsoft.Office.Tools.Ribbon.RibbonFactory factory) : 
+                base(factory) {
+        }
+    }
+}

+ 5 - 0
HTEXWordWps/ThisAddIn.Designer.xml

@@ -0,0 +1,5 @@
+<hostitem:hostItem hostitem:baseType="Microsoft.Office.Tools.AddInBase" hostitem:namespace="HTEXWordWps" hostitem:className="ThisAddIn" hostitem:identifier="ThisAddIn" hostitem:primaryCookie="AddIn" hostitem:master="true" hostitem:factoryType="Microsoft.Office.Tools.Word.ApplicationFactory" hostitem:startupIndex="0" xmlns:hostitem="http://schemas.microsoft.com/2004/VisualStudio/Tools/Applications/HostItem.xsd">
+  <hostitem:hostObject hostitem:name="Application" hostitem:identifier="Application" hostitem:type="Microsoft.Office.Interop.Word.Application" hostitem:cookie="Application" hostitem:modifier="Internal" />
+  <hostitem:hostControl hostitem:name="CustomTaskPanes" hostitem:identifier="CustomTaskPanes" hostitem:type="Microsoft.Office.Tools.CustomTaskPaneCollection" hostitem:primaryCookie="CustomTaskPanes" hostitem:modifier="Internal" />
+  <hostitem:hostControl hostitem:name="VstoSmartTags" hostitem:identifier="VstoSmartTags" hostitem:type="Microsoft.Office.Tools.SmartTagCollection" hostitem:primaryCookie="VstoSmartTags" hostitem:modifier="Internal" />
+</hostitem:hostItem>

+ 36 - 0
HTEXWordWps/ThisAddIn.cs

@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml.Linq;
+using Word = Microsoft.Office.Interop.Word;
+using Office = Microsoft.Office.Core;
+using Microsoft.Office.Tools.Word;
+
+namespace HTEXWordWps
+{
+    public partial class ThisAddIn
+    {
+        private void ThisAddIn_Startup(object sender, System.EventArgs e)
+        {
+        }
+
+        private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
+        {
+        }
+
+        #region VSTO 生成的代码
+
+        /// <summary>
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InternalStartup()
+        {
+            this.Startup += new System.EventHandler(ThisAddIn_Startup);
+            this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
+        }
+        
+        #endregion
+    }
+}

+ 12 - 0
HTEXWps/Class1.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HTEXWps
+{
+    public class Class1
+    {
+    }
+}

+ 86 - 0
HTEXWps/HTEXWps.csproj

@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{B77142EB-55F4-46A0-AD25-5DE6B26C21F8}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HTEXWps</RootNamespace>
+    <AssemblyName>HTEXWps</AssemblyName>
+    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>HTEXWps.pfx</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Class1.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HTEXWps.pfx" />
+  </ItemGroup>
+  <ItemGroup>
+    <COMReference Include="AddInDesignerObjects">
+      <Guid>{A537E638-AB2A-4308-A502-2EFF280C6E98}</Guid>
+      <VersionMajor>1</VersionMajor>
+      <VersionMinor>0</VersionMinor>
+      <Lcid>0</Lcid>
+      <WrapperTool>tlbimp</WrapperTool>
+      <Isolated>False</Isolated>
+      <EmbedInteropTypes>True</EmbedInteropTypes>
+    </COMReference>
+    <COMReference Include="Office">
+      <Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid>
+      <VersionMajor>99</VersionMajor>
+      <VersionMinor>1</VersionMinor>
+      <Lcid>0</Lcid>
+      <WrapperTool>tlbimp</WrapperTool>
+      <Isolated>False</Isolated>
+      <EmbedInteropTypes>True</EmbedInteropTypes>
+    </COMReference>
+    <COMReference Include="stdole">
+      <Guid>{00020430-0000-0000-C000-000000000046}</Guid>
+      <VersionMajor>2</VersionMajor>
+      <VersionMinor>0</VersionMinor>
+      <Lcid>0</Lcid>
+      <WrapperTool>primary</WrapperTool>
+      <Isolated>False</Isolated>
+      <EmbedInteropTypes>True</EmbedInteropTypes>
+    </COMReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 36 - 0
HTEXWps/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("HTEXWps")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HTEXWps")]
+[assembly: AssemblyCopyright("Copyright ©  2024")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(true)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("b77142eb-55f4-46a0-ad25-5de6b26c21f8")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
+//通过使用 "*",如下所示:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 42 - 0
TEAMModelHTEX.sln

@@ -25,6 +25,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HTEXMark", "HTEXMark\HTEXMa
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HTEXWordTest", "HTEXWordTest\HTEXWordTest.csproj", "{D8954476-CEAB-42AF-9926-ECE0AF26FE8F}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HTEXWps", "HTEXWps\HTEXWps.csproj", "{B77142EB-55F4-46A0-AD25-5DE6B26C21F8}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HTEXWordWps", "HTEXWordWps\HTEXWordWps.csproj", "{13B299BB-71CF-43B0-965B-D957F2E0427B}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HTEXTeach", "HTEXTeach\HTEXTeach.csproj", "{BD8A4D64-9EE5-443E-9184-EE7E81FF53CF}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -167,6 +173,42 @@ Global
 		{D8954476-CEAB-42AF-9926-ECE0AF26FE8F}.Release|iPhone.Build.0 = Release|Any CPU
 		{D8954476-CEAB-42AF-9926-ECE0AF26FE8F}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
 		{D8954476-CEAB-42AF-9926-ECE0AF26FE8F}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+		{B77142EB-55F4-46A0-AD25-5DE6B26C21F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{B77142EB-55F4-46A0-AD25-5DE6B26C21F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{B77142EB-55F4-46A0-AD25-5DE6B26C21F8}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+		{B77142EB-55F4-46A0-AD25-5DE6B26C21F8}.Debug|iPhone.Build.0 = Debug|Any CPU
+		{B77142EB-55F4-46A0-AD25-5DE6B26C21F8}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+		{B77142EB-55F4-46A0-AD25-5DE6B26C21F8}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+		{B77142EB-55F4-46A0-AD25-5DE6B26C21F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{B77142EB-55F4-46A0-AD25-5DE6B26C21F8}.Release|Any CPU.Build.0 = Release|Any CPU
+		{B77142EB-55F4-46A0-AD25-5DE6B26C21F8}.Release|iPhone.ActiveCfg = Release|Any CPU
+		{B77142EB-55F4-46A0-AD25-5DE6B26C21F8}.Release|iPhone.Build.0 = Release|Any CPU
+		{B77142EB-55F4-46A0-AD25-5DE6B26C21F8}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+		{B77142EB-55F4-46A0-AD25-5DE6B26C21F8}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+		{13B299BB-71CF-43B0-965B-D957F2E0427B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{13B299BB-71CF-43B0-965B-D957F2E0427B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{13B299BB-71CF-43B0-965B-D957F2E0427B}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+		{13B299BB-71CF-43B0-965B-D957F2E0427B}.Debug|iPhone.Build.0 = Debug|Any CPU
+		{13B299BB-71CF-43B0-965B-D957F2E0427B}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+		{13B299BB-71CF-43B0-965B-D957F2E0427B}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+		{13B299BB-71CF-43B0-965B-D957F2E0427B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{13B299BB-71CF-43B0-965B-D957F2E0427B}.Release|Any CPU.Build.0 = Release|Any CPU
+		{13B299BB-71CF-43B0-965B-D957F2E0427B}.Release|iPhone.ActiveCfg = Release|Any CPU
+		{13B299BB-71CF-43B0-965B-D957F2E0427B}.Release|iPhone.Build.0 = Release|Any CPU
+		{13B299BB-71CF-43B0-965B-D957F2E0427B}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+		{13B299BB-71CF-43B0-965B-D957F2E0427B}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+		{BD8A4D64-9EE5-443E-9184-EE7E81FF53CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{BD8A4D64-9EE5-443E-9184-EE7E81FF53CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{BD8A4D64-9EE5-443E-9184-EE7E81FF53CF}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+		{BD8A4D64-9EE5-443E-9184-EE7E81FF53CF}.Debug|iPhone.Build.0 = Debug|Any CPU
+		{BD8A4D64-9EE5-443E-9184-EE7E81FF53CF}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+		{BD8A4D64-9EE5-443E-9184-EE7E81FF53CF}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+		{BD8A4D64-9EE5-443E-9184-EE7E81FF53CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{BD8A4D64-9EE5-443E-9184-EE7E81FF53CF}.Release|Any CPU.Build.0 = Release|Any CPU
+		{BD8A4D64-9EE5-443E-9184-EE7E81FF53CF}.Release|iPhone.ActiveCfg = Release|Any CPU
+		{BD8A4D64-9EE5-443E-9184-EE7E81FF53CF}.Release|iPhone.Build.0 = Release|Any CPU
+		{BD8A4D64-9EE5-443E-9184-EE7E81FF53CF}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+		{BD8A4D64-9EE5-443E-9184-EE7E81FF53CF}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE