Code Snippet Studio and Essential Studio for WPF | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (173).NET Core  (29).NET MAUI  (203)Angular  (107)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (40)Black Friday Deal  (1)Blazor  (211)BoldSign  (13)DocIO  (24)Essential JS 2  (106)Essential Studio  (200)File Formats  (65)Flutter  (132)JavaScript  (219)Microsoft  (118)PDF  (81)Python  (1)React  (98)Streamlit  (1)Succinctly series  (131)Syncfusion  (897)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (50)Windows Forms  (61)WinUI  (68)WPF  (157)Xamarin  (161)XlsIO  (35)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (146)Chart  (127)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (63)Development  (618)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (39)Extensions  (22)File Manager  (6)Gantt  (18)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (501)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (42)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (52)Security  (3)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (10)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (381)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (17)Web  (582)What's new  (323)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)

Code Snippet Studio and Essential Studio for WPF

Alessandro Del Sole, Microsoft MVP and an author for multiple titles in Syncfusion’s Succinctly e-book series, demonstrates his open-source Code Snippet Studio project in this video. Code Snippet Studio was built using tools from Essential Studio for WPF on our free Community License, which is available to individual developers and small businesses meeting certain criteria.

Why not contribute to Code Snippet Studio yourself? The project is hosted on GitHub and you can find Alessandro on Twitter: @progalex.

The full transcript for this video is below.

Whitney Hill: Thank you for taking the time to sit with me today. Would you like to introduce yourself, and tell us your name, your industry, technologies you like to use, and what inspires you in your work?

