This commit is contained in:
HuangHai
2026-01-24 09:55:59 +08:00
parent 22a6a3a0e8
commit 8de3690c41
71 changed files with 90751 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,12 @@
{
"Version": 1,
"WorkspaceRootPath": "D:\\dsWork\\addOne\\WordAddIn\\",
"Documents": [],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": []
}
]
}

View File

@@ -0,0 +1,12 @@
{
"Version": 1,
"WorkspaceRootPath": "D:\\dsWork\\addOne\\WordAddIn\\",
"Documents": [],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": []
}
]
}

View File

@@ -0,0 +1,25 @@
`Visual Studio 2022 Professional
下载地址:`visualstudio.microsoft.com`
安装器里务必勾选:
- 工作负载 → “.NET 桌面开发”
- 工作负载 → “Office/SharePoint 开发”
这两项会把 VSTO 项目模板、Office PIA(主互操作程序集)和调试工具一次装全
- Visual Studio 2022 Professional序列号:
```
TD244-P4NB7-YQ6XK-Y8MMM-YWV2J
```
验证步骤
1. 新建项目 → 语言选 C# → 搜索“VSTO”,能看到“Word 外接程序 (.NET Framework)”模板即成功 。
2. 直接 F5,Word 启动并在“加载项”页出现默认 Ribbon,说明调试环境就绪。

View File

@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.36915.13 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WordAddIn", "WordAddIn\WordAddIn.csproj", "{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AA8EFE82-D53C-4781-B63A-98CE9009C192}
EndGlobalSection
EndGlobal

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,329 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Office = Microsoft.Office.Core;
using Word = Microsoft.Office.Interop.Word;
using WordAddIn.Properties; // 引用 Properties 命名空间
namespace WordAddIn
{
[ComVisible(true)]
public class AiRibbon : Office.IRibbonExtensibility
{
private Office.IRibbonUI ribbon;
private AiService _aiService = new AiService();
private static bool _isLoggedIn = false; // 登录状态 (静态变量,确保整个应用程序生命周期内有效)
public AiRibbon()
{
}
#region IRibbonExtensibility 成员
public string GetCustomUI(string ribbonID)
{
return GetResourceText("WordAddIn.AiRibbon.xml");
}
#endregion
#region Ribbon 回调
public void Ribbon_Load(Office.IRibbonUI ribbonUI)
{
this.ribbon = ribbonUI;
}
public async void OnExpandClick(Office.IRibbonControl control)
{
if (!EnsureLoggedIn()) return;
LoadingForm loading = null;
try
{
var selection = Globals.ThisAddIn.Application.Selection;
if (string.IsNullOrWhiteSpace(selection.Text))
{
MessageBox.Show("请先选择一段需要扩写的文字。");
return;
}
// 弹出选项设置窗体
string customPrompt = null;
using (var optionsForm = new ExpandOptionsForm())
{
if (optionsForm.ShowDialog() != DialogResult.OK)
{
return; // 用户取消
}
customPrompt = optionsForm.SelectedPrompt;
}
string originalText = selection.Text.Trim();
// 显示加载窗体
loading = new LoadingForm("AI 正在扩写中,请稍候...");
loading.Show();
loading.Refresh(); // 强制重绘
// 在后台线程运行 AI 请求,防止阻塞 UI
string expandedText = await Task.Run(() => _aiService.ExpandText(originalText, customPrompt));
if (!string.IsNullOrEmpty(expandedText))
{
selection.Text = expandedText;
}
}
catch (Exception ex)
{
MessageBox.Show("扩写失败: " + ex.Message);
}
finally
{
if (loading != null)
{
loading.CloseSafe();
loading.Dispose();
}
}
}
public async void OnFormatClick(Office.IRibbonControl control)
{
if (!EnsureLoggedIn()) return;
LoadingForm loading = null;
try
{
var selection = Globals.ThisAddIn.Application.Selection;
if (string.IsNullOrWhiteSpace(selection.Text))
{
MessageBox.Show("请先选择需要格式化的文字。");
return;
}
// 直接从配置读取设置,不再弹出窗体
string fontName = Settings.Default.FormatFontName;
float fontSize = Settings.Default.FormatFontSize;
float lineSpacing = Settings.Default.FormatLineSpacing;
string originalText = selection.Text;
loading = new LoadingForm("AI 正在格式化,请稍候...");
loading.Show();
loading.Refresh();
string formattedText = await Task.Run(() => _aiService.FormatText(originalText));
if (!string.IsNullOrEmpty(formattedText))
{
// 回写文本并应用样式
selection.Text = formattedText;
// 应用字体样式
selection.Font.Name = fontName;
selection.Font.Size = fontSize;
// 应用段落样式
var paragraphFormat = selection.ParagraphFormat;
paragraphFormat.LineSpacingRule = Word.WdLineSpacing.wdLineSpaceMultiple;
paragraphFormat.LineSpacing = selection.Font.Size * lineSpacing;
paragraphFormat.CharacterUnitFirstLineIndent = 2;
}
}
catch (Exception ex)
{
MessageBox.Show("格式化失败: " + ex.Message);
}
finally
{
if (loading != null)
{
loading.CloseSafe();
loading.Dispose();
}
}
}
public void OnFormatSettingClick(Office.IRibbonControl control)
{
if (!EnsureLoggedIn()) return;
using (var formatForm = new FormatOptionsForm())
{
formatForm.ShowDialog();
// 窗体内部已经处理了保存逻辑,这里不需要额外操作
}
}
public async void OnImageClick(Office.IRibbonControl control)
{
if (!EnsureLoggedIn()) return;
LoadingForm loading = null;
try
{
var selection = Globals.ThisAddIn.Application.Selection;
string prompt = selection.Text;
if (string.IsNullOrWhiteSpace(prompt))
{
MessageBox.Show("请先选择一段描述图片的文字。");
return;
}
// 弹出图片风格设置窗体
string style = null;
string additionalPrompt = null;
using (var imgOptions = new ImageOptionsForm())
{
if (imgOptions.ShowDialog() != DialogResult.OK)
{
return; // 用户取消
}
style = imgOptions.SelectedStyle;
additionalPrompt = imgOptions.AdditionalPrompt;
}
// 组合 Prompt
if (!string.IsNullOrWhiteSpace(additionalPrompt))
{
prompt += $"\n补充要求: {additionalPrompt}";
}
loading = new LoadingForm("AI 正在绘制图片,请稍候...");
loading.Show();
loading.Refresh();
// 传入 style 参数
string imageUrl = await Task.Run(() => _aiService.GenerateImageUrl(prompt, style));
if (!string.IsNullOrEmpty(imageUrl))
{
InsertImageFromUrl(imageUrl);
}
else
{
MessageBox.Show("未生成图片 URL。");
}
}
catch (Exception ex)
{
MessageBox.Show("图片生成失败: " + ex.Message);
}
finally
{
if (loading != null)
{
loading.CloseSafe();
loading.Dispose();
}
}
}
public void OnSettingsClick(Office.IRibbonControl control)
{
MessageBox.Show("请在代码 AiService.cs 中配置您的 API Key。", "设置");
}
#endregion
#region 帮助器
private bool EnsureLoggedIn()
{
if (_isLoggedIn) return true;
using (var loginForm = new LoginForm())
{
if (loginForm.ShowDialog() == DialogResult.OK)
{
_isLoggedIn = true;
return true;
}
}
return false;
}
private void InsertImageFromUrl(string imageUrl)
{
string tempFile = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString() + ".png");
try
{
using (WebClient client = new WebClient())
{
client.DownloadFile(imageUrl, tempFile);
}
var selection = Globals.ThisAddIn.Application.Selection;
// 移动到选区末尾插入,避免覆盖文字
selection.Collapse(Word.WdCollapseDirection.wdCollapseEnd);
selection.TypeParagraph(); // 将图片嵌入文档
var inlineShape = selection.InlineShapes.AddPicture(tempFile, LinkToFile: false, SaveWithDocument: true);
// 自动调整图片大小为页面宽度的 80% (留出一点边距更美观)
try
{
var pageSetup = selection.PageSetup;
float pageWidth = pageSetup.PageWidth;
float leftMargin = pageSetup.LeftMargin;
float rightMargin = pageSetup.RightMargin;
// 有效内容宽度
float contentWidth = pageWidth - leftMargin - rightMargin;
// 设置图片宽度 (如果图片本身小于页面宽度,也可以选择不放大,这里强制设为 100% 宽度)
inlineShape.Width = contentWidth;
// 保持纵横比
inlineShape.LockAspectRatio = Microsoft.Office.Core.MsoTriState.msoTrue;
}
catch
{
// 如果获取页面设置失败,给一个默认值 (500磅,约17.6cm,接近A4宽度)
inlineShape.Width = 500;
}
}
catch (Exception ex)
{
throw new Exception("图片下载或插入失败: " + ex.Message);
}
finally
{
if (File.Exists(tempFile))
{
try { File.Delete(tempFile); } catch { }
}
}
}
private static string GetResourceText(string resourceName)
{
Assembly asm = Assembly.GetExecutingAssembly();
string[] resourceNames = asm.GetManifestResourceNames();
for (int i = 0; i < resourceNames.Length; ++i)
{
if (string.Compare(resourceName, resourceNames[i], StringComparison.OrdinalIgnoreCase) == 0)
{
using (StreamReader resourceReader = new StreamReader(asm.GetManifestResourceStream(resourceNames[i])))
{
if (resourceReader != null)
{
return resourceReader.ReadToEnd();
}
}
}
}
return null;
}
#endregion
}
}

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
<ribbon>
<tabs>
<tab id="tabAiAssistant" label="AI助手">
<group id="groupContent" label="内容创作">
<button id="btnExpand" label="智能扩写" size="large" onAction="OnExpandClick" imageMso="FunctionsLogicalInsertGallery" />
<button id="btnFormat" label="格式美化" imageMso="FontColorCycle" size="large" onAction="OnFormatClick" />
<button id="btnFormatSetting" label="格式设置" imageMso="FontDialog" size="large" onAction="OnFormatSettingClick" />
<button id="btnImage" label="生成配图" size="large" onAction="OnImageClick" imageMso="PictureInsertFromFile" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>

View File

@@ -0,0 +1,178 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using WordAddIn.Models;
namespace WordAddIn
{
public class AiService
{
// 兔子平台配置
private const string ApiKey = "sk-FCwlaMANKdSlXlY7HkzZncSp0N5gecfpQdk0iR059Hfk4dQ1";
private const string BaseUrl = "https://api.tu-zi.com/v1";
// 模型配置
private const string TextModel = "gemini-3-flash-preview";
private const string ImageModel = "gemini-3-pro-image-preview";
private static readonly HttpClient _httpClient;
static AiService()
{
// 必须强制启用 TLS 1.2,否则无法连接现代 HTTPS 站点
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
_httpClient = new HttpClient();
_httpClient.Timeout = TimeSpan.FromSeconds(60);
_httpClient.DefaultRequestHeaders.Add("Authorization", $"Bearer {ApiKey}");
}
public async Task<string> ExpandText(string originalText, string customInstruction = null)
{
string instruction = string.IsNullOrWhiteSpace(customInstruction)
? "请将以下内容扩写成一段正式、通顺的段落,保持原意但增加细节"
: customInstruction;
var messages = new List<Message>
{
new Message { role = "system", content = "你是一个专业的文档编辑助手。请直接输出扩写后的纯文本内容,严禁使用Markdown格式(如##标题、**加粗**等),不要输出任何前言或后语。" },
new Message { role = "user", content = $"{instruction}:\n\n{originalText}" }
};
return await GetChatCompletion(messages);
}
public async Task<string> FormatText(string originalText)
{
var messages = new List<Message>
{
new Message { role = "system", content = "你是一个文档排版专家。请直接输出处理后的纯文本,严禁使用Markdown格式,不要包含任何解释性文字。" },
new Message { role = "user", content = $"请对以下文本进行格式化和润色:修正错别字、规范标点符号、优化分段,使其看起来更专业:\n\n{originalText}" }
};
return await GetChatCompletion(messages);
}
public async Task<string> GenerateImageUrl(string prompt, string style = null)
{
try
{
// 1. 优化 Prompt:将用户输入转换为安全的英文绘图 Prompt,并注入风格
string optimizedPrompt = await OptimizePromptForImage(prompt, style);
// 使用匿名对象以获得最大灵活性
var requestBody = new
{
prompt = optimizedPrompt,
model = ImageModel,
size = "1024x1024",
response_format = "url" // 显式请求 URL 格式
};
var json = JsonConvert.SerializeObject(requestBody);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await _httpClient.PostAsync($"{BaseUrl}/images/generations", content);
var responseString = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode)
{
throw new Exception($"API Error ({response.StatusCode}): {responseString}");
}
// 使用 JObject 动态解析
var jsonResponse = JObject.Parse(responseString);
// 1. 尝试解析标准格式: data[0].url
var data = jsonResponse["data"];
if (data != null)
{
if (data.Type == JTokenType.Array && data.HasValues)
{
var firstItem = data[0];
// Gemini 3 image preview 可能会返回 revised_prompt 和 url
if (firstItem["url"] != null) return firstItem["url"].ToString();
// 有时它会返回 NO_IMAGE,这可能是模型拒绝了,或者格式不对
if (firstItem["revised_prompt"] != null && firstItem["revised_prompt"].ToString() == "NO_IMAGE")
{
// 尝试从其他字段找,或者这就是个错误
// 如果是 NO_IMAGE,通常意味着内容安全拦截或生成失败
// 但这里我们先假设它可能在别的字段
}
// 某些 API 可能直接在数组里放 URL 字符串
if (firstItem.Type == JTokenType.String) return firstItem.ToString();
}
// 2. 尝试解析 data 为直接字符串的情况
else if (data.Type == JTokenType.String)
{
return data.ToString();
}
}
// 3. 尝试解析根节点 url
if (jsonResponse["url"] != null)
{
return jsonResponse["url"].ToString();
}
throw new Exception($"无法从响应中解析图片 URL。原始响应: {responseString}");
}
catch (Exception ex)
{
throw new Exception($"生图请求失败: {ex.Message}", ex);
}
}
private async Task<string> OptimizePromptForImage(string originalPrompt, string style = null)
{
string styleInstruction = string.IsNullOrEmpty(style) ? "" : $"6. 图片风格必须严格遵循:{style}。";
var messages = new List<Message>
{
new Message { role = "system", content = $"你是一个专业的AI绘图提示词专家。你的任务是将用户的输入转化为一段高质量的、英文的DALL-E 3绘图提示词。请遵循以下规则:\n1. 描述画面的部分必须翻译成英文。\n2. 提炼核心意象,去除无关的修饰语或敏感词。\n3. 增加艺术风格、光影、构图等细节描述。\n4. 直接输出最终的英文Prompt,不要包含任何解释或前言后语。\n5. 确保内容安全,符合通用内容审核标准。\n{styleInstruction}\n7. 【重要约束】如果画面中需要包含任何文字(Text/Label/Title),必须严格保留中文(Simplified Chinese),并明确指示 'text in Chinese',绝对禁止在画面中生成英文文字。" },
new Message { role = "user", content = $"请根据以下描述生成一段绘图Prompt:\n{originalPrompt}" }
};
return await GetChatCompletion(messages);
}
private async Task<string> GetChatCompletion(List<Message> messages)
{
try
{
var requestBody = new ChatCompletionRequest
{
messages = messages,
model = TextModel
};
var json = JsonConvert.SerializeObject(requestBody);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await _httpClient.PostAsync($"{BaseUrl}/chat/completions", content);
var responseString = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode)
{
throw new Exception($"API Error ({response.StatusCode}): {responseString}");
}
var result = JsonConvert.DeserializeObject<ChatCompletionResponse>(responseString);
return result?.choices?.FirstOrDefault()?.message?.content;
}
catch (Exception ex)
{
// 抛出更详细的错误
throw new Exception($"AI 请求失败: {ex.Message}", ex);
}
}
}
}

View File

@@ -0,0 +1,102 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace WordAddIn
{
public class ExpandOptionsForm : Form
{
public string SelectedPrompt { get; private set; }
private ComboBox cmbTemplates;
private TextBox txtCustomPrompt;
private Button btnOk;
private Button btnCancel;
private readonly Dictionary<string, string> _templates = new Dictionary<string, string>
{
{ "默认扩写", "请将以下内容扩写成一段正式、通顺的段落,保持原意但增加细节。" },
{ "细腻情感", "请对选中文本进行扩写,重点从心理活动、情绪变化和感官体验三个维度进行细腻描写。" },
{ "商务正式", "请将选中文本改写为商务职场风格,使用专业术语,语气正式且客观。" },
{ "生动故事", "请将选中文本扩写为一个生动的小故事,增加对话和场景描写,使其引人入胜。" },
{ "学术严谨", "请将选中文本扩写为学术风格,逻辑严密,用词精准,适合用于论文或报告。" },
{ "诗意唯美", "请用优美、诗意的语言扩写选中文本,多用修辞手法,营造唯美的意境。" }
};
public ExpandOptionsForm()
{
InitializeComponent();
InitializeTemplates();
}
private void InitializeComponent()
{
this.Text = "智能扩写设置";
this.Size = new Size(500, 350);
this.StartPosition = FormStartPosition.CenterScreen;
this.FormBorderStyle = FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
// Labels
var lblTemplate = new Label { Text = "选择预设模板:", Location = new Point(20, 20), AutoSize = true };
var lblCustom = new Label { Text = "扩写要求 (可修改):", Location = new Point(20, 80), AutoSize = true };
// ComboBox
cmbTemplates = new ComboBox { Location = new Point(20, 45), Width = 440, DropDownStyle = ComboBoxStyle.DropDownList };
cmbTemplates.SelectedIndexChanged += CmbTemplates_SelectedIndexChanged;
// TextBox
txtCustomPrompt = new TextBox { Location = new Point(20, 105), Width = 440, Height = 120, Multiline = true, ScrollBars = ScrollBars.Vertical };
// Buttons
btnOk = new Button { Text = "开始扩写", Location = new Point(260, 250), Width = 90, Height = 35, DialogResult = DialogResult.OK };
btnOk.Click += BtnOk_Click;
btnCancel = new Button { Text = "取消", Location = new Point(370, 250), Width = 90, Height = 35, DialogResult = DialogResult.Cancel };
// Add Controls
this.Controls.Add(lblTemplate);
this.Controls.Add(cmbTemplates);
this.Controls.Add(lblCustom);
this.Controls.Add(txtCustomPrompt);
this.Controls.Add(btnOk);
this.Controls.Add(btnCancel);
this.AcceptButton = btnOk;
this.CancelButton = btnCancel;
}
private void InitializeTemplates()
{
foreach (var key in _templates.Keys)
{
cmbTemplates.Items.Add(key);
}
if (cmbTemplates.Items.Count > 0)
{
cmbTemplates.SelectedIndex = 0;
}
}
private void CmbTemplates_SelectedIndexChanged(object sender, EventArgs e)
{
if (cmbTemplates.SelectedItem != null && _templates.ContainsKey(cmbTemplates.SelectedItem.ToString()))
{
txtCustomPrompt.Text = _templates[cmbTemplates.SelectedItem.ToString()];
}
}
private void BtnOk_Click(object sender, EventArgs e)
{
SelectedPrompt = txtCustomPrompt.Text.Trim();
if (string.IsNullOrEmpty(SelectedPrompt))
{
MessageBox.Show("扩写要求不能为空。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
this.DialogResult = DialogResult.None; // Prevent closing
return;
}
}
}
}

View File

@@ -0,0 +1,120 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using WordAddIn.Properties;
namespace WordAddIn
{
public class FormatOptionsForm : Form
{
public string SelectedFontName { get; private set; }
public float SelectedFontSize { get; private set; }
public float SelectedLineSpacing { get; private set; }
private ComboBox cmbFontName;
private ComboBox cmbFontSize;
private ComboBox cmbLineSpacing;
private Button btnOk;
private Button btnCancel;
public FormatOptionsForm()
{
InitializeComponent();
LoadSettings();
}
private void InitializeComponent()
{
this.Text = "格式化设置";
this.Size = new Size(350, 250);
this.StartPosition = FormStartPosition.CenterScreen;
this.FormBorderStyle = FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
int labelX = 30;
int inputX = 120;
int startY = 30;
int gapY = 40;
// 1. 字体
var lblFont = new Label { Text = "字体:", Location = new Point(labelX, startY + 5), AutoSize = true };
cmbFontName = new ComboBox { Location = new Point(inputX, startY), Width = 150, DropDownStyle = ComboBoxStyle.DropDownList };
// 简单添加几个常用中文字体
cmbFontName.Items.AddRange(new object[] { "微软雅黑", "宋体", "黑体", "楷体", "Arial", "Times New Roman" });
// 2. 字号
var lblSize = new Label { Text = "字号:", Location = new Point(labelX, startY + gapY + 5), AutoSize = true };
cmbFontSize = new ComboBox { Location = new Point(inputX, startY + gapY), Width = 150, DropDownStyle = ComboBoxStyle.DropDownList };
cmbFontSize.Items.AddRange(new object[] { "9", "10", "10.5", "11", "12", "14", "16", "18", "22", "24" });
// 3. 行间距
var lblSpacing = new Label { Text = "行间距(倍):", Location = new Point(labelX, startY + gapY * 2 + 5), AutoSize = true };
cmbLineSpacing = new ComboBox { Location = new Point(inputX, startY + gapY * 2), Width = 150, DropDownStyle = ComboBoxStyle.DropDownList };
cmbLineSpacing.Items.AddRange(new object[] { "1.0", "1.25", "1.5", "2.0", "2.5", "3.0" });
// Buttons
btnOk = new Button { Text = "确定", Location = new Point(130, 160), Width = 80, Height = 30, DialogResult = DialogResult.OK };
btnOk.Click += BtnOk_Click;
btnCancel = new Button { Text = "取消", Location = new Point(220, 160), Width = 80, Height = 30, DialogResult = DialogResult.Cancel };
this.Controls.Add(lblFont);
this.Controls.Add(cmbFontName);
this.Controls.Add(lblSize);
this.Controls.Add(cmbFontSize);
this.Controls.Add(lblSpacing);
this.Controls.Add(cmbLineSpacing);
this.Controls.Add(btnOk);
this.Controls.Add(btnCancel);
this.AcceptButton = btnOk;
this.CancelButton = btnCancel;
}
private void LoadSettings()
{
// 读取保存的设置,如果没有则使用默认值
string fontName = Settings.Default.FormatFontName;
float fontSize = Settings.Default.FormatFontSize;
float lineSpacing = Settings.Default.FormatLineSpacing;
if (cmbFontName.Items.Contains(fontName))
cmbFontName.SelectedItem = fontName;
else
cmbFontName.SelectedIndex = 0;
string sizeStr = fontSize.ToString();
if (cmbFontSize.Items.Contains(sizeStr))
cmbFontSize.SelectedItem = sizeStr;
else
cmbFontSize.SelectedItem = "12";
string spacingStr = lineSpacing.ToString();
if (cmbLineSpacing.Items.Contains(spacingStr))
cmbLineSpacing.SelectedItem = spacingStr;
else
cmbLineSpacing.SelectedItem = "1.5";
}
private void BtnOk_Click(object sender, EventArgs e)
{
// 保存设置
if (cmbFontName.SelectedItem != null)
Settings.Default.FormatFontName = cmbFontName.SelectedItem.ToString();
if (cmbFontSize.SelectedItem != null && float.TryParse(cmbFontSize.SelectedItem.ToString(), out float size))
Settings.Default.FormatFontSize = size;
if (cmbLineSpacing.SelectedItem != null && float.TryParse(cmbLineSpacing.SelectedItem.ToString(), out float spacing))
Settings.Default.FormatLineSpacing = spacing;
Settings.Default.Save();
// 更新属性供外部调用
SelectedFontName = Settings.Default.FormatFontName;
SelectedFontSize = Settings.Default.FormatFontSize;
SelectedLineSpacing = Settings.Default.FormatLineSpacing;
}
}
}

View File

@@ -0,0 +1,89 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace WordAddIn
{
public class ImageOptionsForm : Form
{
public string SelectedStyle { get; private set; }
public string AdditionalPrompt { get; private set; }
private ComboBox cmbStyles;
private TextBox txtAdditionalPrompt;
private Button btnOk;
private Button btnCancel;
private readonly string[] _styles = new string[]
{
"写实摄影 (Photorealistic)",
"软件架构图 (Architecture Diagram)",
"技术原理图 (Technical Schematic)",
"手绘草图 (Sketch)",
"卡通插画 (Cartoon)",
"3D 渲染 (3D Render)",
"水彩画 (Watercolor)",
"赛博朋克 (Cyberpunk)"
};
public ImageOptionsForm()
{
InitializeComponent();
InitializeStyles();
}
private void InitializeComponent()
{
this.Text = "生成配图设置";
this.Size = new Size(450, 300);
this.StartPosition = FormStartPosition.CenterScreen;
this.FormBorderStyle = FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
int startY = 30;
int gapY = 60;
int labelX = 30;
int inputX = 30;
int inputWidth = 370;
// 1. 风格选择
var lblStyle = new Label { Text = "图片风格:", Location = new Point(labelX, startY), AutoSize = true };
cmbStyles = new ComboBox { Location = new Point(inputX, startY + 25), Width = inputWidth, DropDownStyle = ComboBoxStyle.DropDownList };
// 2. 补充描述
var lblPrompt = new Label { Text = "补充描述 (可选,例如:背景要白色):", Location = new Point(labelX, startY + gapY + 10), AutoSize = true };
txtAdditionalPrompt = new TextBox { Location = new Point(inputX, startY + gapY + 35), Width = inputWidth, Height = 60, Multiline = true, ScrollBars = ScrollBars.Vertical };
// txtAdditionalPrompt.PlaceholderText = "例如:背景要白色,色调偏蓝...";
// Buttons
btnOk = new Button { Text = "生成图片", Location = new Point(210, 210), Width = 90, Height = 35, DialogResult = DialogResult.OK };
btnOk.Click += BtnOk_Click;
btnCancel = new Button { Text = "取消", Location = new Point(310, 210), Width = 90, Height = 35, DialogResult = DialogResult.Cancel };
this.Controls.Add(lblStyle);
this.Controls.Add(cmbStyles);
this.Controls.Add(lblPrompt);
this.Controls.Add(txtAdditionalPrompt);
this.Controls.Add(btnOk);
this.Controls.Add(btnCancel);
this.AcceptButton = btnOk;
this.CancelButton = btnCancel;
}
private void InitializeStyles()
{
cmbStyles.Items.AddRange(_styles);
cmbStyles.SelectedIndex = 0; // 默认选中第一个
}
private void BtnOk_Click(object sender, EventArgs e)
{
SelectedStyle = cmbStyles.SelectedItem.ToString();
AdditionalPrompt = txtAdditionalPrompt.Text.Trim();
}
}
}

View File

@@ -0,0 +1,155 @@
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace WordAddIn
{
public class LoadingForm : Form
{
private Label lblMessage;
private Timer animationTimer;
private int _spinnerAngle = 0;
private const int SPINNER_SIZE = 40;
// 现代化配色
private readonly Color _primaryColor = Color.FromArgb(43, 87, 154); // Word Blue
private readonly Color _backgroundColor = Color.White;
private readonly Color _borderColor = Color.FromArgb(220, 220, 220);
private readonly Font _textFont = new Font("Microsoft YaHei UI", 11F, FontStyle.Regular, GraphicsUnit.Point);
public LoadingForm(string message = "AI 正在思考中...")
{
InitializeComponent(message);
// 开启双缓冲以减少闪烁
this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true);
this.UpdateStyles();
this.Text = "教案AI助手";
}
private void InitializeComponent(string message)
{
this.SuspendLayout();
// Form settings
this.FormBorderStyle = FormBorderStyle.None;
this.StartPosition = FormStartPosition.CenterScreen;
this.Size = new Size(320, 140);
this.BackColor = _backgroundColor;
this.TopMost = true;
this.ShowInTaskbar = false;
// Timer
animationTimer = new Timer();
animationTimer.Interval = 30; // 33fps
animationTimer.Tick += AnimationTimer_Tick;
animationTimer.Start();
// Label
this.lblMessage = new Label();
this.lblMessage.Text = message;
this.lblMessage.AutoSize = false;
this.lblMessage.TextAlign = ContentAlignment.TopCenter;
this.lblMessage.Dock = DockStyle.None;
this.lblMessage.Width = this.Width;
this.lblMessage.Height = 30;
this.lblMessage.Location = new Point(0, 85); // 放在 Spinner 下方
this.lblMessage.Font = _textFont;
this.lblMessage.ForeColor = Color.FromArgb(64, 64, 64);
this.Controls.Add(this.lblMessage);
this.ResumeLayout(false);
}
private void AnimationTimer_Tick(object sender, EventArgs e)
{
_spinnerAngle = (_spinnerAngle + 10) % 360;
this.Invalidate(); // 触发重绘
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
Graphics g = e.Graphics;
g.SmoothingMode = SmoothingMode.HighQuality;
// 1. 绘制边框
using (Pen borderPen = new Pen(_borderColor, 1))
{
g.DrawRectangle(borderPen, 0, 0, this.Width - 1, this.Height - 1);
}
// 2. 绘制 Spinner (中心位置)
int centerX = this.Width / 2;
int centerY = 50; // 偏上一点
g.TranslateTransform(centerX, centerY);
g.RotateTransform(_spinnerAngle);
// 绘制一个渐变的圆环或一串圆点
// 这里我们画 8 个圆点,透明度渐变
int dotCount = 10;
int radius = SPINNER_SIZE / 2;
int dotSize = 6;
for (int i = 0; i < dotCount; i++)
{
// 计算每个点的透明度 (0-255)
// 使得看起来像是有拖尾
int alpha = 255 * (i + 1) / dotCount;
using (Brush brush = new SolidBrush(Color.FromArgb(alpha, _primaryColor)))
{
// 保存当前状态
var state = g.Save();
// 旋转到对应角度
float angle = 360f / dotCount * i;
g.RotateTransform(angle);
// 在半径处画圆点
g.FillEllipse(brush, radius - dotSize, -dotSize / 2, dotSize, dotSize);
// 恢复状态
g.Restore(state);
}
}
g.ResetTransform();
}
// 允许在非 UI 线程关闭窗体
public void CloseSafe()
{
if (this.IsDisposed) return;
if (this.InvokeRequired)
{
this.Invoke(new Action(CloseSafe));
}
else
{
animationTimer.Stop();
this.Close();
}
}
// 允许拖动窗体
protected override void OnMouseDown(MouseEventArgs e)
{
base.OnMouseDown(e);
if (e.Button == MouseButtons.Left)
{
ReleaseCapture();
SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
}
}
[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern bool ReleaseCapture();
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HT_CAPTION = 0x2;
}
}

View File

@@ -0,0 +1,115 @@
using System;
using System.Drawing;
using System.Windows.Forms;
namespace WordAddIn
{
public class LoginForm : Form
{
private TextBox txtUsername;
private TextBox txtPassword;
private Button btnLogin;
private Button btnCancel;
public LoginForm()
{
InitializeComponent();
}
private void InitializeComponent()
{
this.Text = "AI助手 - 用户登录";
this.Size = new Size(500, 320); // 增大尺寸
this.StartPosition = FormStartPosition.CenterScreen;
this.FormBorderStyle = FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.BackColor = Color.White;
// 调整布局参数
int startY = 80;
int gapY = 60;
int labelX = 80;
int inputX = 160;
int inputWidth = 220;
// 标题区域
Label lblTitle = new Label
{
Text = "教案AI助手",
Font = new Font("微软雅黑", 16, FontStyle.Bold),
Location = new Point(0, 25),
AutoSize = false,
Width = 500,
TextAlign = ContentAlignment.MiddleCenter,
ForeColor = Color.FromArgb(43, 87, 154)
};
this.Controls.Add(lblTitle);
// 1. 用户名
var lblUser = new Label { Text = "用户名:", Location = new Point(labelX, startY + 5), AutoSize = true, Font = new Font("微软雅黑", 11) };
txtUsername = new TextBox { Location = new Point(inputX, startY), Width = inputWidth, Font = new Font("微软雅黑", 11), Text = "huanghai" };
// 2. 密码
var lblPass = new Label { Text = "密 码:", Location = new Point(labelX, startY + gapY + 5), AutoSize = true, Font = new Font("微软雅黑", 11) };
txtPassword = new TextBox { Location = new Point(inputX, startY + gapY), Width = inputWidth, Font = new Font("微软雅黑", 11), PasswordChar = '●', Text = "12345678" };
// Buttons
btnLogin = new Button
{
Text = "立即登录",
Location = new Point(110, 220),
Width = 120,
Height = 40,
BackColor = Color.FromArgb(43, 87, 154),
ForeColor = Color.White,
FlatStyle = FlatStyle.Flat,
DialogResult = DialogResult.None,
Font = new Font("微软雅黑", 10, FontStyle.Bold),
Cursor = Cursors.Hand
};
btnLogin.FlatAppearance.BorderSize = 0;
btnLogin.Click += BtnLogin_Click;
btnCancel = new Button
{
Text = "取消",
Location = new Point(250, 220),
Width = 120,
Height = 40,
DialogResult = DialogResult.Cancel,
Font = new Font("微软雅黑", 10),
Cursor = Cursors.Hand
};
this.Controls.Add(lblUser);
this.Controls.Add(txtUsername);
this.Controls.Add(lblPass);
this.Controls.Add(txtPassword);
this.Controls.Add(btnLogin);
this.Controls.Add(btnCancel);
this.AcceptButton = btnLogin;
this.CancelButton = btnCancel;
}
private void BtnLogin_Click(object sender, EventArgs e)
{
string user = txtUsername.Text.Trim();
string pass = txtPassword.Text.Trim();
// 模拟验证逻辑
if (user == "huanghai" && pass == "12345678")
{
this.DialogResult = DialogResult.OK;
this.Close();
}
else
{
MessageBox.Show("用户名或密码错误!\n(默认账号: huanghai, 密码: 12345678)", "登录失败", MessageBoxButtons.OK, MessageBoxIcon.Error);
txtPassword.Focus();
txtPassword.SelectAll();
}
}
}
}

View File

@@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
namespace WordAddIn.Models
{
// Chat Completion Models
public class ChatCompletionRequest
{
public string model { get; set; } = "gpt-3.5-turbo";
public List<Message> messages { get; set; }
public double temperature { get; set; } = 0.7;
}
public class Message
{
public string role { get; set; }
public string content { get; set; }
}
public class ChatCompletionResponse
{
public string id { get; set; }
public List<Choice> choices { get; set; }
}
public class Choice
{
public Message message { get; set; }
}
// Image Generation Models
public class ImageGenerationRequest
{
public string model { get; set; } = "dall-e-3";
public string prompt { get; set; }
public int n { get; set; } = 1;
public string size { get; set; } = "1024x1024";
}
public class ImageGenerationResponse
{
public List<ImageItem> data { get; set; }
}
public class ImageItem
{
public string url { get; set; }
}
}

View File

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

View File

@@ -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 WordAddIn.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("WordAddIn.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;
}
}
}
}

View File

@@ -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>

View File

@@ -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 WordAddIn.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;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("微软雅黑")]
public string FormatFontName {
get {
return ((string)(this["FormatFontName"]));
}
set {
this["FormatFontName"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("12")]
public float FormatFontSize {
get {
return ((float)(this["FormatFontSize"]));
}
set {
this["FormatFontSize"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1.5")]
public float FormatLineSpacing {
get {
return ((float)(this["FormatLineSpacing"]));
}
set {
this["FormatLineSpacing"] = value;
}
}
}
}

View File

@@ -0,0 +1,17 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="WordAddIn.Properties" GeneratedClassName="Settings">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings>
<Setting Name="FormatFontName" Type="System.String" Scope="User">
<Value Profile="(Default)">微软雅黑</Value>
</Setting>
<Setting Name="FormatFontSize" Type="System.Single" Scope="User">
<Value Profile="(Default)">12</Value>
</Setting>
<Setting Name="FormatLineSpacing" Type="System.Single" Scope="User">
<Value Profile="(Default)">1.5</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@@ -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 WordAddIn {
///
[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) {
}
}
}

View File

@@ -0,0 +1,5 @@
<hostitem:hostItem hostitem:baseType="Microsoft.Office.Tools.AddInBase" hostitem:namespace="WordAddIn" 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>

View File

@@ -0,0 +1,41 @@
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 WordAddIn
{
public partial class ThisAddIn
{
protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
{
return new AiRibbon();
}
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
}
}

View File

@@ -0,0 +1,277 @@
<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>{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}</ProjectGuid>
<OutputType>Library</OutputType>
<NoStandardLibraries>false</NoStandardLibraries>
<RootNamespace>WordAddIn</RootNamespace>
<AssemblyName>WordAddIn</AssemblyName>
<LoadBehavior>3</LoadBehavior>
<TargetFrameworkVersion>v4.7.2</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>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.Net.Http" />
<Reference Include="System.Xml.Linq" />
<Reference Include="Newtonsoft.Json">
<HintPath>..\..\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<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>
<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.Word, 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.Word">
<Guid>{00020905-0000-0000-C000-000000000046}</Guid>
<VersionMajor>8</VersionMajor>
<VersionMinor>6</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="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<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>
<Compile Include="AiRibbon.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Models.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="ExpandOptionsForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormatOptionsForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ImageOptionsForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="LoginForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="LoadingForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="AiService.cs">
<SubType>Code</SubType>
</Compile>
<EmbeddedResource Include="AiRibbon.xml" />
<None Include="ThisAddIn.Designer.xml">
<DependentUpon>ThisAddIn.cs</DependentUpon>
</None>
<Compile Include="ThisAddIn.Designer.cs">
<DependentUpon>ThisAddIn.Designer.xml</DependentUpon>
</Compile>
<AppDesigner Include="Properties\" />
<None Include="WordAddIn_TemporaryKey.pfx" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>WordAddIn_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>1B8D8AB21D9D321D59A4C13B926DAB7BD3677944</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="WordAddIn" 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>

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,203 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
<asmv1:assemblyIdentity name="WordAddIn.dll" version="1.0.0.0" publicKeyToken="06a92c46db516926" language="neutral" processorArchitecture="msil" type="win32" />
<description xmlns="urn:schemas-microsoft-com:asm.v1">WordAddIn</description>
<application />
<entryPoint>
<co.v1:customHostSpecified />
</entryPoint>
<trustInfo>
<security>
<applicationRequestMinimum>
<PermissionSet Unrestricted="true" ID="Custom" SameSite="site" />
<defaultAssemblyRequest permissionSetReference="Custom" />
</applicationRequestMinimum>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!--
UAC 清单选项
如果要更改 Windows 用户帐户控制级别,请用以下节点之一替换
requestedExecutionLevel 节点。
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
如果要利用文件和注册表虚拟化提供
向后兼容性,请删除 requestedExecutionLevel 节点。
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentOS>
<osVersionInfo>
<os majorVersion="5" minorVersion="1" buildNumber="2600" servicePackMajor="0" />
</osVersionInfo>
</dependentOS>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="Microsoft.Windows.CommonLanguageRuntime" version="4.0.30319.0" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="Accessibility" version="4.0.0.0" publicKeyToken="B03F5F7F11D50A3A" language="neutral" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="Microsoft.CSharp" version="4.0.0.0" publicKeyToken="B03F5F7F11D50A3A" language="neutral" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="Microsoft.Office.Tools" version="10.0.0.0" publicKeyToken="B03F5F7F11D50A3A" language="neutral" processorArchitecture="msil" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="Microsoft.Office.Tools.Common" version="10.0.0.0" publicKeyToken="B03F5F7F11D50A3A" language="neutral" processorArchitecture="msil" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="Microsoft.Office.Tools.v4.0.Framework" version="10.0.0.0" publicKeyToken="B03F5F7F11D50A3A" language="neutral" processorArchitecture="msil" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="Microsoft.Office.Tools.Word" version="10.0.0.0" publicKeyToken="B03F5F7F11D50A3A" language="neutral" processorArchitecture="msil" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="Microsoft.VisualStudio.Tools.Applications.Runtime" version="10.0.0.0" publicKeyToken="B03F5F7F11D50A3A" language="neutral" processorArchitecture="msil" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="mscorlib" version="4.0.0.0" publicKeyToken="B77A5C561934E089" language="neutral" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="stdole" version="7.0.3300.0" publicKeyToken="B03F5F7F11D50A3A" language="neutral" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="System" version="4.0.0.0" publicKeyToken="B77A5C561934E089" language="neutral" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="System.Core" version="4.0.0.0" publicKeyToken="B77A5C561934E089" language="neutral" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="System.Data" version="4.0.0.0" publicKeyToken="B77A5C561934E089" language="neutral" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="System.Data.DataSetExtensions" version="4.0.0.0" publicKeyToken="B77A5C561934E089" language="neutral" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="System.Drawing" version="4.0.0.0" publicKeyToken="B03F5F7F11D50A3A" language="neutral" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="System.Net.Http" version="4.2.0.0" publicKeyToken="B03F5F7F11D50A3A" language="neutral" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="System.Numerics" version="4.0.0.0" publicKeyToken="B77A5C561934E089" language="neutral" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="System.Runtime.Serialization" version="4.0.0.0" publicKeyToken="B77A5C561934E089" language="neutral" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="System.Windows.Forms" version="4.0.0.0" publicKeyToken="B77A5C561934E089" language="neutral" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="System.Xml" version="4.0.0.0" publicKeyToken="B77A5C561934E089" language="neutral" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="System.Xml.Linq" version="4.0.0.0" publicKeyToken="B77A5C561934E089" language="neutral" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="Microsoft.Office.Tools.Common.v4.0.Utilities.dll" size="32664">
<assemblyIdentity name="Microsoft.Office.Tools.Common.v4.0.Utilities" version="10.0.0.0" publicKeyToken="B03F5F7F11D50A3A" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>jLCTF8Mm6bD4PDN+rnzN6q0+ReXaNgPh68kMWgatFwI=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="Newtonsoft.Json.dll" size="711952">
<assemblyIdentity name="Newtonsoft.Json" version="13.0.0.0" publicKeyToken="30AD4FE6B2A6AEED" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>4eJ697B+7t9c5xqSVfBCKBam/FhJpIPGcU4bRyBE+p0=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="WordAddIn.dll" size="49664">
<assemblyIdentity name="WordAddIn" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>ws0Owfb3Vh5rrqH3KFhjVewhHxPXmr61oUfFkebhGKY=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<vstav3:addIn xmlns:vstav3="urn:schemas-microsoft-com:vsta.v3">
<vstav3:entryPointsCollection>
<vstav3:entryPoints>
<vstav3:entryPoint class="WordAddIn.ThisAddIn">
<assemblyIdentity name="WordAddIn" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
</vstav3:entryPoint>
</vstav3:entryPoints>
</vstav3:entryPointsCollection>
<vstav3:update enabled="true">
<vstav3:expiration maximumAge="7" unit="days" />
</vstav3:update>
<vstav3:application>
<vstov4:customizations xmlns:vstov4="urn:schemas-microsoft-com:vsto.v4">
<vstov4:customization>
<vstov4:appAddIn application="Word" loadBehavior="3" keyName="WordAddIn">
<vstov4:friendlyName>WordAddIn</vstov4:friendlyName>
<vstov4:description>WordAddIn</vstov4:description>
<vstov4.1:ribbonTypes xmlns:vstov4.1="urn:schemas-microsoft-com:vsto.v4.1" />
</vstov4:appAddIn>
</vstov4:customization>
</vstov4:customizations>
</vstav3:application>
</vstav3:addIn>
<publisherIdentity name="CN=DESKTOP-Q6H7B6L\Administrator" issuerKeyHash="42606c52715d5764c2f9dab5bee6dcd76cc7a67d" /><Signature Id="StrongNameSignature" xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha256" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" /><DigestValue>DqAAToPVhsiUPXrTq2kOsFH6l68gm2paPTpz3h5Gc4g=</DigestValue></Reference></SignedInfo><SignatureValue>OFQIaxepzndJNyQU8ovSGVdFivUh5QRV44mTRYO6nAv7ebni4C1QHkpIFFipwEBJxpC7jAv8k4XAaMHIz5C3Aq61qXva4zl3fFNgrGR5CTYUF8QamUgnPsnnk4i+WKeGMkKcH2lXJzeGhPj7Uw68fpb0pw2GMI/NPU+EqW1Xrsw=</SignatureValue><KeyInfo Id="StrongNameKeyInfo"><KeyValue><RSAKeyValue><Modulus>23ghUI75yy8GcLhPT5yA+v2ssRfSW+chNqMI+pq5OAr7RXQJOt/+bHdoT9NoS9GQkvblc7ekoUNShIcN601ZZOPgAxkXaQS+La14Wp8GOwnM1qHNJwgla4VAIYjmCj3CUMXLsxspOFVZKRnB6/idYku4Gzhc7NjRBAwe8qWBXaE=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue><msrel:RelData xmlns:msrel="http://schemas.microsoft.com/windows/rel/2005/reldata"><r:license xmlns:r="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:as="http://schemas.microsoft.com/windows/pki/2005/Authenticode"><r:grant><as:ManifestInformation Hash="8873461ede733a3d5a6a9b20af97fa51b00e69abd37a3d94c886d5834e00a00e" Description="" Url=""><as:assemblyIdentity name="WordAddIn.dll" version="1.0.0.0" publicKeyToken="06a92c46db516926" language="neutral" processorArchitecture="msil" type="win32" /></as:ManifestInformation><as:SignedBy /><as:AuthenticodePublisher><as:X509SubjectName>CN=DESKTOP-Q6H7B6L\Administrator</as:X509SubjectName></as:AuthenticodePublisher></r:grant><r:issuer><Signature Id="AuthenticodeSignature" xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha256" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" /><DigestValue>WFZbnVcuOCJkl9aS7BRH3Rx4bl3xbgIQgZYWwUTHFv8=</DigestValue></Reference></SignedInfo><SignatureValue>Ym8g9hAc2/yKlwzv1q5kl78c6aBEWSXd8SS6IY4SYqi/M1EJA37jIMDpHxG7rs6Xu6SXoAnhmKH0G2MXkzZHSdSuOLArq3iz7CNBt3T83EXVJWOcIvWTpO9Xh2+dMCOoFXpHwnHeKKrzkFIUWMV/lbOYf1ahfHIG2cmsaT0Fk4g=</SignatureValue><KeyInfo><KeyValue><RSAKeyValue><Modulus>23ghUI75yy8GcLhPT5yA+v2ssRfSW+chNqMI+pq5OAr7RXQJOt/+bHdoT9NoS9GQkvblc7ekoUNShIcN601ZZOPgAxkXaQS+La14Wp8GOwnM1qHNJwgla4VAIYjmCj3CUMXLsxspOFVZKRnB6/idYku4Gzhc7NjRBAwe8qWBXaE=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue><X509Data><X509Certificate>MIICDTCCAXagAwIBAgIQJpSlsxfGbpRNgyjD5Q/yDjANBgkqhkiG9w0BAQsFADBFMUMwQQYDVQQDHjoARABFAFMASwBUAE8AUAAtAFEANgBIADcAQgA2AEwAXABBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByMB4XDTI2MDEyNDAwMzYxNVoXDTI3MDEyNDA2MzYxNVowRTFDMEEGA1UEAx46AEQARQBTAEsAVABPAFAALQBRADYASAA3AEIANgBMAFwAQQBkAG0AaQBuAGkAcwB0AHIAYQB0AG8AcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA23ghUI75yy8GcLhPT5yA+v2ssRfSW+chNqMI+pq5OAr7RXQJOt/+bHdoT9NoS9GQkvblc7ekoUNShIcN601ZZOPgAxkXaQS+La14Wp8GOwnM1qHNJwgla4VAIYjmCj3CUMXLsxspOFVZKRnB6/idYku4Gzhc7NjRBAwe8qWBXaECAwEAATANBgkqhkiG9w0BAQsFAAOBgQC3GjWMhEFFrn9PGYrQVGNAaibG1sR/eRX3ZWNRjYLhiqbsdeHvm4CX/W0EWd9yZlbaej87XyeUbX+mC3q3yMFVPCRn/W65WYyBPbWTWmSfU9VLKKULAH6WqjS7CqEU3cQSuKcU6nYG4AJu2/FkQJaA82tr3pvcQD28HmOlDeNh0Q==</X509Certificate></X509Data></KeyInfo></Signature></r:issuer></r:license></msrel:RelData></KeyInfo></Signature></asmv1:assembly>

Binary file not shown.

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
<assemblyIdentity name="WordAddIn.vsto" version="1.0.0.0" publicKeyToken="06a92c46db516926" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
<description asmv2:publisher="WordAddIn" asmv2:product="WordAddIn" xmlns="urn:schemas-microsoft-com:asm.v1" />
<deployment install="false" />
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
<framework targetVersion="4.7.2" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<dependency>
<dependentAssembly dependencyType="install" codebase="WordAddIn.dll.manifest" size="14626">
<assemblyIdentity name="WordAddIn.dll" version="1.0.0.0" publicKeyToken="06a92c46db516926" language="neutral" processorArchitecture="msil" type="win32" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>KJF0VyCleLGJmT+RfAio/uMXjja+YsHDCuln84rZQzA=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<publisherIdentity name="CN=DESKTOP-Q6H7B6L\Administrator" issuerKeyHash="42606c52715d5764c2f9dab5bee6dcd76cc7a67d" /><Signature Id="StrongNameSignature" xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha256" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" /><DigestValue>sSSqrkPxuzhxq/2B0WAtA5qCbD3NpVNwIaMMUQJ4GH4=</DigestValue></Reference></SignedInfo><SignatureValue>GWWmNCL6Zql6VcuzoWLZ6ZUCrHMIoYfT7O6ELchNAAB1v4Ag7JIFqRvqNBYyjKy1AbwB5ox7HXmIEWGeBF6rmoSDj58J+Tt8iNb8dwB+n3Y3305QL9Ncc8nsg715Q/voqyPS8wcFXhKuqFXB/ooQEjzM2THgjHAPNj5QImsWHww=</SignatureValue><KeyInfo Id="StrongNameKeyInfo"><KeyValue><RSAKeyValue><Modulus>23ghUI75yy8GcLhPT5yA+v2ssRfSW+chNqMI+pq5OAr7RXQJOt/+bHdoT9NoS9GQkvblc7ekoUNShIcN601ZZOPgAxkXaQS+La14Wp8GOwnM1qHNJwgla4VAIYjmCj3CUMXLsxspOFVZKRnB6/idYku4Gzhc7NjRBAwe8qWBXaE=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue><msrel:RelData xmlns:msrel="http://schemas.microsoft.com/windows/rel/2005/reldata"><r:license xmlns:r="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:as="http://schemas.microsoft.com/windows/pki/2005/Authenticode"><r:grant><as:ManifestInformation Hash="7e187802510ca3217053a5cd3d6c829a032d60d181fdab7138bbf143aeaa24b1" Description="" Url=""><as:assemblyIdentity name="WordAddIn.vsto" version="1.0.0.0" publicKeyToken="06a92c46db516926" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" /></as:ManifestInformation><as:SignedBy /><as:AuthenticodePublisher><as:X509SubjectName>CN=DESKTOP-Q6H7B6L\Administrator</as:X509SubjectName></as:AuthenticodePublisher></r:grant><r:issuer><Signature Id="AuthenticodeSignature" xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha256" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" /><DigestValue>xkWDGabpfIl/ph5hPVhZNW+9Ky35ZjwZaoQ4fS33NUc=</DigestValue></Reference></SignedInfo><SignatureValue>vQ+L+Tuz+V4znMunPxm/eBgn43R4hgUfhasobg+A2elJh8VNnfFh3TnWzA7KX5ziJTDt7grHhwj37+8RzjQLg0aBJwnrpuJXaQ86/BS5mNSiT7+/yFFbqSmn3u0QvSaEsT00rCVvrjFd1uzqikCnWtk/BuJoCZZjsomWbdFwu0w=</SignatureValue><KeyInfo><KeyValue><RSAKeyValue><Modulus>23ghUI75yy8GcLhPT5yA+v2ssRfSW+chNqMI+pq5OAr7RXQJOt/+bHdoT9NoS9GQkvblc7ekoUNShIcN601ZZOPgAxkXaQS+La14Wp8GOwnM1qHNJwgla4VAIYjmCj3CUMXLsxspOFVZKRnB6/idYku4Gzhc7NjRBAwe8qWBXaE=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue><X509Data><X509Certificate>MIICDTCCAXagAwIBAgIQJpSlsxfGbpRNgyjD5Q/yDjANBgkqhkiG9w0BAQsFADBFMUMwQQYDVQQDHjoARABFAFMASwBUAE8AUAAtAFEANgBIADcAQgA2AEwAXABBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByMB4XDTI2MDEyNDAwMzYxNVoXDTI3MDEyNDA2MzYxNVowRTFDMEEGA1UEAx46AEQARQBTAEsAVABPAFAALQBRADYASAA3AEIANgBMAFwAQQBkAG0AaQBuAGkAcwB0AHIAYQB0AG8AcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA23ghUI75yy8GcLhPT5yA+v2ssRfSW+chNqMI+pq5OAr7RXQJOt/+bHdoT9NoS9GQkvblc7ekoUNShIcN601ZZOPgAxkXaQS+La14Wp8GOwnM1qHNJwgla4VAIYjmCj3CUMXLsxspOFVZKRnB6/idYku4Gzhc7NjRBAwe8qWBXaECAwEAATANBgkqhkiG9w0BAQsFAAOBgQC3GjWMhEFFrn9PGYrQVGNAaibG1sR/eRX3ZWNRjYLhiqbsdeHvm4CX/W0EWd9yZlbaej87XyeUbX+mC3q3yMFVPCRn/W65WYyBPbWTWmSfU9VLKKULAH6WqjS7CqEU3cQSuKcU6nYG4AJu2/FkQJaA82tr3pvcQD28HmOlDeNh0Q==</X509Certificate></X509Data></KeyInfo></Signature></r:issuer></r:license></msrel:RelData></KeyInfo></Signature></asmv1:assembly>

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]

View File

@@ -0,0 +1 @@
5fe4f1b81525826b3c35a70e08c2be7c3a2421e496cccc58578a0a5deada23a0

View File

@@ -0,0 +1,13 @@
D:\dsWork\addOne\WordAddIn\WordAddIn\bin\Debug\WordAddIn.dll
D:\dsWork\addOne\WordAddIn\WordAddIn\bin\Debug\WordAddIn.pdb
D:\dsWork\addOne\WordAddIn\WordAddIn\bin\Debug\WordAddIn.dll.manifest
D:\dsWork\addOne\WordAddIn\WordAddIn\bin\Debug\WordAddIn.vsto
D:\dsWork\addOne\WordAddIn\WordAddIn\bin\Debug\Microsoft.Office.Tools.Common.v4.0.Utilities.dll
D:\dsWork\addOne\WordAddIn\WordAddIn\obj\Debug\WordAddIn.csproj.AssemblyReference.cache
D:\dsWork\addOne\WordAddIn\WordAddIn\obj\Debug\WordAddIn.Properties.Resources.resources
D:\dsWork\addOne\WordAddIn\WordAddIn\obj\Debug\WordAddIn.csproj.GenerateResource.cache
D:\dsWork\addOne\WordAddIn\WordAddIn\obj\Debug\WordAddIn.csproj.CoreCompileInputs.cache
D:\dsWork\addOne\WordAddIn\WordAddIn\obj\Debug\WordAddIn.csproj.Up2Date
D:\dsWork\addOne\WordAddIn\WordAddIn\obj\Debug\WordAddIn.dll
D:\dsWork\addOne\WordAddIn\WordAddIn\obj\Debug\WordAddIn.pdb
D:\dsWork\addOne\WordAddIn\WordAddIn\bin\Debug\Newtonsoft.Json.dll

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.4" targetFramework="net472" />
</packages>

Binary file not shown.

View File

@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2007 James Newton-King
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,71 @@
# ![Logo](https://raw.githubusercontent.com/JamesNK/Newtonsoft.Json/master/Doc/icons/logo.jpg) Json.NET
[![NuGet version (Newtonsoft.Json)](https://img.shields.io/nuget/v/Newtonsoft.Json.svg?style=flat-square)](https://www.nuget.org/packages/Newtonsoft.Json/)
[![Build status](https://dev.azure.com/jamesnk/Public/_apis/build/status/JamesNK.Newtonsoft.Json?branchName=master)](https://dev.azure.com/jamesnk/Public/_build/latest?definitionId=8)
Json.NET is a popular high-performance JSON framework for .NET
## Serialize JSON
```csharp
Product product = new Product();
product.Name = "Apple";
product.Expiry = new DateTime(2008, 12, 28);
product.Sizes = new string[] { "Small" };
string json = JsonConvert.SerializeObject(product);
// {
// "Name": "Apple",
// "Expiry": "2008-12-28T00:00:00",
// "Sizes": [
// "Small"
// ]
// }
```
## Deserialize JSON
```csharp
string json = @"{
'Name': 'Bad Boys',
'ReleaseDate': '1995-4-7T00:00:00',
'Genres': [
'Action',
'Comedy'
]
}";
Movie m = JsonConvert.DeserializeObject<Movie>(json);
string name = m.Name;
// Bad Boys
```
## LINQ to JSON
```csharp
JArray array = new JArray();
array.Add("Manual text");
array.Add(new DateTime(2000, 5, 23));
JObject o = new JObject();
o["MyArray"] = array;
string json = o.ToString();
// {
// "MyArray": [
// "Manual text",
// "2000-05-23T00:00:00"
// ]
// }
```
## Links
- [Homepage](https://www.newtonsoft.com/json)
- [Documentation](https://www.newtonsoft.com/json/help)
- [NuGet Package](https://www.nuget.org/packages/Newtonsoft.Json)
- [Release Notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
- [Contributing Guidelines](https://github.com/JamesNK/Newtonsoft.Json/blob/master/CONTRIBUTING.md)
- [License](https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md)
- [Stack Overflow](https://stackoverflow.com/questions/tagged/json.net)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB