X01.TestViewContent: plug-in test and browser plug-in Test

Source: Internet
Author: User
Tags sharpdevelop

X01.TestViewContent: plug-in test and browser plug-in Test

Developing the SharpDevelop plug-in system is essential for learning.

1. First download the source code on github to ensure that the compilation and running are correct.

2. add the SharpDevelop plug-in project x01.TestViewContent under AddIns/Misc, and then add ICSharpCode. core and ICSharpCode. sharpDevelop reference, set the Local Copy of the two references to false; select the compilation output as ".. \.. \.. \.. \ AddIns \ Misc \ TestViewContent \ ", refer to other plug-ins. Set the Local copy attribute of TestViewContent. addin to Always.

3. Add TestViewContent. cs as follows:

1/*** 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 {18 get {19 return control; 20} 21} 22 23 pub Lic 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. Add the class TestCommand. cs. The content is as follows:

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. The content after TestViewContent. addin is modified is as follows:

 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>

The key part is 15-18 rows.

6. compile and generate the plug-in project. OK! At this time, you will be surprised to find that the plug-in is available without re-compiling the entire Solution and directly entering the bin directory to run SharpDevelop.exe. As follows:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.