samedi 30 janvier 2010

Multi Selection TreeView in WPF, the easy way...

I was losing my precious coding time to implement a feature microsoft could do themselves... It's their fault if Genuilder is late ! :p

By the way here is how to use it.
In this example I define an implicit syle for TreeViewItem which set the border in gray when it is selected.




<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="BorderThickness" Value="1"></Setter>
<Style.Triggers>
<Trigger Property="c:TreeViewExtensions.IsSelected" Value="True" >
<Setter Property="BorderBrush" Value="Gray"></Setter>
</Trigger>
</Style.Triggers>
</Style>

...

<TreeView c:TreeViewExtensions.EnableMultiSelect="true"
c:TreeViewExtensions.SelectedItems="{Binding SelectedItems}"
ItemsSource="{Binding Items}"
... />




Here is the TreeViewExtension :


And the sample app :

lundi 11 janvier 2010

Genuilder.Extensibility Features

Well there is a long time since my last post... I was coding on Genuilder.Extensibility and restarted the design from scratch 6 times !
Well I can now a least tell you the features :

-Generate your own code just before the compilation, using the parser you want (default will be the parser of SharpDevelop).

-You can link the generated code to a file. If the file is modified, the code is re-generated, if the file is deleted, generated code is also deleted. Automatically, the code will not be generated if it is already up to date.

-You will be able to modify code files or throw build time errors.

Using all these features will be as easy as creating a class library project, referencing Genuilder.Extensibility assembly, and implementing the IPlugin interface. This assembly is called "Plugins assembly", and can contain more than one plugin.

After enabling Genuilder.Extensibility on your target project, you just have to reference the plugins assembly and compile... That's all.

No install, no hack in your visual studio, no vs addin, no nothing, it just works.

samedi 14 novembre 2009

Genuilder.Extensibility for easy Meta-development.

Well, I'm happy with the success that Genuilder had. It seems that the concept is appealing to lots developers.

However, the first version was just a test and even if the features are not so bad, there is too much use case I can think about.

The next feature of Genuilder will be called Genuilder.Extensibility, and the goal to create a framework that developers will use to modify code files or create new one easily during the build process, without using MSBuild.

As always, the developer will need to activate Genuilder on his projects.
After that, if he wants to create a plugin, the only thing to do will be to create a plain old class library, and create his plugins inside.
Then, he just references it in targets project...

Plugins will have access to all the source code of the target project.
Genuilder.Extensibility will be heavily coupled with NRefactory, since my goal is not to create another code parser, and I don't want developers to parse themselves the source code.
Also, I'm evaluating MEF, maybe plugins will be exported with the MEF framework. I currently don't know if I will use it because it depends if it makes plugin developers'life easier.

Keep in touch,

samedi 7 novembre 2009

Genuilder Out !!!



Genuilder Out, I'm very proud of this project, it will enhance your build process and visual studio so easily that you will wonder why nobody thought about it earlier...
By the way, it's on CodeProject, and it's home is on CodePlex.

dimanche 25 octobre 2009

Meta-development

Most developers seems to agree : Laziness is a talent.
The interesting part with this talent is that, when we have boring things to do, we can create a tool which does the boring work for us... And that's interesting! It's what make a boring development funny.

And yet, it seems that there is potential to exploit here in all of us. Not so many developers creates tools for themselves, I'll call this activity Meta-Development, because it's development about development.

In the The mythical man month, Fred Brooks exposes an idea of team organisation it's called "The Surgical Team", without entering in details the "Surgical Team" splits differents role for each member. One of the role I want to talk about is the "Toolsmith", as you might expect, it's the developer who creates tools for other developers, what I call Meta-developer.

Are you a meta-developer ? An easy way to find out, is to ask yourself this question : "Do I eat my own dog food ?". If you don't, most probably you can improve yourself by creating tools for your specific needs (and not the needs of your client).

Too many times, developers seem to be in a hurry : "I don't have time to do that", when I hear that it translates to "I've never done it, so it will take me too much time". And guess what ? It's the same lame pretext that inexperienced programers say to justify their ignorance. If you can't hack a tool for yourself, how are you able to create one for your customers?

There is never time to do well, but always time to restart from scratch.

Indeed, it takes time to create tools for ourselves, but the more we'll do that, the less time it will take.

Well, it seems that a lots of articles on CodeProject are about meta-development (cool tips and tricks for developers only)... but I wonder, how many of article's author eat their own dog food ? Personally, I haven't yet and it's a shame!

My next article Genuilder, (Mix of 'Generator' and 'Builder'), will probably be the first project I'll make on CodeProject that I will use on a daily basis (along with my personnal framework I create with tips and tricks taken all over the net).

If I'm able to eat my own dog food, there is a good probability that others will like it too !

samedi 17 octobre 2009

AppConfigVerifier on Codeproject and Codeplex !

Image Copyright All Rights Reserved by Flickr member dr_odio.


AppConfigVerifier is out ! How to use an MSBuild custom task to provide compile time verification of string type names in app.config files.
It's on CodeProject and CodePlex. This project was an idea from Daniel and me just before Left 4 Dead time. Thank you ! :)

It seems some people will like it, but most will be too lazy to import the config verifier in their project file.

So, I am creating a new project called Power Builder, it will be a target file to include inside a project file to have at the same time the AppConfigVerifier, the AppSettingsGenerator, the metadata Generator, and a AppConfig class generator to get sections of the AppConfig in a strongly typed way. I hope people will like it ! :)

lundi 5 octobre 2009

Code generation and MSBuild


Well I'm having a had time to code a good metric tree algorithm, so I thought that writing an article on MSBuild will clear my mind on that!
Strongly typed AppSettings on Codeproject! :)