新聞中心
雖然有許多人對VS 2003插件的安全性表示懷疑,但在年復(fù)一年的不斷發(fā)展中,他的安全性也在不斷提高。保障VS 2003插件的安全性是完全有可能的,但前提是要深入理解到底什么是VS 2003插件,及他是怎么運作的。 #t#

成都創(chuàng)新互聯(lián)堅持“要么做到,要么別承諾”的工作理念,服務(wù)領(lǐng)域包括:網(wǎng)站建設(shè)、做網(wǎng)站、企業(yè)官網(wǎng)、英文網(wǎng)站、手機端網(wǎng)站、網(wǎng)站推廣等服務(wù),滿足客戶于互聯(lián)網(wǎng)時代的竹山網(wǎng)站設(shè)計、移動媒體設(shè)計的需求,幫助企業(yè)找到有效的互聯(lián)網(wǎng)解決方案。努力成為您成熟可靠的網(wǎng)絡(luò)建設(shè)合作伙伴!
選擇"新建"->"項目"->"其他項目"->"Visual Studio.Net外接程序"創(chuàng)建一個C#的外接項目。默認地,會生成一個Connet.cs文件,該文件就是當(dāng)你的Visual Studio 啟動時加載的東西:好了,那么具體應(yīng)該怎么寫代碼呢,看幾個代碼片斷吧:
- object []contextGUIDS = new object[] { };
- // 獲得Visual Studio的Commands
- Commands commands = applicationObject.Commands;
- // 獲得Visual Studio的菜單
- _CommandBars commandBars = applicationObject.CommandBars;
- try
- {
- // 獲得Visual Studio的"工具"菜單
- CommandBar toolsBar = (CommandBar)commandBars["Tools"];
- foreach(CommandBarControl control in toolsBar.Controls)
- {
- // 如果VSX菜單已經(jīng)存在就直接返回
- if(control.Caption == "VSX")
- {
- return;
- }
- }
- // 添加VSX菜單到工具欄下面
- CommandBar vsxBar = (CommandBar)commands.AddCommandBar("VSX",vsCommandBarType.vsCommandBarTypeMenu,toolsBar,1);
- // 添加OutLook到VSX菜單下面
- Command command = commands.AddNamedCommand(addInInstance,"OutLook","打開OutLook","在VS中嵌入OutLook",true,50,ref contextGUIDS,(int)vsCommandStatus.vsCommandStatusSupported+(int)vsCommandStatus.vsCommandStatusEnabled);
- command.AddControl(vsxBar,1);
- }
- catch(Exception ex)
- {
- System.Windows.Forms.MessageBox.Show(ex.ToString());
- }
看看VS 2003插件注釋就知道干了些什么。首先獲取"工具"菜單,然后在"工具"上面加了個"VSX", ***在VSX上面加了個"OutLook". F5Debug一下,會彈出Visual Studio 2003,VS 2003插件看到工具下面的VSX沒有?不過還沒有任何功能。這里要注意的是:command.AddControl(vsxBar,1);就將command命令和vsxBar綁定在一起了。
標(biāo)題名稱:對VS2003插件進行深度研究
URL標(biāo)題:http://www.dlmjj.cn/article/dhejdei.html


咨詢
建站咨詢
