<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3167981498274502078</id><updated>2012-02-08T17:20:11.330-08:00</updated><category term='GenWise'/><category term='Templates'/><title type='text'>On Code Generation and More</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://epepping.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://epepping.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Erik Pepping</name><uri>http://www.blogger.com/profile/02642067160584847697</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://4.bp.blogspot.com/_gS-vFZ1_PPc/TQOH_ta8hRI/AAAAAAAABF4/cQ50rXMJEWM/S220/ErikMugshot.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3167981498274502078.post-2363822203365406034</id><published>2009-12-13T10:05:00.000-08:00</published><updated>2009-12-13T10:21:21.511-08:00</updated><title type='text'>Inversion of Control</title><content type='html'>With the latest Genwise Software factory project we are using a pattern that is called Inversion of Control, or also known as Dependency Injection (what's in a name). Getting our heads around this pattern took a while and it was hard to find a simple sample that just demonstrates the simplest implementation of this technique. (more complex implementations using service locators can be found elsewhere). In this simplest sample a movie database printer prints movies from different movie sources. One is supposed to be memory and the other a text file.&lt;br /&gt;&lt;br /&gt;You can download the sample &lt;a href="http://www.radsmart.com/portal/iocsample.zip"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3167981498274502078-2363822203365406034?l=epepping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://epepping.blogspot.com/feeds/2363822203365406034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3167981498274502078&amp;postID=2363822203365406034' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/2363822203365406034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/2363822203365406034'/><link rel='alternate' type='text/html' href='http://epepping.blogspot.com/2009/12/inversion-of-control.html' title='Inversion of Control'/><author><name>Erik Pepping</name><uri>http://www.blogger.com/profile/02642067160584847697</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://4.bp.blogspot.com/_gS-vFZ1_PPc/TQOH_ta8hRI/AAAAAAAABF4/cQ50rXMJEWM/S220/ErikMugshot.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3167981498274502078.post-5880510953471927688</id><published>2009-11-20T11:04:00.000-08:00</published><updated>2009-11-21T23:01:09.835-08:00</updated><title type='text'>GSF beta 1 approaching</title><content type='html'>After our DSL research and string templating adventures we are now at the point to almost release a public beta for the GSF. (GenWise Software Factory) We have decided to create DSL's for the Data modeling and Business Object modeling. We have created templates for the Domain (Traditional Business Objects) , the DAO (Data access object layer) and some example code how to use it all in a WPF application. Below is an example Database scheam imported with one of our import utilities.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://gsf.genwise.com/Portals/0/GSF%20-%20DbSchema.png"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 393px; height: 268px;" src="http://gsf.genwise.com/Portals/0/GSF%20-%20DbSchema.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Basically what you get when you use GSF are the following modules:&lt;br /&gt;- VS 2005 integration&lt;br /&gt;- Database modeling with import schema from SQl-server or Oracle &lt;br /&gt;- Business object class diagram created from the Datamodel but extendable with OO features&lt;br /&gt;- DOA and Domain generation with partial classes and partial methods&lt;br /&gt;- MVVM framework (Model view - View model pattern)&lt;br /&gt;- Made for WPF binding but not limited to WPF.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3167981498274502078-5880510953471927688?l=epepping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://epepping.blogspot.com/feeds/5880510953471927688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3167981498274502078&amp;postID=5880510953471927688' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/5880510953471927688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/5880510953471927688'/><link rel='alternate' type='text/html' href='http://epepping.blogspot.com/2009/11/gsf-beta-1-approaching.html' title='GSF beta 1 approaching'/><author><name>Erik Pepping</name><uri>http://www.blogger.com/profile/02642067160584847697</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://4.bp.blogspot.com/_gS-vFZ1_PPc/TQOH_ta8hRI/AAAAAAAABF4/cQ50rXMJEWM/S220/ErikMugshot.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3167981498274502078.post-5070747552547702489</id><published>2008-11-29T10:43:00.001-08:00</published><updated>2008-11-29T10:48:27.473-08:00</updated><title type='text'>Microsoft DSL Tools</title><content type='html'>At GenWise we are currently investigating using the Microsoft DSL tools for code generation. I must say I am really impressed by what Microsoft has done with this tool. Not only make it possible to model your ideas, but also to instantiate that model and make incarnations for the real world. It is highly customizable and expandable. Together with string templating you can make very useful code generation environments. It takes a specific way to look at your implementation though if you want to preserve your own additions to he generated code. You will have to implement lots of base classes and code for partial class use from the beginning. &lt;br /&gt;In general the extensibility is not so well documented, and there seems to be only a few specialists around. I do not know if we will come to a marketable product at this point in time, but I'm sure if you keep an eye on Genwise.com that sooner or later you will be able to find more about our DSL adventures.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3167981498274502078-5070747552547702489?l=epepping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://epepping.blogspot.com/feeds/5070747552547702489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3167981498274502078&amp;postID=5070747552547702489' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/5070747552547702489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/5070747552547702489'/><link rel='alternate' type='text/html' href='http://epepping.blogspot.com/2008/11/microsoft-dsl-tools.html' title='Microsoft DSL Tools'/><author><name>Erik Pepping</name><uri>http://www.blogger.com/profile/02642067160584847697</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://4.bp.blogspot.com/_gS-vFZ1_PPc/TQOH_ta8hRI/AAAAAAAABF4/cQ50rXMJEWM/S220/ErikMugshot.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3167981498274502078.post-3032379684296616916</id><published>2008-02-19T12:23:00.000-08:00</published><updated>2008-02-19T12:31:22.661-08:00</updated><title type='text'>Dicom the easy way</title><content type='html'>I have been searcing for a while for an open source DICOM library. The thing I hate the most about open source is that many things are started by one man shops, and after a while development stops. A good example of a nice Dicom library is OpenDicom. See www.opendicom.org. Problem is that development is stopped and the documentation is not that great.&lt;br /&gt;&lt;br /&gt;I wanted to report on a great Dicom library I came across today. It is called ClearCanvas See www.clearcanvas.ca&lt;br /&gt;&lt;br /&gt;It is unbelievable how accessible thay made dicom file access and dicom file viewing.&lt;br /&gt;I wanted to modify some dicom file programmatically in VS 2005. You can do this very easily with the Clearcanvas SDK. The SDK is vary well documented and it took me about 30 minutes to get code going to change a patient Id in a dicom image, somthing I was not able to do very easily with other open source dicom libraries. &lt;br /&gt;&lt;br /&gt;The library is also documented very well, with sample code, and the site has a good forum.&lt;br /&gt;&lt;br /&gt;Here is the code:&lt;br /&gt;&lt;br /&gt;&lt;!--&lt;br /&gt;{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red0\green0\blue0;\red43\green145\blue175;\red163\green21\blue21;\red0\green128\blue0;}??\fs20 \cf1 using\cf0  System;\par ??\cf1 using\cf0  System.Collections.Generic;\par ??\cf1 using\cf0  System.ComponentModel;\par ??\cf1 using\cf0  System.Data;\par ??\cf1 using\cf0  System.Drawing;\par ??\cf1 using\cf0  System.Text;\par ??\cf1 using\cf0  System.Windows.Forms;\par ??\cf1 using\cf0  ClearCanvas.Dicom;\par ??\cf1 namespace\cf0  CCDicom\par ??\{\par ??    \cf1 public\cf0  \cf1 partial\cf0  \cf1 class\cf0  \cf4 DicomAttibuteViewer\cf0  : \cf4 Form\par ??\cf0     \{\par ??        \cf1 public\cf0  DicomAttibuteViewer()\par ??        \{\par ??            InitializeComponent();\par ??        \}\par ??\par ??        \cf1 private\cf0  \cf1 void\cf0  btGo_Click(\cf1 object\cf0  sender, \cf4 EventArgs\cf0  e)\par ??        \{\par ??            \cf4 DicomFile\cf0  _df = \cf1 new\cf0  \cf4 DicomFile\cf0 (\cf5 @"C:\\user\\DotNet\\OpenDicom\\DicomSampleFiles\\00000014.dcm"\cf0 );\par ??            _df.Load(\cf4 DicomReadOptions\cf0 .Default);\par ??             \cf4 DicomAttributeCollection\cf0  _ds = _df.DataSet;\par ??            \cf1 foreach\cf0  (\cf4 DicomAttribute\cf0  _da \cf1 in\cf0  _ds)\par ??            \{\par ??                \cf1 if\cf0  (_da.Tag.Group == 16 &amp;amp;&amp;amp; _da.Tag.Element == 32)\par ??                \{\par ??                    \cf6 // Patient ID\par ??\cf0                      _da.SetString(0, \cf5 "mypatientid"\cf0 );\par ??                \}\par ??                \cf1 if\cf0  (_da.Tag.Group == 10)\par ??                \{\par ??                \}\par ??                \cf1 this\cf0 .listBox1.Items.Add(_da.Tag +\cf5 "-&amp;gt;"\cf0  + _da.ToString());\par ??            \}\par ??            _df.Save(\cf5 @"c:\\user\\DotNet\\OpenDicom\\DicomSampleFiles\\erik1.dcm"\cf0 );\par ??\par ??        \}\par ??    \}\par ??\}}&lt;br /&gt;--&gt;&lt;br /&gt;&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.ComponentModel;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Data;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Drawing;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Text;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Windows.Forms;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; ClearCanvas.Dicom;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; CCDicom&lt;/p&gt;&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;partial&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;DicomAttibuteViewer&lt;/span&gt; : &lt;span style="color: #2b91af;"&gt;Form&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; DicomAttibuteViewer()&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; InitializeComponent();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; btGo_Click(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af;"&gt;EventArgs&lt;/span&gt; e)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;DicomFile&lt;/span&gt; _df = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;DicomFile&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;@"C:\user\DotNet\OpenDicom\DicomSampleFiles\00000014.dcm"&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; _df.Load(&lt;span style="color: #2b91af;"&gt;DicomReadOptions&lt;/span&gt;.Default);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;  &lt;span style="color: #2b91af;"&gt;DicomAttributeCollection&lt;/span&gt; _ds = _df.DataSet;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color: #2b91af;"&gt;DicomAttribute&lt;/span&gt; _da &lt;span style="color: blue;"&gt;in&lt;/span&gt; _ds)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (_da.Tag.Group == 16 &amp;amp;&amp;amp; _da.Tag.Element == 32)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// Patient ID&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;  _da.SetString(0, &lt;span style="color: #a31515;"&gt;"mypatientid"&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (_da.Tag.Group == 10)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;this&lt;/span&gt;.listBox1.Items.Add(_da.Tag +&lt;span style="color: #a31515;"&gt;"-&amp;gt;"&lt;/span&gt; + _da.ToString());&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; _df.Save(&lt;span style="color: #a31515;"&gt;@"c:\user\DotNet\OpenDicom\DicomSampleFiles\erik1.dcm"&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3167981498274502078-3032379684296616916?l=epepping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://epepping.blogspot.com/feeds/3032379684296616916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3167981498274502078&amp;postID=3032379684296616916' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/3032379684296616916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/3032379684296616916'/><link rel='alternate' type='text/html' href='http://epepping.blogspot.com/2008/02/dicom-easy-way.html' title='Dicom the easy way'/><author><name>Erik Pepping</name><uri>http://www.blogger.com/profile/02642067160584847697</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://4.bp.blogspot.com/_gS-vFZ1_PPc/TQOH_ta8hRI/AAAAAAAABF4/cQ50rXMJEWM/S220/ErikMugshot.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3167981498274502078.post-5296213379827644426</id><published>2008-01-23T00:06:00.001-08:00</published><updated>2009-09-19T07:23:31.276-07:00</updated><title type='text'>Using Log4net in a Winforms Application</title><content type='html'>I was trying to use log4 net in my Winforms application and could not get it to work that easily. Here are the steps i performed to get it to works.&lt;br /&gt;&lt;br /&gt;1. Offcourse first add the log4net dll to your application as a reference.&lt;br /&gt;2. Then initiate logging as following:&lt;br /&gt;&lt;br /&gt;public  ILog log;&lt;br /&gt;public void InitiateLogging()&lt;br /&gt;{&lt;br /&gt;    log4net.Config.XmlConfigurator.Configure();&lt;br /&gt;    this.log = LogManager.GetLogger("user");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;3. Do not forget to make a log4 net section in your application config file. Here is my config file (my application is named IMSBEWFM. The config file is named: ImsBeWfm.EXE.config&lt;br /&gt;&lt;br /&gt;&amp;lt ?xml version="1.0" encoding="utf-8" ?&amp;gt&lt;br /&gt; &amp;lt configuration&amp;gt&lt;br /&gt; &amp;lt configSections&amp;gt&lt;br /&gt;  &amp;lt section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /&amp;gt&lt;br /&gt; &amp;lt /configSections &amp;gt&lt;br /&gt; &amp;lt appSettings file="" &amp;gt&lt;br /&gt;  &amp;lt clear /&amp;gt&lt;br /&gt;  &amp;lt add key="log4net.Internal.Debug" value="true"/&amp;gt&lt;br /&gt;  &amp;lt /appSettings&amp;gt&lt;br /&gt;  &amp;lt log4net&amp;gt&lt;br /&gt;   &amp;lt appender name="GeneralLog" type="log4net.Appender.RollingFileAppender"&amp;gt&lt;br /&gt;   &amp;lt file value="general.txt"/&amp;gt&lt;br /&gt;   &amp;lt appendToFile value="true"/&amp;gt&lt;br /&gt;   &amp;lt maximumFileSize value="100KB"/&amp;gt&lt;br /&gt;   &amp;lt rollingStyle value="Size"/&amp;gt&lt;br /&gt;   &amp;lt layout type="log4net.Layout.PatternLayout"&amp;gt&lt;br /&gt;    &amp;lt conversionPattern value="%d{HH:mm:ss} [%t] %-5p %c - %m%n"/&amp;gt&lt;br /&gt;   &amp;lt /layout&amp;gt&lt;br /&gt;  &amp;lt /appender&amp;gt&lt;br /&gt;  &amp;lt root&amp;gt&lt;br /&gt;   &amp;lt level value="DEBUG"/&amp;gt&lt;br /&gt;   &amp;lt appender-ref ref="GeneralLog"/&amp;gt&lt;br /&gt;  &amp;lt /root&amp;gt&lt;br /&gt;  &amp;lt logger name="NHibernate" additivity="false"&amp;gt&lt;br /&gt;   &amp;lt level value="DEBUG"/&amp;gt&lt;br /&gt;   &amp;lt appender-ref ref="GeneralLog"/&amp;gt&lt;br /&gt;  &amp;lt /logger&amp;gt&lt;br /&gt; &amp;lt /log4net&amp;gt&lt;br /&gt; &amp;lt /configuration&amp;gt&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. Notice the: &lt;br /&gt;  &amp;lt add key="log4net.Internal.Debug" value="true"/ &amp;gt &lt;br /&gt;&lt;br /&gt;That line is very usefull in the debug output window of your application log4net will tell you any errors while initializing, tracking down problems. Later when it works you can remove that line.&lt;br /&gt;&lt;br /&gt;Now to log someting is quite easy:&lt;br /&gt;&lt;br /&gt;log.Debug("Sucessfull login");&lt;br /&gt;&lt;br /&gt;Be carefull if you want to log for a released application, then you will have to change level value = "DEBUG" to level value = "INFO" and use log.info in your code to log to the released application.&lt;br /&gt;&lt;br /&gt;Excelent reference is: &lt;a  href="http://www.ondotnet.com/pub/a/dotnet/2003/06/16/log4net.html"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3167981498274502078-5296213379827644426?l=epepping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://epepping.blogspot.com/feeds/5296213379827644426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3167981498274502078&amp;postID=5296213379827644426' title='47 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/5296213379827644426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/5296213379827644426'/><link rel='alternate' type='text/html' href='http://epepping.blogspot.com/2008/01/using-log4net-in-winforms-application_23.html' title='Using Log4net in a Winforms Application'/><author><name>Erik Pepping</name><uri>http://www.blogger.com/profile/02642067160584847697</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://4.bp.blogspot.com/_gS-vFZ1_PPc/TQOH_ta8hRI/AAAAAAAABF4/cQ50rXMJEWM/S220/ErikMugshot.jpg'/></author><thr:total>47</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3167981498274502078.post-2246215614687925507</id><published>2007-08-19T02:42:00.000-07:00</published><updated>2007-08-19T02:49:30.138-07:00</updated><title type='text'>Starting an external program from C# procedure</title><content type='html'>We are working on Source Control integration for GenWise and needed some code to start an external process, and read the output or errors from the process. After some trials we found this is the best way to do it:&lt;br /&gt;&lt;br /&gt;            System.Diagnostics.Process proc = new System.Diagnostics.Process();&lt;br /&gt;            proc.StartInfo.WorkingDirectory = this.WorkingFolder;&lt;br /&gt;            proc.StartInfo.CreateNoWindow = true;&lt;br /&gt;            proc.StartInfo.UseShellExecute = false;&lt;br /&gt;            proc.StartInfo.RedirectStandardOutput = true;&lt;br /&gt;            proc.StartInfo.RedirectStandardError = true;&lt;br /&gt;            proc.StartInfo.FileName = this.VSSClientProgram;&lt;br /&gt;            proc.StartInfo.Arguments = pArguments;&lt;br /&gt;            proc.Start();&lt;br /&gt;            string output = proc.StandardOutput.ReadToEnd();&lt;br /&gt;            string Error = proc.StandardError.ReadToEnd();&lt;br /&gt;            int ExitCode = proc.ExitCode;&lt;br /&gt;            proc.Close();&lt;br /&gt;&lt;br /&gt;The CreateNoWindow sees to it that you will not see some Window popping up from your own program normally with no contents. The UseShellExecute = false makes it so you can redirect the standard outpout, input and error streams.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3167981498274502078-2246215614687925507?l=epepping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://epepping.blogspot.com/feeds/2246215614687925507/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3167981498274502078&amp;postID=2246215614687925507' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/2246215614687925507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/2246215614687925507'/><link rel='alternate' type='text/html' href='http://epepping.blogspot.com/2007/08/starting-other-program-from-c-procedure.html' title='Starting an external program from C# procedure'/><author><name>Erik Pepping</name><uri>http://www.blogger.com/profile/02642067160584847697</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://4.bp.blogspot.com/_gS-vFZ1_PPc/TQOH_ta8hRI/AAAAAAAABF4/cQ50rXMJEWM/S220/ErikMugshot.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3167981498274502078.post-4538338927845694287</id><published>2007-07-07T02:05:00.000-07:00</published><updated>2007-07-07T02:08:34.364-07:00</updated><title type='text'>GenWise 1.09 Released !</title><content type='html'>We have released version 1.09. It was a long cycle. It has proven difficult to get rid of our threading and events scheduling issues. But we feel very comfortable now that this release is very stable. We now use the latest NHibernate version (1.2GA). In the mean while we have also been developping our own applications and fixed many practical issues in working with GenWise. With this version full ASP.NET applications can be developped in record time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3167981498274502078-4538338927845694287?l=epepping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://epepping.blogspot.com/feeds/4538338927845694287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3167981498274502078&amp;postID=4538338927845694287' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/4538338927845694287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/4538338927845694287'/><link rel='alternate' type='text/html' href='http://epepping.blogspot.com/2007/07/we-have-released-version-1.html' title='GenWise 1.09 Released !'/><author><name>Erik Pepping</name><uri>http://www.blogger.com/profile/02642067160584847697</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://4.bp.blogspot.com/_gS-vFZ1_PPc/TQOH_ta8hRI/AAAAAAAABF4/cQ50rXMJEWM/S220/ErikMugshot.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3167981498274502078.post-1774969377858735810</id><published>2007-06-13T10:28:00.001-07:00</published><updated>2007-06-13T10:32:49.303-07:00</updated><title type='text'>Learning by doing</title><content type='html'>The proof is in the pudding they say. Or if you want eat "your own dogfood". Last week  one of our principle developers (Ward Bekker) started using GenWise on a project for a new customer. It was an interesting experience to see someone who developed several years on GenWise get started with the tool himself. Some of the immediate lessons:&lt;br /&gt;- Hey i've never seen that bug before...&lt;br /&gt;- Wouldn't it be handy if...&lt;br /&gt;- Yee, that part is really slow...&lt;br /&gt;- Can't we...&lt;br /&gt;- Should we not...&lt;br /&gt;&lt;br /&gt;Needless to say our bug and feature tracking system is filling quite nicely!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3167981498274502078-1774969377858735810?l=epepping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://epepping.blogspot.com/feeds/1774969377858735810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3167981498274502078&amp;postID=1774969377858735810' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/1774969377858735810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/1774969377858735810'/><link rel='alternate' type='text/html' href='http://epepping.blogspot.com/2007/06/learning-by-doing.html' title='Learning by doing'/><author><name>Erik Pepping</name><uri>http://www.blogger.com/profile/02642067160584847697</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://4.bp.blogspot.com/_gS-vFZ1_PPc/TQOH_ta8hRI/AAAAAAAABF4/cQ50rXMJEWM/S220/ErikMugshot.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3167981498274502078.post-8544094082267398339</id><published>2007-06-08T10:56:00.001-07:00</published><updated>2007-06-08T11:00:48.612-07:00</updated><title type='text'>What' s up at GenWise ?</title><content type='html'>Next week we are giving a GenWise course for customers in Maarssen. We are quite exited, since they will use our latest internal build named 1.09. If after the course the software is stable enough we will release it probably in the week after. 1.09 contains many bug fixes, more stability and numerous small enhancements. After 1.09 we will aim for 1.1. This release contains all that we had originally planned for 1.1. &lt;br /&gt;Also 1.09 will contains the 1.2 GA release of NHibernate and is tested with that version.&lt;br /&gt;&lt;br /&gt;People attending the course will get a free GenWise version. We hope that this will encourage people to start using GenWise after the course directly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3167981498274502078-8544094082267398339?l=epepping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://epepping.blogspot.com/feeds/8544094082267398339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3167981498274502078&amp;postID=8544094082267398339' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/8544094082267398339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/8544094082267398339'/><link rel='alternate' type='text/html' href='http://epepping.blogspot.com/2007/06/what-s-up-at-genwise.html' title='What&apos; s up at GenWise ?'/><author><name>Erik Pepping</name><uri>http://www.blogger.com/profile/02642067160584847697</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://4.bp.blogspot.com/_gS-vFZ1_PPc/TQOH_ta8hRI/AAAAAAAABF4/cQ50rXMJEWM/S220/ErikMugshot.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3167981498274502078.post-1261570943548663420</id><published>2007-05-30T09:29:00.000-07:00</published><updated>2007-05-30T09:36:13.450-07:00</updated><title type='text'>To schema or not to schema...</title><content type='html'>Today we ran into a very practical problem. Should schema names be included in the NHibernate mapping ? Well it depends a little bit on your back end. In Oracle the username is the schema name. In SQL server you have the Database concept. (Northwind database for example.) For one customer we generated a NHibernate business object layer with table mapping like so:&lt;br /&gt;class name = "Customers" table= "Abel.Customers"&lt;br /&gt;However when moving to production, the Oracle User / Schema name was different. So our code did not work. All we needed to do is take of the Able schema part to make it work with the production connection string. &lt;br /&gt;We have immediately decided to make this a GenWise Option for the Table item template. So now you can generate the mapping with or without schemanames&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3167981498274502078-1261570943548663420?l=epepping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://epepping.blogspot.com/feeds/1261570943548663420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3167981498274502078&amp;postID=1261570943548663420' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/1261570943548663420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/1261570943548663420'/><link rel='alternate' type='text/html' href='http://epepping.blogspot.com/2007/05/to-schema-or-not-to-schema.html' title='To schema or not to schema...'/><author><name>Erik Pepping</name><uri>http://www.blogger.com/profile/02642067160584847697</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://4.bp.blogspot.com/_gS-vFZ1_PPc/TQOH_ta8hRI/AAAAAAAABF4/cQ50rXMJEWM/S220/ErikMugshot.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3167981498274502078.post-67737258885106054</id><published>2007-05-12T02:02:00.000-07:00</published><updated>2007-05-12T02:09:57.769-07:00</updated><title type='text'>NHibernate Configuration from Code</title><content type='html'>Sometimes you do not want the connectstring in your NHibernate.config file. In fact setting it there without encryption seems not the right thing to do. Before you open sessions in NHibernate you can configure NHibernate to take connection settings from code. This way you can for instance let the user log in with his/her database username and or password:&lt;br /&gt;&lt;br /&gt;_configuration = new NHibernate.Cfg.Configuration();&lt;br /&gt;_configuration.SetProperty("hibernate.connection.provider",@"NHibernate.Connection.DriverConnectionProvider");&lt;br /&gt;_configuration.SetProperty("hibernate.dialect",@"NHibernate.Dialect.Oracle9Dialect");&lt;br /&gt;_configuration.SetProperty("hibernate.connection.driver_class",@"NHibernate.Driver.OracleDataClientDriver");&lt;br /&gt;_configuration.SetProperty("hibernate.connection.connection_string",@"persist security info=True;data source=MyServer; user id=MyUserid; password=MyPassword;");&lt;br /&gt;&lt;br /&gt;This example uses Oracle settings. &lt;br /&gt;On the Web you will probably get the username and password somewhere from a session variable.&lt;br /&gt;&lt;br /&gt;string _username = HttpContext.Current.Session["Username"].ToString();&lt;br /&gt;string _password = HttpContext.Current.Session["Password"].ToString();&lt;br /&gt;_Configuration.SetProperty("hibernate.connection.connection_string", @"persist security info=True;data source=RADORA9; user id=" + _username + "; password=" + _password + ";");&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3167981498274502078-67737258885106054?l=epepping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://epepping.blogspot.com/feeds/67737258885106054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3167981498274502078&amp;postID=67737258885106054' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/67737258885106054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/67737258885106054'/><link rel='alternate' type='text/html' href='http://epepping.blogspot.com/2007/05/nhibernate-confirguration-from-code.html' title='NHibernate Configuration from Code'/><author><name>Erik Pepping</name><uri>http://www.blogger.com/profile/02642067160584847697</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://4.bp.blogspot.com/_gS-vFZ1_PPc/TQOH_ta8hRI/AAAAAAAABF4/cQ50rXMJEWM/S220/ErikMugshot.jpg'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3167981498274502078.post-4371571016005800737</id><published>2007-05-11T07:58:00.000-07:00</published><updated>2007-05-11T08:16:29.102-07:00</updated><title type='text'>What is Code Generation</title><content type='html'>The answer seems obvious. Code Generation is Code Generating Code. Basically it is a skeleton filled in by a parser looking for variable parts. Off course in it's simplest form that's what it is.&lt;br /&gt;&lt;br /&gt;But there is much more to it. Straight code generation does not allow you to have an extensible framework to build upon. True code generation should build on a flexible object oriented code generation framework with a hierarchical template set in which you can hook either with custom code or with other templates. Thats' just what we have been building, and it is extremely powerful. Templates can independently from each other generate code not only into each other but in different files. &lt;br /&gt;&lt;br /&gt;Our templates are C# classes that implement certain interfaces. Each template uses a codeblock structure. All templates expose code insertion points. For instance the following code:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;PageTemplate.AtPageLoadEnd.Add("{0}_ActionChanged(\"Browse\");", PrimaryControl.Name);&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;used in a template generates at an ASX page code behind in the AtPageLoad event, in the last code block of the Aspx Page template. These code insertion points can be used in all templates.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3167981498274502078-4371571016005800737?l=epepping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://epepping.blogspot.com/feeds/4371571016005800737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3167981498274502078&amp;postID=4371571016005800737' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/4371571016005800737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/4371571016005800737'/><link rel='alternate' type='text/html' href='http://epepping.blogspot.com/2007/05/what-is-code-generation.html' title='What is Code Generation'/><author><name>Erik Pepping</name><uri>http://www.blogger.com/profile/02642067160584847697</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://4.bp.blogspot.com/_gS-vFZ1_PPc/TQOH_ta8hRI/AAAAAAAABF4/cQ50rXMJEWM/S220/ErikMugshot.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3167981498274502078.post-6832313188438744667</id><published>2007-05-06T10:17:00.000-07:00</published><updated>2007-08-13T03:27:04.075-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Templates'/><category scheme='http://www.blogger.com/atom/ns#' term='GenWise'/><title type='text'>Some new template developments for GenWise.</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_gS-vFZ1_PPc/RsAxyo5TO4I/AAAAAAAAAAM/-SnZRxY34bQ/s1600-h/ErikMugshot.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_gS-vFZ1_PPc/RsAxyo5TO4I/AAAAAAAAAAM/-SnZRxY34bQ/s320/ErikMugshot.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5098129524224375682" /&gt;&lt;/a&gt;&lt;br /&gt;We are working hard on our GenWise tool. See &lt;a href="http://www.genwise.com/"&gt;http://www.GenWise.com&lt;/a&gt;&lt;br /&gt;Lately we have been adding some templates outside of the GenWise environment, just to see how that would work.  GenWise templates are compiled .Net assemblies that can be plugged into the GenWise Code generation environment. The templates just have to implement some standard interfaces to work in the GenWise IDE. Here is a small example of a Code template that lets the programmer select a color code in the source code editor via a nice interface:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-size:85%;" &gt;using System;&lt;br /&gt;using GenWise.Framework.Generic;&lt;br /&gt;using GenWise.Framework.Prj;&lt;br /&gt;using GenWise.Framework.Templates;&lt;br /&gt;&lt;br /&gt;namespace ColorCodeTemplate&lt;br /&gt;{&lt;br /&gt;   /// Adds Color Code Template&lt;br /&gt;   [Serializable]&lt;br /&gt;   [Template("ColorCodeTemplate", "ColorCodeTemplate", "ColorCodeTemplate",&lt;br /&gt;       SymbolObjectType = typeof(ColorCodeTemplateSymbols),&lt;br /&gt;       SingleInstance = false&lt;br /&gt;       )&lt;br /&gt;       ]&lt;br /&gt;   // The template For the ColorcodeSelection.&lt;br /&gt;   // Inherists from CodeTemplate that contains all basic functionality to make the template work.&lt;br /&gt;   public class ColorCodeTemplate : CodeTemplate&lt;br /&gt;   {&lt;br /&gt;       #region --- Constructors ---&lt;br /&gt;       /// Create a ColorCode Template specifying it's inital Parent Template&lt;br /&gt;       ///&lt;br /&gt;       public ColorCodeTemplate(BaseTemplate pParentTemplate)&lt;br /&gt;           : base(pParentTemplate)&lt;br /&gt;       {&lt;br /&gt;       }&lt;br /&gt;       /// Create a Color Code Template specifying it's inital codeblock&lt;br /&gt;       public ColorCodeTemplate(BaseTemplate pParentTemplate, CodeBlock pCodeBlock)&lt;br /&gt;           : base(pParentTemplate, pCodeBlock)&lt;br /&gt;       {&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       #endregion&lt;br /&gt;&lt;br /&gt;       /// Creates the Symbol Object, these are the template prompts. These prompts can be maintained in a&lt;br /&gt;       /// XML file. An automatic interface can be used, or you can specific your own interface.&lt;br /&gt;       protected override ISymbolObject CreateSymbolObject()&lt;br /&gt;       {&lt;br /&gt;           return new ColorCodeTemplateSymbols(Symbols, this);&lt;br /&gt;       }&lt;br /&gt;     &lt;br /&gt;       /// Overide the default designer. I have my own&lt;br /&gt;       public override System.Windows.Forms.UserControl GetDesigner()&lt;br /&gt;       {&lt;br /&gt;           ColorPicker CPick = new ColorPicker(this, Options.SelectedColor.GetValueOrDefault());&lt;br /&gt;           CPick.ShowDialog();&lt;br /&gt;           return null;&lt;br /&gt;       }&lt;br /&gt;       /// Template Options&lt;br /&gt;       public ColorCodeTemplateSymbols Options&lt;br /&gt;       {&lt;br /&gt;           get { return (SymbolsObject as ColorCodeTemplateSymbols); }&lt;br /&gt;       }&lt;br /&gt;       /// Validates that the Symbols are correctly configured. No required, but if there are own validations add them here.&lt;br /&gt;       public override ValidationResult Validate(bool pRecursive, bool pFullValidation)&lt;br /&gt;       {&lt;br /&gt;           ValidationResult _result = base.Validate(pRecursive, pFullValidation);&lt;br /&gt;&lt;br /&gt;           if (!_result.IsValid) return _result; // Do not continue checking stuff if the base already fails.&lt;br /&gt;&lt;br /&gt;           if (Item.NeedsRegeneration == GenerationUpdateStatus.NotNeeded)&lt;br /&gt;           {&lt;br /&gt;               if (AttachedCodeBlock.File.FileExtension != "cs")&lt;br /&gt;                   _result.AddError(this, "This Template writes c# code thus it needs to be used inside a C# CodeBlock");&lt;br /&gt;           }&lt;br /&gt;&lt;br /&gt;           if (Options.SelectedColor == null)&lt;br /&gt;               _result.AddError(this, "There is no Color selected.");&lt;br /&gt;&lt;br /&gt;           return _result;&lt;br /&gt;       }&lt;br /&gt;    &lt;br /&gt;       /// What needs to be generated comes here.&lt;br /&gt;       protected override void Generate()&lt;br /&gt;       {&lt;br /&gt;           if (!IsValid) return;&lt;br /&gt;&lt;br /&gt;           // When item is invalid, no code generation&lt;br /&gt;           if (!Item.IsValid) return;&lt;br /&gt; and add the namespace&lt;br /&gt;           // The class builder in this case is the parent where we are adding this code template&lt;br /&gt;           //&lt;br /&gt;           if (ParentTemplate is IClassTemplate)&lt;br /&gt;           {&lt;br /&gt;               IClassTemplate _classTemplate = ParentTemplate as IClassTemplate;&lt;br /&gt;               _classTemplate.ClassBuilder.NameSpaces.Add(new NameSpace("System.Drawing", "System.Drawing"));&lt;br /&gt;           }&lt;br /&gt;&lt;br /&gt;           base.Generate();&lt;br /&gt;&lt;br /&gt;           // Write the Template code&lt;br /&gt;           CodeBlock.OpenRegion(ToString());           // Open a c# region in the source editor&lt;br /&gt;           string _fieldName = "_" + Name + "Color";    // the generated field name&lt;br /&gt;         &lt;br /&gt;           CodeBlock.Add("Color {0} = Color.FromArgb({1},{2},{3});", _fieldName, Options.SelectedColor.Value.R.ToString(), Options.SelectedColor.Value.G.ToString(), Options.SelectedColor.Value.B.ToString());&lt;br /&gt;         &lt;br /&gt;           CodeBlock.AddUser("AfterColorAssigned", "After the color is assigned");&lt;br /&gt;           CodeBlock.CloseRegion();                    // close the openend editor region.&lt;br /&gt;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3167981498274502078-6832313188438744667?l=epepping.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://epepping.blogspot.com/feeds/6832313188438744667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3167981498274502078&amp;postID=6832313188438744667' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/6832313188438744667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3167981498274502078/posts/default/6832313188438744667'/><link rel='alternate' type='text/html' href='http://epepping.blogspot.com/2007/05/some-new-template-developments-for.html' title='Some new template developments for GenWise.'/><author><name>Erik Pepping</name><uri>http://www.blogger.com/profile/02642067160584847697</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://4.bp.blogspot.com/_gS-vFZ1_PPc/TQOH_ta8hRI/AAAAAAAABF4/cQ50rXMJEWM/S220/ErikMugshot.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_gS-vFZ1_PPc/RsAxyo5TO4I/AAAAAAAAAAM/-SnZRxY34bQ/s72-c/ErikMugshot.jpg' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
