利用 Visual Studio 自动化 API 创建插件和向导
在软件开发中,Visual Studio 是一款强大的集成开发环境(IDE),它提供了丰富的自动化 API,可用于创建插件和向导,以扩展其功能。本文将详细介绍如何利用这些 API 来创建插件和向导。
1. 插件代码示例及版本迁移
首先,我们来看一段插件代码示例:
public void OnHelp()
{
throw new NotImplementedException();
}
public void OnOK()
{
string codeValue = “CSharp”; // our default value
if (this.radioButtonVB.Checked)
{
codeValue = “VB”;
}
// update the registry with the new setting
RegistryKey regKey =
Registry.CurrentUser.OpenSubKey(@”Software\Contoso\Addins\
➥ColorPalette”);
regKey.SetValue(“Language”, codeValue);
}
#endregion
}
}
如果你有为旧版本 Visual Studio 编写的插件,需要对源代码进行一些小的更新,才能将功能完全迁移到 Visual Studio 2008。详细的迁移步骤可在 Visual Studio MSD
超级会员免费看
订阅专栏 解锁全文
5725

被折叠的 条评论
为什么被折叠?



