国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計 > 正文

x01.TestViewContent:插件測試

2019-11-14 13:48:01
字體:
供稿:網(wǎng)友

開發(fā)神器 SharpDevelop 的插件系統(tǒng),很有學(xué)習(xí)的必要。

1.首先在 github 上下載源代碼,確保編譯運行無誤。

2.在 AddIns/Misc 下添加 SharpDevelop 插件項目 x01.TestViewContent,然后添加 ICSharpCode.Core 和 ICSharpCode.SharpDevelop 引用,設(shè)置這兩個引用的 Local Copy 為 false;在項目屬性上選編譯輸出為  “../../../../AddIns/AddIns/Misc/TestViewContent/”,可參考其他插件。設(shè)置 TestViewContent.addin 的文件屬性 Local copy 為 Always。

3.添加類 TestViewContent.cs, 內(nèi)容如下:

 1 /** 2  * TestViewContent.cs (c) 2015 by x01 3  */ 4 using System; 5 using System.Windows.Forms; 6 using ICSharpCode.SharpDevelop.Gui; 7  8 namespace x01.TestViewContent 9 {10     /// <summary>11     /// Description of TestViewContent.12     /// </summary>13     public class TestViewContent : AbstractViewContent14     {15         Control control;        16         17         public override Control Control {18             get {19                 return control;20             }21         }22         23         public TestViewContent() : base("Test")24         {25             Panel panel = new Panel();26             panel.Dock = DockStyle.Fill;27             28             TextBox textbox = new TextBox();29             textbox.Text = "Hello world!";30             textbox.Dock = DockStyle.Fill;31             textbox.Multiline = true;32             textbox.Height = 500;33             34             panel.Controls.Add(textbox);35             36             this.control = panel;37         }38     }39 }
TestViewContent

4.添加類 TestCommand.cs,內(nèi)容如下:

 1 /** 2  * TestCommand.cs (c) 2015 by x01 3  */ 4 using System; 5 using ICSharpCode.SharpDevelop; 6 using ICSharpCode.SharpDevelop.Gui; 7  8 namespace x01.TestViewContent 9 {10     /// <summary>11     /// Description of TestCommand.12     /// </summary>13     public class TestCommand : AbstractMenuCommand14     {15         public override void Run()16         {17             WorkbenchSingleton.Workbench.ShowView(new TestViewContent());18         }19     }20 }
TestCommand

5.修改 TestViewContent.addin 后的內(nèi)容如下:

 1 <AddIn name        = "x01.TestViewContent" 2        author      = "Administrator" 3        url         = "" 4        description = "TODO: Put description here"> 5      6     <Runtime> 7         <Import assembly = "x01.TestViewContent.dll"/> 8     </Runtime> 9     10     <!-- Extend the SharpDevelop AddIn-Tree like this:11     <Path name = ...>12         <.../>13     </Path>14     -->15     <Path name="/Workspace/Autostart">16         <Class id="TestCommand"17                class="x01.TestViewContent.TestCommand" />18     </Path>19 </AddIn>

關(guān)鍵部分是 15-18行。

6.編譯生成該插件項目。OK!這時,你會驚奇的發(fā)現(xiàn),不需重新編譯整個 Solution,直接進入 bin 目錄運行 SharpDevelop.exe 時,該插件已然可用。效果圖如下:


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 莲花县| 屏东市| 抚顺县| 兴业县| 鲜城| 陕西省| 桐梓县| 白山市| 米易县| 辰溪县| 鄢陵县| 澄江县| 雷山县| 沙雅县| 巢湖市| 江源县| 融水| 西城区| 邯郸市| 洱源县| 固镇县| 永仁县| 定陶县| 肥乡县| 浦城县| 略阳县| 济阳县| 南充市| 同仁县| 会东县| 康定县| 西和县| 江口县| 舞钢市| 高青县| 疏勒县| 晋宁县| 正安县| 阜城县| 白山市| 灵璧县|