Alessandro Del Sole: Yes, of course, and thanks for inviting me first of all. My name is Alessandro Del Sole and I am a senior .NET developer and trainer, and consultant. I work for a company based in Italy called Brain-Sys, and I have been a Microsoft Most Valuable Professional since 2008. I used to be a Visual Basic MVP, then the MVP program has been reorganized and now I am under the Visual Studio & Development Technologies category.
I have been voted MVP of the year five times; I am also a Microsoft Certified Professional and Microsoft Specialist for C#, and I am an author for Syncfusion’s Succinctly series. I wrote four e-books so far, but I’m working on a new e-book that will be coming up in a few months. I also like writing technical articles; I wrote a number of articles for important websites such as MSDN Magazine, InformIT, Visual Basic Developer Center and so on. I also like to produce instructional videos, and Windows Store Applications – and you can find me on Twitter @progalex.
WH: That’s great! And you know, we love having you on to write our e-books for us, we get a lot of great feedback on that series, so thanks for being a part of that.
ADS: Thank you, thank you.
WH: So can you tell us: how long have you been using Syncfusion products, and what was the initial attraction?
ADS: Yes, I have been using Syncfusion’s products since a couple of years, and the initial attraction was due to the fact that the company was offering controls for WPF that were very interesting to me and that I did not find in other companies. So that was the reason why I decided to adopt Syncfusion’s controls. More specifically, I needed controls for Windows Presentation Foundation and I found a good offer from Syncfusion.
WH: Well that’s great, we’re so happy that you chose us. Which product or which tool did you use?
ADS: Yes, I brought some applications that work with WPF and Essential Studio, but probably something that can be more interesting for the developer community is a free and open source tool that I called Code Snippet Studio that I would like to introduce today. It is a free and open source project that allows developers to easily create, edit, and package, and share code snippets for Visual Studio, and Visual Studio code. I made intensive usage of some of the controls for WPF offered by Syncfusion Essential Studio.
WH: That sounds great, I mean would you be able to show us your project in action?
ADS: Yes. Yes, so we have a couple versions of this tool. One is an extension for Visual Studio and one is a stand-alone application. So one important consideration at this point is that if developers want to use Essential Studio for WPF they can do it both for stand-alone WPF applications and in Visual Studio extensions which are based on WPF, basically.
So, a great opportunity that Visual Studio has been offering since many years, since 2005, is the ability of using the so-called IntelliSense code snippets. Let me show how this works. Let’s create just a very simple, very simple project.
Okay. So, one of the things developers do the most is, trying to reuse their existing code. So they take their code snippets and save them somewhere. Because of this, Microsoft introduced an important option into Visual Studio, which is the availability of the code snippets. I can right-click, select “Insert Snippet”, and then I can select from one of the available code snippets library, and I can create my own. So for instance, I can scroll a list and select a ready-to-use code snippet. Then I can also replace the highlighted text with a different type name or a different identifier and so on. So the biggest benefit of this is that you can create your own code snippets that can be plugged into the code editor.
The problem is, you should create your code snippets manually, and this is based on XML complex and XML syntax. There is a number of tools that other developers created during the years to make this simpler, but one of the things I saw that these tools were lacking is the fact that they are not updated for Visual Studio 2015 or 2013, and they do not offer the opportunity of packaging code snippets into an installer. Visual Studio 2012 and ’13 and ’15 rely on the VSIX format extension, file format extension for installing code snippets, so I have created this tool that makes it simple to create, edit, package, and share code snippets.
So, for example, I can write some code inside the code editor and you can see, I have a very basic IntelliSense but this is very useful to make it simpler to write a code snippet. And, I can go on, or I can even open an existing snippet for convenience, like this. So, this code editor is based on the syntax control, syntax editor control, from Syncfusion. This is very helpful, because it provides syntax colorization for a number of programming languages, and is extensible. If you need to use this control with a programming language that is not included out of the box, then you can create your own syntax rules. This tool supports some languages such as Visual Basic, C#, SQL syntax, XML, XAML, C++, HTML, and JavaScript. This is all already included in the Syntax Editor control.
Another important control that I have used from Essential Studio here is the property grid. A code snippet essentially is made of – requires at least – specifying a number of properties such as the author, a description, keywords, the kind of code snippets you are providing, a shortcut that you can use to insert the code snippet quickly. So this control was perfect for my, for my situation. Instead of providing, you know, a text box here, another text box, another text box, this control can be data-bound to the .NET class, the C# class, that represents a code snippet, so it really makes it easy to store properties for a code snippet in this case.
And other controls that I have been using in this project – for example are DataGrids which provide me with advanced features for filtering, sorting and displaying data. So, in this particular case I have an error list here, this tool is based on the Roslyn compiler. Roslyn is the new compiler from Microsoft which provides open-source compilers with rich code analysis APIs for Visual Basic and C# and you can detect issues, code issues, as you type. So as immediately – when I type, the code editor is able to immediately detect any problems because of Roslyn behind the scenes and all the errors are easily displayed in this DataGrid that you can also filter and sort, and so on.
I have used the Docking controls, which provides me a very easy way to organize the user interface. So for instance, I have these two windows that I can easily auto-hide, like this, so to have a larger area for writing my code, and then I can simply turn them back. This is something that developers using Visual Studio are very familiar with. This is very, very useful because it allows to organize the user interface according to your preferences. And also, you can take a dialogue and move it to a different position. Okay.
Then, what I also did was implementing themes. You might not like the default colors I provided for this tool, so you can even set a different theme among a list of built-in themes for WPF. So for example I can use the Blend theme to completely change the layout, or the Visual Studio 2013, or an Office-like theme, and so on. Metro is the one I like most. Another important –
WH: That’s a really nice-looking tool.
ADS: Yes, oh, thank you, thank you. I hope – I think people are finding this tool very useful, at least from the feedback I got so far, so, very nice. And, another important consideration I want to make about the code editor is that with Visual Basic, you can – of course, this is C# code so you are seeing some errors at the bottom but, in the case you select Visual Basic, code snippets provide an option to specify references to external libraries that you need to compile the code snippet once you add the snippet into Visual Studio. But, for Visual Basic and C#, you can also add a reference to an external assembly and the Syntax Editor control will be able to add a real reference to that library and will improve the IntelliSense as you type, automatically taking the names of the types defined in that external library. So, another interesting feature in the Syntax Editor control, which I really love.
WH: Okay, so can you tell us a bit about the long-term benefits or results that you saw using Essential Studio to build your project?
ADS: Yes. First of all, I saved a lot of time. I think that if I had to build my own Syntax Editor control, I would probably – it would probably take me many months. There are some free, open-source controls for syntax editing but they are not the same. Here you have full word completion support, a number of languages that are supported out of the box, you also have a context menu that is precise for editing such as increasing indentation, decreasing, or line commenting. This is the first benefit I got from using this kind of control in this project.
And about the other controls I used, they also provided a very convenient way to store the information, to store and present the information related to creating a code snippet. So, I think that, you know, when you create an open-source project, it’s something that you do in your spare free time and the time is very limited, so if you can use some very powerful controls like Essential Studio, you get a better product, a better – a better project, with limited effort. So I think, I think I can strongly recommend Essential Studio for WPF.
WH: Well thank you, I mean, that’s great to see your project and you know, of course we love that you chose Syncfusion for it.
ADS: Thank you.
WH: Is there anything else you’d like to tell us about, or any kind of quick fact, or something you’re working on currently?
ADS: Currently I’m working on a new e-book for the Succinctly series called WPF Debugging and Performance Succinctly, so for WPF developers who are looking, who are having a look to Essential Studio for WPF, that book might be useful. And, I’m currently planning to start a new project based on Xamarin.Forms, for a cross-platform mobile app, and I will certainly use Essential Studio for Xamarin, too.
WH: Oh, that’s great to hear. Well, I’m sure everyone will be looking out for your Succinctly e-book, those are – you know as I said, those are very popular and you are one of our top authors so thank you for taking the time to join us today, we really appreciated it, and have a good day!
ADS: Thank you, thank you for taking your time for inviting me, and for the opportunity. Thank you.
WH: Thank you.

Tags:

Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed