Archive

Posts Tagged ‘Code Generation’

Intoducing Micorosoft’s Roslyn compiler as a service

I had a great time Tuesday night speaking at the Charlotte Enterprise Developers Guild.  Thanks to all who came out to the presentation!

Here are the slides and sample code:

Slides and Sample code

Hope you enjoy…

 

Advertisements

Intoducing Micorosoft’s Roslyn compiler as a service

I will be speaking for the Charlotte Enterprise Developers Guild on Tuesday, July 24.

Here is my presentation summary:

Taking a look at Microsoft’s Roslyn compiler as a service. If you ever wanted to build your eval engine in .NET, now is the time. We will take a look at building your own Read-Evaluate-Print-Loop (REPL) engine. We will also see how can we use Roslyn to support buidling your templating engine.

Looking forward to seeing you there!

Introducing Microsoft’s Roslyn compiler as a service

April 12, 2012 Leave a comment

I had a great time speaking to the Charlotte ALT.NET user group.

Here are the slides and sample code from my presentation:

Slides and Code Samples

Thanks to all who came out and showed up!

Introducing Microsoft’s Roslyn compiler as a service

I will be speaking for the Charlotte ALT.NET group on Tuesday, April 10.

Here is my presentation summary:

Taking a look at Microsoft’s Roslyn compiler as a service. If you ever wanted to build your eval engine in .NET, now is the time. We will take a look at building your own Read-Evaluate-Print-Loop (REPL) engine. We will also see how can we use Roslyn to support buidling your templating engine.

Looking forward to it!

Code Generation and Silverlight

October 11, 2010 1 comment

I will be speaking this Wednesday, October 13, at the Columbia Developers Guild on Code Generation and how to use it in Silverlight. We will take a look at several ways to achieve this and then look at creating a solution that will allow you to host your own templates and swap them out without ever needing to recompile your Silverlight application. This solutions will work for any environment but Silverlight is the most flexible.

Xaml Code Generation and XamlReader

April 28, 2010 Leave a comment

When you are performing code generation and you would like to dynamically create some UI stuff it into a ContentPresenter, the XamlReader class comes to the rescue.  However, if you have any events that you would like to handle in your newly composed Xaml, the XamlReader class will throw an exception stating that no event handlers can be present.  I use code generation quite extensively in my applications when I have scenarios that I need user driven interfaces.  Thus, it is important to be able to have the flexibility to create Xaml on the fly and still have all the power of interacting with any event that the new UI contains as needed.

Here is a sample of Xaml taht will throw an exception when loaded by the XamlReader class:

One of the nice features that we have had since Silverlight 3 is the ability to define behaviors and triggers using a set pattern.  The good thing about this is that these behaviors and triggers are not evaluated until the given control is loaded in the VisualTree.  This is good because now we have a solution that will allow us to use the XamlReader class that has event handlers and the class does not throw an exception.

Here is a snippet of some Xaml that is created on the fly:

So the next time you are wanting to do some dynamic UI generation but also want to process events, you now have the tools to let you do so.  As an added bonus, the triggers will fire on whatever DataContext the UI is a part of.  This is nice because it supports a clean separation of concerns and follows the common Model-View-ViewModel (MVVM) pattern.