Click here to Skip to main content
15,884,388 members
Articles / Programming Languages / XML

REPOST: Create your own IDE in 10 minutes

Rate me:
Please Sign up or sign in to vote.
1.00/5 (1 vote)
6 Sep 2010CPOL2 min read 27.3K   6   1
The purpose of this post is to introduce you to two control libraries that might just do that!

THIS IS A REPOST – This article was written 8 Oct 2009 but was not migrated to my new server… I had a couple of people asking me for this article and decided to repost it! Sorry if you have already read it.

Ok, so I might be stretching reality just a “little” but the purpose of this post is to introduce you to two control libraries that might just do that!

AvalonEdit

AvalonEdit is the new WPF-based editor used in SharpDevelop 4.x. Using the AvalonEdit control is very similar to using a normal TextBox!

XML
<avalonEdit:TextEditor
    ShowLineNumbers="True"  
    Name="textEditor1"
    FontFamily="Consolas"
    FontSize="10pt"/>

To load a document…

C#
textEditor1.Load("Window1.xaml.cs");

And finally, to turn on syntax highlighting?

C#
textEditor1.SyntaxHighlighting = HighlightingManager.Instance.GetDefinition("C#");

Out-of-the box AvalonEdit supports ASP.NET, Boo, Coco/R grammars, C++, C#, HTML, Java, JavaScript, Patch files, PHP, TeX, VB, XML.

If you want to learn more about AvalonEdit, you MUST read Daniel Grunwald’s awesome CodeProject article about AvalonEdit available here (also read the Document and Rendering that was removed from the original article).

AvalonDock

AvalonDock is a WPF controls library which can be used to create a docking layout system like that is present in Visual Studio. It supports fly-out panes, floating windows, multiple docking manager in same window, styles and themes and it can host WinForms controls.

XML
<avalonDock:DockingManager>
    <avalonDock:ResizingPanel>
        <avalonDock:ResizingPanel Orientation="Vertical">
            <!-- Documents (Window1.xaml.cs & App.xaml.cs) -->
            <avalonDock:DocumentPane>
                <avalonDock:DocumentContent Title="App.xaml.cs">
                    <avalonEdit:TextEditor
                        ShowLineNumbers="True"  
                        Name="textEditor2"
                        FontFamily="Consolas"
                        FontSize="10pt"/>
                </avalonDock:DocumentContent>
                <avalonDock:DocumentContent Title="Window1.xaml.cs">
                    <avalonEdit:TextEditor
                        ShowLineNumbers="True"  
                        Name="textEditor1"
                        FontFamily="Consolas"
                        FontSize="10pt"/>
                </avalonDock:DocumentContent>
            </avalonDock:DocumentPane>
            
            <!-- Error List -->
            <avalonDock:DockablePane>
                <avalonDock:DockableContent Title="Error List">
                    <TextBox />
                </avalonDock:DockableContent>
            </avalonDock:DockablePane>
        </avalonDock:ResizingPanel>
        
        <!-- Solution Explorer & Properties -->
        <avalonDock:DockablePane>
            <avalonDock:DockableContent Title="Solution Explorer">
                <TextBox />
            </avalonDock:DockableContent>
            <avalonDock:DockableContent Title="Properties">
                <TextBox />
            </avalonDock:DockableContent>
            
        </avalonDock:DockablePane>        
        
    </avalonDock:ResizingPanel>
</avalonDock:DockingManager>

DockingManager

“DockingManager is responsible to arrange its children (called 'contents') and to perform docking functionalities.”

ResizingPanel

“A ResizingPanel is a panel-derived class which arranges its children along a direction (called Orientation as happen in the StackPanel class). Between two consecutive children, the ResizingPanel automatically inserts a ResizingPanelSplitter. User drags splitters to resize elements of a ResizingPanel (in the same manner of Grid panel).”

DockableContent & DocumentContent

“In AvalonDock, 'contents' are objects of type DockableContent or DocumentContent both deriving from ManagedContent. As names suggest, a DockableContent is a content which users can redock to a border of the parent DockingManager, can hide or can leave floating over the main window.”

DockablePane & DocumentPane

“A DockablePane can contain only DockableContents and can be dragged and redocked to a border of parent DockingManager. In addition, a DockablePane can be autohidden ('unpinned') or floated, that is hosted in a floating window. A DocumentPane can contain both DocumentContents and DockableContents and can't be moved.”

Taken from the EXCELLENT AvalonDock Tutorial.

Ok, so this isn't an IDE yet but they are some of the controls being used in developing #develop 4.x! Download #develop and check it out!!!

Also Read

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
South Africa South Africa
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 1 Pin
Toan Pham Anh22-Feb-14 1:06
Toan Pham Anh22-Feb-14 1:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.