<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Kain64b's Blog</title>
	
	<link>http://kain64b.wordpress.com</link>
	<description>Lazy Man's Blog</description>
	<lastBuildDate>Sun, 30 Aug 2009 12:42:05 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain="kain64b.wordpress.com" port="80" path="/?rsscloud=notify" registerProcedure="" protocol="http-post" />
<image>
		<url>http://www.gravatar.com/blavatar/9d4b19d0eb20478b3655bbb0e6219029?s=96&amp;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Kain64b's Blog</title>
		<link>http://kain64b.wordpress.com</link>
	</image>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/Kain64bsBlog" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Voice Build notification plug-in for TeamCity</title>
		<link>http://feedproxy.google.com/~r/Kain64bsBlog/~3/K4JK44QkNag/</link>
		<comments>http://kain64b.wordpress.com/2009/08/30/108/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 04:48:44 +0000</pubDate>
		<dc:creator>kain64b</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[build notification plugin]]></category>
		<category><![CDATA[sound notification]]></category>
		<category><![CDATA[TeamCity]]></category>
		<category><![CDATA[TeamCity plugin]]></category>
		<category><![CDATA[voice notification]]></category>

		<guid isPermaLink="false">http://kain64b.wordpress.com/2009/08/30/108/</guid>
		<description><![CDATA[Idea: make a plugin for TeamCity integration server  that can say after build: &#8220;WTF!!! Project XXX build is failed!!!&#8221; or &#8220;Good job!&#8221;.


I have writen a small program using Microsoft speech object library on C#:

Open text file and read all text from file aloud:

[CODE language="csharp"]
class Program {
     static void Main(string[] args) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kain64b.wordpress.com&blog=5737445&post=108&subd=kain64b&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Idea: make a plugin for TeamCity integration server  that can say after build: &#8220;WTF!!! Project XXX build is failed!!!&#8221; or &#8220;Good job!&#8221;.
</p>
<ol>
<li>I have writen a small program using Microsoft speech object library on C#:
</li>
<p>Open text file and read all text from file aloud:
</p>
<p>[CODE language="csharp"]<br />
class Program {<br />
     static void Main(string[] args) {<br />
         if (args.Length != 1)<br />
            throw new InvalidOperationException(&#8221;1 pameter&#8221;);<br />
         var text = File.ReadAllText(args[0]);<br />
         var spVoice = new SpVoice();<br />
         spVoice.Speak(text, SpeechVoiceSpeakFlags.SVSFPurgeBeforeSpeak);<br />
      }<br />
   }<br />
[/CODE]</p>
<p>
 </p>
<p>
<li>And I have writen notification plugin:</li>
</ol>
<p>Notifier class must implement jetbrains.buildServer.notification.Notificator.
</p>
<p>Notifier contains:
</p>
<ul>
<li>notifyBuildStarted &#8211; called when build started,
</li>
<li>notifyBuildSuccessful – called when build succeed,
</li>
<li>notifyBuildFailed &#8211; called when build  failed,
</li>
<li>notifyBuildFailing &#8211; called when build failing (for example on 1-st test fail in build),
</li>
<li>notifyBuildProbablyHanging &#8211; called if somebody make hang operation in out build.
</li>
</ul>
<p> It&#8217;s necessary to prepare artifacts for building plugin. I&#8217;m using Maven2 for missing artifact resolving. </p>
<p> User must define output file name (with build result information) and reader program in web form.
</p>
<p><img src="http://kain64b.files.wordpress.com/2009/08/083009_0448_1.png">
	</p>
<p>Two editable fields are created  in constructor:
</p>
<p>[CODE language="java"]<br />
public SoundNotificator(NotificatorRegistry notificatorRegistry) throws IOException {<br />
        ArrayList&lt;UserPropertyInfo&gt; userProps = new ArrayList&lt;UserPropertyInfo&gt;();<br />
       userProps.add(new UserPropertyInfo(_OUTPUT_FILE, _OUTPUT_FILE)); &#8212;&#8212;&#8212;&#8212;text box for outputfile<br />
        userProps.add(new UserPropertyInfo(_READER_PROGRAM, _READER_PROGRAM)); &#8212;- text box for reader program<br />
        notificatorRegistry.register(this, userProps);<br />
<    }<br />
[/CODE]</p>
<p>To read values from that text fields I create NotificatorPropertyKey&#8217;s and send 2 parametrs to constructor: 1<sup>st</sup> &#8211; string plugin type, 2<sup>nd</sup> &#8211; string that are passing into UserPropertyInfo object, when properties are registered in Notificator ctor. And finaly we can run reader app from plugin &#8220;Process p = Runtime.getRuntime().exec(executeProgram);&#8221;
</p>
<p>Notifier full source code:<br />
<a href="http://code.google.com/p/soundnotification">http://code.google.com/p/soundnotification</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kain64b.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kain64b.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kain64b.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kain64b.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kain64b.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kain64b.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kain64b.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kain64b.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kain64b.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kain64b.wordpress.com/108/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kain64b.wordpress.com&blog=5737445&post=108&subd=kain64b&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/Kain64bsBlog/~4/K4JK44QkNag" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kain64b.wordpress.com/2009/08/30/108/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/74d1d37e317b4bd7bf5d8ca259a101dc?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kain64b</media:title>
		</media:content>

		<media:content url="http://kain64b.files.wordpress.com/2009/08/083009_0448_1.png" medium="image" />
	<feedburner:origLink>http://kain64b.wordpress.com/2009/08/30/108/</feedburner:origLink></item>
		<item>
		<title>RIA.NET  + Silverlight 3: Store picture in database and display it in UI controls (DataGrid, DataForm)</title>
		<link>http://feedproxy.google.com/~r/Kain64bsBlog/~3/lYAIq6n_a30/</link>
		<comments>http://kain64b.wordpress.com/2009/06/10/ria-net-silverlight-3-store-picture-in-database-and-display-it-in-ui-controls-datagrid-dataform/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 02:38:53 +0000</pubDate>
		<dc:creator>kain64b</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C# 3.5]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[RIA.NET]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight3 Beta]]></category>

		<guid isPermaLink="false">http://kain64b.wordpress.com/2009/06/10/ria-net-silverlight-3-store-picture-in-database-and-display-it-in-ui-controls-datagrid-dataform/</guid>
		<description><![CDATA[
RIA.NET  + Silverlight 3: Store picture in database and display it in UI controls (DataGrid, DataForm)
We have a table in SQL server with field of &#8220;Image&#8221; type. We add ADO.NET Entity Data Model by standard way:

Then add table to model. Sql type Image by default is mapping on C# Binary type.
Then Domain Service Class.

And [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kain64b.wordpress.com&blog=5737445&post=88&subd=kain64b&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:center;">
<h1>RIA.NET  + Silverlight 3: Store picture in database and display it in UI controls (DataGrid, DataForm)</h1>
<p>We have a table in SQL server with field of &#8220;Image&#8221; type. We add ADO.NET Entity Data Model by standard way:</p>
<p><img src="http://kain64b.files.wordpress.com/2009/06/061009_0238_rianetsilv1.png" alt="" /></p>
<p>Then add table to model. Sql type Image by default is mapping on C# Binary type.</p>
<p>Then Domain Service Class.</p>
<p><img src="http://kain64b.files.wordpress.com/2009/06/061009_0238_rianetsilv2.png" alt="" /></p>
<p>And link it with EF Model:</p>
<p><img src="http://kain64b.files.wordpress.com/2009/06/061009_0238_rianetsilv3.png" alt="" /></p>
<p>Main rule of web services: to hide service realization (platform and source code of course <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).  RIA.NET code generator creates entity class on client side, where picture stored in field of type &#8211; byte[] (simple byte array).</p>
<p>Add DataGrid on from and add DomainDataSource:</p>
<p>[CODE language="XML"]<br />
               <RiaControls:DomainDataSource x:Name="gamerDataSource"<br />
                LoadMethodName=&#8221;LoadGamer&#8221; LoadSize=&#8221;20&#8243; AutoLoad=&#8221;True&#8221; ><br />
                    <RiaControls:DomainDataSource.DomainContext><br />
                        <servises:GamerContext/><br />
                    </RiaControls:DomainDataSource.DomainContext><br />
                </RiaControls:DomainDataSource> </p>
<p>[/CODE]</p>
<p>In the grid set AutoGenerateColumns=&#8221;False&#8221;. Add column to grid to display image (add image control into grid field template):</p>
<p>[CODE language="XML"]<br />
<data:DataGrid.Columns><br />
                        <data:DataGridTemplateColumn x:Name="PhotoItem" Header="Photo" ><br />
                            <data:DataGridTemplateColumn.CellTemplate><br />
                                <DataTemplate><br />
                                    <Image x:Name="PhotoImage" MaxHeight="50" MaxWidth="40" Source ="{Binding Photo, Converter={StaticResource ImageConverter}}"/><br />
                                </DataTemplate><br />
                            </data:DataGridTemplateColumn.CellTemplate><br />
                        </data:DataGridTemplateColumn><br />
                    </data:DataGrid.Columns><br />
[/CODE]</p>
<p>Direct binding doesn&#8217;t work. We need to convert &#8220;byte[]&#8221; value to &#8220;BitmapImage&#8221; value (we need write in  xaml &#8220;<span style="font-family:Courier New;font-size:10pt;"><span style="color:red;">Source</span><span style="color:blue;"> =&#8221;{</span><span style="color:#a31515;">Binding</span><span style="color:red;"> Photo</span><span style="color:blue;">,</span><span style="color:red;"> Converter</span><span style="color:blue;">={</span><span style="color:#a31515;">StaticResource</span><span style="color:red;"> ImageConverter</span><span style="color:blue;">}}&#8221;/&gt;</span></span>&#8220;</p>
<p>There is a simple image converter below:</p>
<p>[CODE language="CSharp"]<br />
public class ImageConverter : IValueConverter {<br />
public object Convert(object value, Type targetType,<br />
object parameter, System.Globalization.CultureInfo culture) {<br />
BitmapImage bi = new BitmapImage();//create bitmap image<br />
if(value!=null)<br />
//fill bitmap by data from db<br />
bi.SetSource(new MemoryStream((Byte[])value));<br />
return bi;<br />
}</p>
<p>public object ConvertBack(object value, Type targetType,<br />
object parameter, System.Globalization.CultureInfo culture) {<br />
throw new NotImplementedException();//image is readonly(view only)<br />
}<br />
}</p>
<p>[/CODE]</p>
<p>We need to create template field in DataForm (code is the same as in DataGrid):<br />
[CODE language="XML"]<br />
<dataControls:DataFormTemplateField FieldLabelContent="Photo"><br />
                            <dataControls:DataFormTemplateField.DisplayTemplate><br />
                                <DataTemplate><br />
                                    <Image x:Name="PhotoField" Source ="{Binding Photo, Converter={StaticResource ImageConverter}}" MaxWidth="100" MaxHeight="100"/><br />
                                </DataTemplate><br />
                            </dataControls:DataFormTemplateField.DisplayTemplate><br />
                        </dataControls:DataFormTemplateField></p>
<p>[/CODE]</p>
<p>Ok, now we want to open picture and store it on server. It&#8217;s very simple:</p>
<p>Add &#8220;open picture&#8221; button and on Onclick event add this code:</p>
<p>1) Get stream on local file using OpenFileDialog.</p>
<p>2) Read all bytes in array.</p>
<p>3) Assign selected entity <span style="font-family:Courier New;font-size:10pt;">Photo field to reader array.<br />
</span><br />
[CODE language="CSharp"]<br />
private void LoadPicture_Click(object sender, RoutedEventArgs e) {<br />
var openFileDialog = new OpenFileDialog();<br />
var res = openFileDialog.ShowDialog();<br />
if (res.HasValue &amp;&amp; res.Value) {<br />
Stream stream = openFileDialog.File.OpenRead();<br />
BinaryReader binaryReader = new BinaryReader(stream);<br />
byte[] currentImageInBytes = binaryReader.ReadBytes((int) stream.Length);<br />
//get selected entry from grid<br />
((Gamer) gamerGrid.SelectedItem).Photo = currentImageInBytes;<br />
}<br />
}<br />
[/CODE]</p>
<p>And last one, Call DomainDataSource::SubmitChanges to store in Database.</p>
<p>P.S. Waiting for RTM release of RIA.NET. And of course MSDN 2010 <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kain64b.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kain64b.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kain64b.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kain64b.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kain64b.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kain64b.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kain64b.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kain64b.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kain64b.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kain64b.wordpress.com/88/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kain64b.wordpress.com&blog=5737445&post=88&subd=kain64b&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/Kain64bsBlog/~4/lYAIq6n_a30" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kain64b.wordpress.com/2009/06/10/ria-net-silverlight-3-store-picture-in-database-and-display-it-in-ui-controls-datagrid-dataform/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/74d1d37e317b4bd7bf5d8ca259a101dc?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kain64b</media:title>
		</media:content>

		<media:content url="http://kain64b.files.wordpress.com/2009/06/061009_0238_rianetsilv1.png" medium="image" />

		<media:content url="http://kain64b.files.wordpress.com/2009/06/061009_0238_rianetsilv2.png" medium="image" />

		<media:content url="http://kain64b.files.wordpress.com/2009/06/061009_0238_rianetsilv3.png" medium="image" />
	<feedburner:origLink>http://kain64b.wordpress.com/2009/06/10/ria-net-silverlight-3-store-picture-in-database-and-display-it-in-ui-controls-datagrid-dataform/</feedburner:origLink></item>
		<item>
		<title>TeamCity 4.5 RELEASED!</title>
		<link>http://feedproxy.google.com/~r/Kain64bsBlog/~3/ai5a_jDnRZI/</link>
		<comments>http://kain64b.wordpress.com/2009/04/25/teamcity-45-released/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 11:22:49 +0000</pubDate>
		<dc:creator>kain64b</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kain64b.wordpress.com/?p=76</guid>
		<description><![CDATA[TeamCity 4.5 RELEASED!
Read about new features in http://www.jetbrains.com/teamcity/features/newfeatures.html. Migrating from 4.0.2 to 4.5 Now  
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kain64b.wordpress.com&blog=5737445&post=76&subd=kain64b&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.jetbrains.com/teamcity/">TeamCity</a> 4.5 RELEASED!<br />
Read about new features in <a href="http://www.jetbrains.com/teamcity/features/newfeatures.html">http://www.jetbrains.com/teamcity/features/newfeatures.html</a>. Migrating from 4.0.2 to 4.5 Now <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kain64b.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kain64b.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kain64b.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kain64b.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kain64b.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kain64b.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kain64b.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kain64b.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kain64b.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kain64b.wordpress.com/76/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kain64b.wordpress.com&blog=5737445&post=76&subd=kain64b&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/Kain64bsBlog/~4/ai5a_jDnRZI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kain64b.wordpress.com/2009/04/25/teamcity-45-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/74d1d37e317b4bd7bf5d8ca259a101dc?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kain64b</media:title>
		</media:content>
	<feedburner:origLink>http://kain64b.wordpress.com/2009/04/25/teamcity-45-released/</feedburner:origLink></item>
		<item>
		<title>TestComplete integration into TeamCity</title>
		<link>http://feedproxy.google.com/~r/Kain64bsBlog/~3/LwXZ6Fyfjug/</link>
		<comments>http://kain64b.wordpress.com/2009/04/23/testcomplete-integration-into-teamcity/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 08:31:50 +0000</pubDate>
		<dc:creator>kain64b</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[C# 3.5]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[GUI Tests]]></category>
		<category><![CDATA[TeamCity]]></category>
		<category><![CDATA[TestComplete]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://kain64b.wordpress.com/?p=68</guid>
		<description><![CDATA[TestComplete integration into TeamCity
We use TestComplete for GUI testing in our work. For faster tests execution we use several PC&#8217;s with TestComplete. A unique part of full task list runs on each PC.
But how can we split task for maximum workload of PC? How to combine results without manual work?
It also would be good to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kain64b.wordpress.com&blog=5737445&post=68&subd=kain64b&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:center;"><a href="http://www.automatedqa.com/products/testcomplete/">TestComplete</a> integration into <a href="http://www.jetbrains.com/teamcity/">TeamCity</a></p>
<p style="text-align:justify;">We use TestComplete for GUI testing in our work. For faster tests execution we use several PC&#8217;s with TestComplete. A unique part of full task list runs on each PC.</p>
<p style="text-align:justify;">But how can we split task for maximum workload of PC? How to combine results without manual work?</p>
<p style="text-align:justify;">It also would be good to include GUI testing in to continuous integration process. As a continuous integration server we use TeamCity. TestComplete can be simply integrated into native AutomatedQA continuous integration server. But this server doesn&#8217;t fit our needs. It&#8217;s payware and doesn&#8217;t support pre-tested commit.</p>
<p style="text-align:justify;">We need to create this:</p>
<p style="text-align:justify;"><img src="http://kain64b.files.wordpress.com/2009/04/042309-0831-testcomplet1.png" alt="" /></p>
<p style="text-align:justify;">
<p style="text-align:justify;">TeamCity runs GUI tests on all TestComplete clients. <a href="http://www.nunit.org/">NUnit </a>runner will be used as a program which starts distributes tests. All test results will be combining in TestFixture ctor. All TestComplete PC&#8217;s has a small web service to handle TeamCity request on test.</p>
<p style="text-align:justify;">Let&#8217;s start. On all TestComplete PC we run web service. TeamCity contains project that contains Nunit TestFixture for distributed test run. Web service runs application by client&#8217;s parameters. Message sequence on initialization and run test.</p>
<p style="text-align:justify;">
<p style="text-align:justify;"><img src="http://kain64b.files.wordpress.com/2009/04/042309-0831-testcomplet2.png" alt="" /></p>
<p style="text-align:justify;">
<p style="text-align:justify;">As a dispatcher algorithm we use &#8220;round robin&#8221;.  We need simply thread manager for controlling active thread count and providing simple algorithm of synchronization.</p>
<p style="text-align:justify;">
<p>[CODE language="CSharp"]<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Threading;</p>
<p>namespace ThreadLib {<br />
   ///interface for thread result<br />
   public interface IThreadResult { }</p>
<p>   public delegate T FuncDelegate<T>() where T : IThreadResult;//wrapper for delegate</p>
<p>   public class ThreadControler<T> where T : IThreadResult {<br />
      private class ThreadParam {<br />
         public string Id;<br />
         public FuncDelegate<T> Delegate;<br />
      }<br />
      ///delegates for execution<br />
      private readonly Dictionary<string, FuncDelegate<T>> Delegates = new Dictionary<string, FuncDelegate<T>>();<br />
      ///results<br />
      private readonly Dictionary<string, T> Results = new Dictionary<string, T>();<br />
      private int _MaxParalelThreadCount;<br />
      private static Semaphore Semaphore;</p>
<p>      public ThreadControler(int maxParalelThreadCount) {<br />
         MaxParalelThreadCount = maxParalelThreadCount;<br />
      }</p>
<p>      public T GetResult(string key) {<br />
         if (!Results.ContainsKey(key))<br />
            throw new ArgumentException(string.Format(&#8221;no result by this key {0}&#8221;, key));<br />
         return Results[key];<br />
      }</p>
<p>      public void AddDelegate(string key, FuncDelegate<T> @delegate) {<br />
         Delegates.Add(key, @delegate);<br />
      }<br />
      public int MaxParalelThreadCount {<br />
         get { return _MaxParalelThreadCount; }<br />
         set {<br />
            if (value < 1)<br />
               throw new ArgumentException(&#8221;value<1");<br />
            _MaxParalelThreadCount = value;<br />
         }<br />
      }<br />
///wrapper for delegate<br />
      public void ThreadFunc(object param) {<br />
         var threadParam = (ThreadParam)param;<br />
         var result = threadParam.Delegate();<br />
         lock (Results) {<br />
            Results.Add(threadParam.Id, result);<br />
         }<br />
         Semaphore.Release();<br />
      }<br />
///run all delegate in parallel mode<br />
      public void Run() {<br />
         if (Delegates.Count == 0)<br />
            throw new InvalidOperationException(&#8221;No Thread for Start&#8221;);<br />
         if (MaxParalelThreadCount < 1)<br />
            throw new InvalidOperationException(&#8221;MaxParalelThreadCount<1");</p>
<p>         using(Semaphore = new Semaphore(MaxParalelThreadCount, MaxParalelThreadCount)){<br />
            var threads = new List<Thread>();<br />
            foreach (var key in Delegates.Keys) {<br />
               Semaphore.WaitOne();<br />
               var localKey = key;<br />
               var @delegate = Delegates[localKey];<br />
               var param = new ThreadParam { Delegate = @delegate, Id = localKey };<br />
               var thread = new Thread(ThreadFunc);<br />
               threads.Add(thread);<br />
               thread.Start(param);<br />
            }<br />
            foreach (var thread in threads)<br />
                thread.Join();<br />
         }<br />
      }</p>
<p>   }<br />
}</p>
<p>[/CODE]</p>
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:center;">
<h3>Web service for running and controlling application (TestComplete for example)</h3>
<p>For Service creation I choose WCF. Here simple interface of service:</p>
<p style="text-align:justify;">
<p>[CODE language="CSharp"]<br />
[ServiceContract]<br />
   public interface ISpreadRunnerService {<br />
      [OperationContract]<br />
      TaskResult TryRunProgramm(string @executable, string @params, int timeout);<br />
   }</p>
<p>[/CODE]</p>
<p style="text-align:justify;">For using this server need simple send &#8220;exe&#8221; name, params for &#8220;exe&#8221;, and timeout. Also we need to know busy server or not.</p>
<p style="text-align:justify;">Service implementation:</p>
<p style="text-align:justify;">
<p>[CODE language="CSharp"]<br />
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple)]<br />
    public class SpreadRunnerService : ISpreadRunnerService<br />
    {<br />
        private readonly object Locker = new object();<br />
//strategy how to run app and how to get app results<br />
        protected IRunProgramStrategy Strategy;<br />
        public virtual TaskResult TryRunProgramm(string executable, string @params, int timeout)<br />
        {<br />
//Lock service!!!<br />
            if (!Monitor.TryEnter(Locker))<br />
            {<br />
                return Strategy.NotRunResult;<br />
            }</p>
<p>            var result= Strategy.Run(executable, @params, timeout);<br />
           Monitor.Exit(Locker);<br />
           return result;<br />
        }<br />
        /// <summary><br />
        /// only for studio hoster<br />
        /// </summary><br />
        internal SpreadRunnerService() : this(null) { }<br />
        public SpreadRunnerService(IRunProgramStrategy strategy)<br />
        {<br />
            Strategy = strategy;<br />
        }<br />
    }</p>
<p>[/CODE]</p>
<p style="text-align:justify;">
<p style="text-align:justify;">SimpleRunStrategy code part. Only run application and return application exit code.</p>
<p style="text-align:justify;">
<p>[CODE language="CSharp"]<br />
[DataContract]<br />
   public class TaskResult : ITaskResult {<br />
      [DataMember]<br />
      public bool Runned { get; set; }<br />
      [DataMember]<br />
      public bool Hang { get; set; }<br />
      [DataMember]<br />
      public int ProgramResult { get; set; }<br />
      [DataMember]<br />
      public string ExtraData;<br />
   }<br />
public interface IRunProgramStrategy {<br />
      TaskResult Run(string executable, string @params, int timeout);<br />
      TaskResult HangResult { get; }<br />
      TaskResult NotRunResult { get; }<br />
   }<br />
public class RunProgramStrategySimple : IRunProgramStrategy{<br />
/*…*/<br />
public virtual TaskResult Run(string executable, string @params, int timeout) {<br />
         TaskResult result=null;<br />
         try {<br />
            BeforeProcessRun();<br />
            Process p = new Process();<br />
            p.StartInfo.FileName = executable;<br />
            p.StartInfo.Arguments = @params;<br />
            p.Start();<br />
            p.WaitForExit(timeout);<br />
            if (!p.HasExited) {<br />
               p.Kill();<br />
               result= HangResult;<br />
            }<br />
            else<br />
            result= new TaskResult { Hang = false, ProgramResult = p.ExitCode, Runned = true };<br />
         }<br />
         catch (Exception e){<br />
            result= NotRunResult;<br />
            Console.WriteLine(e.Message + &#8221; &#8220;+executable+<br />
               &#8221; &#8220;+ @params);<br />
         }<br />
         finally{<br />
            AfterProcessRun(result);<br />
         }<br />
         return result;<br />
      }<br />
/*…*/</p>
<p>[/CODE]</p>
<p style="text-align:justify;">
<p style="text-align:justify;">Client is also very simple. Here it&#8217;s  implementation:</p>
<p style="text-align:justify;">
<p>[CODE language="CSharp"]<br />
public class Task<br />
    {<br />
        public string Id { get; set; }<br />
        public string Executable{get;set;}<br />
        public string Params{get;set;}<br />
        public int Timeout { get; set; }<br />
    }<br />
public class SpreadRunnerClient<br />
    {<br />
//our thread controller<br />
        private ThreadControler<TaskResult> ThreadController = new  ThreadControler<TaskResult>();<br />
//list of service host. May be better use UDDI but…<br />
        internal readonly List<string> Hosts = new List<string>();<br />
//task –that stored in external file<br />
        private List<Task> Tasks = new List<Task>();<br />
public IEnumerable<string> getHosts()<br />
        {<br />
            while(true)<br />
                foreach (string host in Hosts)<br />
                    yield return host;<br />
        }</p>
<p>// create runner delegates for all task and run them in parallel mode<br />
public void RunAllTasks()<br />
        {<br />
            ThreadController.MaxParalelThreadCount = Hosts.Count;<br />
            foreach (var task in Tasks)<br />
            {<br />
                var lockref = task;<br />
                FuncDelegate<TaskResult> func = delegate()<br />
                {<br />
                    while (true)<br />
                    {<br />
                        foreach (string host in getHosts())<br />
                            try<br />
                            {<br />
                               var binding = new WSHttpBinding(&#8221;WSHttpBinding_ISpreadRunnerService&#8221;);<br />
                               binding.ReceiveTimeout = TimeSpan.FromMilliseconds(lockref.Timeout*2000);<br />
                               binding.OpenTimeout= TimeSpan.FromMilliseconds(20000);<br />
                               binding.SendTimeout = TimeSpan.FromMilliseconds(lockref.Timeout * 2000);<br />
                               using (var client = new SpreadRunnerServiceClient(binding, new EndpointAddress(host)))<br />
                                {<br />
                                    client.Open();<br />
//try to run application in server<br />
                                    TaskResult result = client.TryRunProgramm(lockref.Executable, lockref.Params, lockref.Timeout);<br />
                                    if (result.Runned)<br />
                                        return result;<br />
                                }<br />
                            }<br />
                            catch { }<br />
                    }<br />
                    throw new ApplicationException();<br />
                };<br />
                ThreadController.AddDelegate(lockref.Id,func);<br />
            }<br />
            ThreadController.Run();<br />
        }</p>
<p>[/CODE]</p>
<p style="text-align:justify;">
<p style="text-align:justify;">And finally we need to make TestFixture that contain <span style="font-family:Times New Roman;font-size:12pt;">SpreadRunnerClient</span>. In TestFixtureSetUp we must Load All Task from file and give them into <span style="font-family:Times New Roman;font-size:12pt;">SpreadRunnerClient</span>. And call <span style="font-family:Times New Roman;font-size:12pt;">SpreadRunnerClient</span>::RunAllTasks. For handling results we need to write some Test methods, for example:</p>
<p style="text-align:justify;">
<p>[CODE language="CSharp"]<br />
private static void AssertTests(TaskResult res) {<br />
         bool isnormalresult = res.ProgramResult == 0 || res.ProgramResult == 1;<br />
         Assert.IsTrue(isnormalresult, &#8220;result is a &#8221; + res.ProgramResult + &#8221; |&#8221; + res.ExtraData);<br />
         Assert.IsFalse((res.ExtraData.ToLowerInvariant().Contains(&#8221;exception&#8221;)), res.ExtraData);<br />
      }<br />
      // ReSharper disable InconsistentNaming<br />
      [Test]<br />
      public void XXXX001() { var res = client.GetResultsById(&#8221;XXXX001&#8243;); AssertTests(res); }</p>
<p>[/CODE]</p>
<p style="text-align:justify;">And finally we can run this test in TeamCity:</p>
<p style="text-align:justify;"><img src="http://kain64b.files.wordpress.com/2009/04/042309-0831-testcomplet3.png" alt="" /></p>
<p style="text-align:justify;">
<p style="text-align:justify;">
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kain64b.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kain64b.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kain64b.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kain64b.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kain64b.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kain64b.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kain64b.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kain64b.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kain64b.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kain64b.wordpress.com/68/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kain64b.wordpress.com&blog=5737445&post=68&subd=kain64b&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/Kain64bsBlog/~4/LwXZ6Fyfjug" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kain64b.wordpress.com/2009/04/23/testcomplete-integration-into-teamcity/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/74d1d37e317b4bd7bf5d8ca259a101dc?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kain64b</media:title>
		</media:content>

		<media:content url="http://kain64b.files.wordpress.com/2009/04/042309-0831-testcomplet1.png" medium="image" />

		<media:content url="http://kain64b.files.wordpress.com/2009/04/042309-0831-testcomplet2.png" medium="image" />

		<media:content url="http://kain64b.files.wordpress.com/2009/04/042309-0831-testcomplet3.png" medium="image" />
	<feedburner:origLink>http://kain64b.wordpress.com/2009/04/23/testcomplete-integration-into-teamcity/</feedburner:origLink></item>
		<item>
		<title>Bug in Resharper 4.1 NunitTestRunner</title>
		<link>http://feedproxy.google.com/~r/Kain64bsBlog/~3/uI8cYpubZlQ/</link>
		<comments>http://kain64b.wordpress.com/2009/01/30/bug-in-resharper-41-nunittestrunner/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 06:02:27 +0000</pubDate>
		<dc:creator>kain64b</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kain64b.wordpress.com/?p=54</guid>
		<description><![CDATA[Resharper  very usefull tool   but ...
Sample:

[TestFixture]
   public class Tests {
      [SetUp]
      public void SetUp(){
         Debug.WriteLine(&#34;SetUp&#34;);
         Assert.IsTrue(false);//can't create some resource
      [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kain64b.wordpress.com&blog=5737445&post=54&subd=kain64b&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><pre>Resharper  very usefull tool <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  but ...
Sample:
<pre class="brush: csharp;">
[TestFixture]
   public class Tests {
      [SetUp]
      public void SetUp(){
         Debug.WriteLine(&quot;SetUp&quot;);
         Assert.IsTrue(false);//can't create some resource
      }
      [TearDown]
      public void TearDown(){
         Debug.WriteLine(&quot;TearDown&quot;);
      }
      [Test]
      public void Test() { }
   }
</pre>
<p>Output log Resharper4.1:</p>
<pre class="brush: csharp;">
Tests.Test : Failed

SetUp

NUnit.Framework.AssertionException:   Expected: True

But was:  False

at NUnit.Framework.Assert.That(Object actual, Constraint constraint, String message, Object[] args)
at NUnit.Framework.Assert.IsTrue(Boolean condition, String message, Object[] args)

at NUnit.Framework.Assert.IsTrue(Boolean condition)at Test.Tests.SetUp() in test.cs: line 14
</pre>
<p>Output log nunit-gui:</p>
<pre class="brush: csharp;">SetUp
VDTest.Tests.Test:
  Expected: True
  But was:  False
at Tests.Tests.SetUp() in tests.cs:line 14
TearDown
</pre>
<p>teardown must be called in resharper runner. but.......</pre>
</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kain64b.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kain64b.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kain64b.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kain64b.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kain64b.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kain64b.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kain64b.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kain64b.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kain64b.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kain64b.wordpress.com/54/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kain64b.wordpress.com&blog=5737445&post=54&subd=kain64b&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/Kain64bsBlog/~4/uI8cYpubZlQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kain64b.wordpress.com/2009/01/30/bug-in-resharper-41-nunittestrunner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/74d1d37e317b4bd7bf5d8ca259a101dc?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kain64b</media:title>
		</media:content>
	<feedburner:origLink>http://kain64b.wordpress.com/2009/01/30/bug-in-resharper-41-nunittestrunner/</feedburner:origLink></item>
		<item>
		<title>Save DataBase records in unit test’s using AOP in C#</title>
		<link>http://feedproxy.google.com/~r/Kain64bsBlog/~3/A_OzoosdKag/</link>
		<comments>http://kain64b.wordpress.com/2008/12/05/save-database-records-in-unit-test-using-aop-in-c/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 10:09:11 +0000</pubDate>
		<dc:creator>kain64b</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[AOP]]></category>
		<category><![CDATA[Nunit]]></category>
		<category><![CDATA[PostSharp]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://kain64b.wordpress.com/?p=41</guid>
		<description><![CDATA[In test cases I change some rows, add and remove. how to restore it. I try use this way: using PostSharp -AOP framework + TransactionScope objects. on OnEntry in testcase method I create transaction on OnExit from testcase method I remove it:


[Serializable]
   class DoNotMakeChangesInBase : OnMethodBoundaryAspect {
      public override void OnEntry(MethodExecutionEventArgs context) {
         context.MethodExecutionTag = [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kain64b.wordpress.com&blog=5737445&post=41&subd=kain64b&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In test cases I change some rows, add and remove. how to restore it. I try use this way: using <a title="PostSharp" href="http://www.postsharp.org/" target="_blank">PostSharp</a> -AOP framework + <a title="TransactionScope" href="http://www.google.com/url?sa=U&amp;start=1&amp;q=http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx&amp;ei=4Pw4SaiCF6D80ATvqYGFBw&amp;sig2=wJx_LMlS5Uysfk1RndtcXQ&amp;usg=AFQjCNFg_dGihUHYARqqmWWnsQqsnWetmQ" target="_blank">TransactionScope</a> objects. on OnEntry in testcase method I create transaction on OnExit from testcase method I remove it:</p>
<pre class="brush: csharp;">

[Serializable]
   class DoNotMakeChangesInBase : OnMethodBoundaryAspect {
      public override void OnEntry(MethodExecutionEventArgs context) {
         context.MethodExecutionTag = new TransactionScope();
      }
      public override void OnExit(MethodExecutionEventArgs context) {
         using (context.MethodExecutionTag as IDisposable) ;
      }
   }

///using this as:

[DoNotMakeChangesInBase ]

[Test]

public void MyTestCase(){....}
</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kain64b.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kain64b.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kain64b.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kain64b.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kain64b.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kain64b.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kain64b.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kain64b.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kain64b.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kain64b.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kain64b.wordpress.com&blog=5737445&post=41&subd=kain64b&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/Kain64bsBlog/~4/A_OzoosdKag" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kain64b.wordpress.com/2008/12/05/save-database-records-in-unit-test-using-aop-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/74d1d37e317b4bd7bf5d8ca259a101dc?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kain64b</media:title>
		</media:content>
	<feedburner:origLink>http://kain64b.wordpress.com/2008/12/05/save-database-records-in-unit-test-using-aop-in-c/</feedburner:origLink></item>
		<item>
		<title>Using Linq for finding files that contains searched text in given directory</title>
		<link>http://feedproxy.google.com/~r/Kain64bsBlog/~3/HyoGYL2nwLg/</link>
		<comments>http://kain64b.wordpress.com/2008/12/04/using-linq-for-finding-files-that-contains-searched-text-in-given-directory/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 12:42:16 +0000</pubDate>
		<dc:creator>kain64b</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[C# 3.5]]></category>
		<category><![CDATA[Linq]]></category>

		<guid isPermaLink="false">http://kain64b.wordpress.com/?p=36</guid>
		<description><![CDATA[Playing with LinqToObject I create this simple code. Maybe it could be useful for somebody.


public static List&#60;string&#62; SystemFiles(string directory, string pattern, string fileextension) {
         List&#60;string&#62; returnList = new List&#60;string&#62;();
         if(fileextension==&#34;)
            fileextension = &#34;*.*&#34;   
         string[] files = Directory.GetFiles(directory, fileextension);
         var outfiles = (from file in files select new { FileName = file, FileLines [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kain64b.wordpress.com&blog=5737445&post=36&subd=kain64b&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Playing with LinqToObject I create this simple code. Maybe it could be useful for somebody.</p>
<pre class="brush: csharp;">

public static List&lt;string&gt; SystemFiles(string directory, string pattern, string fileextension) {
         List&lt;string&gt; returnList = new List&lt;string&gt;();
         if(fileextension==&quot;)
            fileextension = &quot;*.*&quot;   
         string[] files = Directory.GetFiles(directory, fileextension);
         var outfiles = (from file in files select new { FileName = file, FileLines = File.ReadAllLines(file) }).Select(x =&gt; x).Where(x =&gt; x.FileLines.Select(line =&gt; line).Where(line =&gt; Regex.Match(line, pattern).Success).Count() !=0).Select(x =&gt; x.FileName);
         foreach (string s in outfiles)
         {
            string str = new FileInfo(s.ToUpper()).Name.ToUpper();
            str = str.Substring(0, str.Length - 4);
            returnList.Add(str);
         }
         return returnList;
      }
</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kain64b.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kain64b.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kain64b.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kain64b.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kain64b.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kain64b.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kain64b.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kain64b.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kain64b.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kain64b.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kain64b.wordpress.com&blog=5737445&post=36&subd=kain64b&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/Kain64bsBlog/~4/HyoGYL2nwLg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kain64b.wordpress.com/2008/12/04/using-linq-for-finding-files-that-contains-searched-text-in-given-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/74d1d37e317b4bd7bf5d8ca259a101dc?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kain64b</media:title>
		</media:content>
	<feedburner:origLink>http://kain64b.wordpress.com/2008/12/04/using-linq-for-finding-files-that-contains-searched-text-in-given-directory/</feedburner:origLink></item>
		<item>
		<title>Creating readable MSSqlServer DataBase SnapShot</title>
		<link>http://feedproxy.google.com/~r/Kain64bsBlog/~3/e8eSouNeEZI/</link>
		<comments>http://kain64b.wordpress.com/2008/12/04/creating-readable-mssqlserver-database-snapshot/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 12:29:02 +0000</pubDate>
		<dc:creator>kain64b</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[DataBase SnapShot]]></category>
		<category><![CDATA[MSSqlServer]]></category>
		<category><![CDATA[save database into text file]]></category>

		<guid isPermaLink="false">http://kain64b.wordpress.com/?p=27</guid>
		<description><![CDATA[I often need to create  database snapshot to compare current snapshot  with old snapshot.  I tried to use standard MSSQL BackUp&#8217;s and compare binary files. But it&#8217;s very difficult to find row (value) that differing.  I don&#8217;t find a free tool for saving database in plane text. And write the following function (this function can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kain64b.wordpress.com&blog=5737445&post=27&subd=kain64b&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I often need to create  database snapshot to compare current snapshot  with old snapshot.  I tried to use standard MSSQL BackUp&#8217;s and compare binary files. But it&#8217;s very difficult to find row (value) that differing.  I don&#8217;t find a free tool for saving database in plane text. And write the following function (this function can be added in nant script <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p>
<pre class="brush: csharp;">
// username is login for local sqlserver instance
//dbname is database name on local sqlserver
//filename is name of out file(name of snapshot)
private static void MakeSQLDump(string username, string dbname, string filename) {
         string gettables =
             @&quot;select table_name
                    FROM  INFORMATION_SCHEMA.TABLES
                    WHERE     (TABLE_TYPE = 'BASE TABLE')
                    order by table_name &quot;;
         string connstr = string.Format(&quot;Data Source={0};Initial Catalog={1};Integrated Security=True&quot;, username, dbname);
         SqlConnection conn = new SqlConnection(connstr);
         conn.Open();
         SqlCommand gettablescommand = new SqlCommand(gettables, conn);
         SqlDataReader reader = gettablescommand.ExecuteReader();
         List&lt;string&gt; TablesList = new List&lt;string&gt;();
         while (reader.Read()) {
            TablesList.Add(reader.GetString(0));
         }
         reader.Close();
         string getvaluescommandTxt = &quot;select * from {0} order by recnum&quot;;
         string GetcolumsNameCommandtxt = &quot;SELECT INFORMATION_SCHEMA.COLUMNS.Column_Name FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='{0}'&quot;;
         SqlCommand getvaluescommand = new SqlCommand(&quot;&quot;, conn);
         foreach (string tablename in TablesList) {
            string tmp = &quot;&quot;;
            getvaluescommand.CommandText = string.Format(GetcolumsNameCommandtxt, tablename);
            SqlDataReader columsreader = null;
            try {
               columsreader = getvaluescommand.ExecuteReader();
               tmp = string.Format(&quot;[{0}]{1}&quot;, tablename, Environment.NewLine);
               while (columsreader.Read()) {
                  tmp += string.Format(&quot;{0}, &quot;, columsreader.GetString(0));
               }
               tmp.TrimEnd(',');
               tmp += Environment.NewLine;
               WriteStringIntoFile(tmp, filename);
            }
            catch { }
            finally {
               if (columsreader != null)
                  columsreader.Close();
            }

            getvaluescommand.CommandText = string.Format(getvaluescommandTxt, tablename);
            SqlDataReader valreader = null;
            try {

               valreader = getvaluescommand.ExecuteReader();
               tmp = &quot;&quot;;
               while (valreader.Read()) {
                  for (int i = 0; i &lt; valreader.FieldCount; i++) {
                     if (valreader.IsDBNull(i)) tmp += &quot;&quot;;
                     else tmp += string.Format(&quot;\&quot;{0}\&quot;&quot;, valreader.GetValue(i));
                     if (i &lt; (valreader.FieldCount - 1)) tmp += &quot;, &quot;;
                  }
                  tmp += Environment.NewLine;
                  WriteStringIntoFile(tmp, filename);
                  tmp = &quot;&quot;;
               }
            }
            finally {
               if (valreader != null)
                  valreader.Close();
            }
         }
      }
</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kain64b.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kain64b.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kain64b.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kain64b.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kain64b.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kain64b.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kain64b.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kain64b.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kain64b.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kain64b.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kain64b.wordpress.com&blog=5737445&post=27&subd=kain64b&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/Kain64bsBlog/~4/e8eSouNeEZI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kain64b.wordpress.com/2008/12/04/creating-readable-mssqlserver-database-snapshot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/74d1d37e317b4bd7bf5d8ca259a101dc?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kain64b</media:title>
		</media:content>
	<feedburner:origLink>http://kain64b.wordpress.com/2008/12/04/creating-readable-mssqlserver-database-snapshot/</feedburner:origLink></item>
		<item>
		<title>Using Nant for synchronize two VSS servers</title>
		<link>http://feedproxy.google.com/~r/Kain64bsBlog/~3/MioNHV1Ty8A/</link>
		<comments>http://kain64b.wordpress.com/2008/12/04/using-nant-for-synchronyze-two-vss-servers/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 08:22:39 +0000</pubDate>
		<dc:creator>kain64b</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Nant]]></category>
		<category><![CDATA[synchronize two VSS servers]]></category>
		<category><![CDATA[VCS]]></category>
		<category><![CDATA[VSS]]></category>

		<guid isPermaLink="false">http://kain64b.wordpress.com/?p=20</guid>
		<description><![CDATA[Getting Nant + nantcontrib. And write following script:

&#60;target name=&#34;GetLastVersion&#34;&#62;
&#60;!--here get last version into $projectdir--&#62;
&#60;/target&#62;
&#60;target name=&#34;VssAddFiles&#34;&#62;
		&#60;fileset basedir=&#34;${projectdir}&#34; id=&#34;ServerFiles&#34;&#62;
			&#60;include name=&#34;**\*.*&#34;/&#62;
			&#60;exclude name=&#34;**\*.vspscc&#34;/&#62;
			&#60;exclude name=&#34;**\*.vssscc&#34;/&#62;
			&#60;exclude name=&#34;**\*.scc&#34;/&#62;
			&#60;exclude name=&#34;**\*.vss&#34;/&#62;
			&#60;exclude name=&#34;**\*.suo&#34;/&#62;
			&#60;exclude name=&#34;**\*.resharper.user&#34;/&#62;
			&#60;exclude name=&#34;**\*.resharper&#34;/&#62;
		&#60;/fileset&#62;
		&#60;foreach item=&#34;File&#34; property=&#34;serverFile&#34;&#62;
			&#60;in&#62;
				&#60;items refid=&#34;ServerFiles&#34;/&#62;
			&#60;/in&#62;
			&#60;do&#62;
&#60;property name=&#34;localFile&#34;
					value=&#34;${string::replace(serverFile, projectdir, tempDir)}&#34; /&#62;
&#60;property name=&#34;currentFolder&#34;
					value=&#34;${path::get-directory-name(serverFile)}&#34; /&#62;
&#60;property name=&#34;vssPath&#34;
					value=&#34;${string::replace(string::replace(currentFolder, projectdir,
						LocalVSSPath), '\', '/')}&#34; /&#62;
				&#60;if test=
					&#34;${not file::exists(localFile)
					and not string::contains(localFile, '\obj\')
					and not string::contains(localFile, '\bin\')
					and not string::contains(localFile, '\bin\')
					and not string::contains(localFile, '\build\')
					and not string::contains(localFile, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kain64b.wordpress.com&blog=5737445&post=20&subd=kain64b&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Getting <a title="Nant" href="http://nant.sourceforge.net/" target="_blank">Nant </a>+ <a title="nantcontrib" href="http://nantcontrib.sourceforge.net/" target="_blank">nantcontrib</a>. And write following script:</p>
<pre class="brush: xml;">
&lt;target name=&quot;GetLastVersion&quot;&gt;
&lt;!--here get last version into $projectdir--&gt;
&lt;/target&gt;
&lt;target name=&quot;VssAddFiles&quot;&gt;
		&lt;fileset basedir=&quot;${projectdir}&quot; id=&quot;ServerFiles&quot;&gt;
			&lt;include name=&quot;**\*.*&quot;/&gt;
			&lt;exclude name=&quot;**\*.vspscc&quot;/&gt;
			&lt;exclude name=&quot;**\*.vssscc&quot;/&gt;
			&lt;exclude name=&quot;**\*.scc&quot;/&gt;
			&lt;exclude name=&quot;**\*.vss&quot;/&gt;
			&lt;exclude name=&quot;**\*.suo&quot;/&gt;
			&lt;exclude name=&quot;**\*.resharper.user&quot;/&gt;
			&lt;exclude name=&quot;**\*.resharper&quot;/&gt;
		&lt;/fileset&gt;
		&lt;foreach item=&quot;File&quot; property=&quot;serverFile&quot;&gt;
			&lt;in&gt;
				&lt;items refid=&quot;ServerFiles&quot;/&gt;
			&lt;/in&gt;
			&lt;do&gt;
&lt;property name=&quot;localFile&quot;
					value=&quot;${string::replace(serverFile, projectdir, tempDir)}&quot; /&gt;
&lt;property name=&quot;currentFolder&quot;
					value=&quot;${path::get-directory-name(serverFile)}&quot; /&gt;
&lt;property name=&quot;vssPath&quot;
					value=&quot;${string::replace(string::replace(currentFolder, projectdir,
						LocalVSSPath), '\', '/')}&quot; /&gt;
				&lt;if test=
					&quot;${not file::exists(localFile)
					and not string::contains(localFile, '\obj\')
					and not string::contains(localFile, '\bin\')
					and not string::contains(localFile, '\bin\')
					and not string::contains(localFile, '\build\')
					and not string::contains(localFile, '\MCControls\')
					and not string::contains(localFile, 'ReSharper')}&quot;&gt;&lt;!--remove some artefacts--&gt;
					&lt;echo message = &quot;${vssPath}&quot; /&gt;
					&lt;vssadd dbpath=&quot;\\server\vsstest\srcsafe.ini&quot;
					username=&quot;${UserName}&quot; password=&quot;${UserPassword}&quot; path=&quot;${vssPath}&quot;
					verbose=&quot;true&quot;&gt;
						&lt;fileset basedir=&quot;${currentFolder}&quot;&gt;
							&lt;include name=&quot;${path::get-file-name(serverFile)}&quot;/&gt;
						&lt;/fileset&gt;
					&lt;/vssadd&gt;
					&lt;echo message=&quot;${serverFile}&quot;/&gt;
				&lt;/if&gt;
			&lt;/do&gt;
		&lt;/foreach&gt;
	&lt;/target&gt;
&lt;target name = &quot;ChekinLatestVersion&quot;&gt;
        &lt;call target =&quot;GetLastVersion&quot;/&gt;
		&lt;!-- checkout into dummy directory--&gt;
		&lt;vsscheckout
			username=&quot;${UserName}&quot;
			password=&quot;${UserPassword}&quot;
			localpath=&quot;${tempDir}&quot;
			recursive=&quot;true&quot;
			writable=&quot;false&quot;
			dbpath=&quot;${LocalVSSPath}&quot;
			path=&quot;${VSSProjectDir}&quot;
		/&gt;
		&lt;!-- checkin from project directory--&gt;
		&lt;vsscheckin
                  username=&quot;${UserName}&quot;
				  password=&quot;${UserPassword}&quot;
                  localpath=&quot;${projectdir}&quot;
                  recursive=&quot;true&quot;
                  writable=&quot;false&quot;
                  dbpath=&quot;${LocalVSSPath}&quot;
				  path=&quot;${VSSProjectDir}&quot;
                  comment=&quot;NAnt checkin&quot;
        /&gt;
		&lt;call target =&quot;VssAddFiles&quot;/&gt;
	&lt;/target&gt;
</pre>
<p>in  GetLastVersion you can get from different vcs</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kain64b.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kain64b.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kain64b.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kain64b.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kain64b.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kain64b.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kain64b.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kain64b.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kain64b.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kain64b.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kain64b.wordpress.com&blog=5737445&post=20&subd=kain64b&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/Kain64bsBlog/~4/MioNHV1Ty8A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kain64b.wordpress.com/2008/12/04/using-nant-for-synchronyze-two-vss-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/74d1d37e317b4bd7bf5d8ca259a101dc?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kain64b</media:title>
		</media:content>
	<feedburner:origLink>http://kain64b.wordpress.com/2008/12/04/using-nant-for-synchronyze-two-vss-servers/</feedburner:origLink></item>
		<item>
		<title>Writing Sourcecontrol Plugin for CruiseControl.Net</title>
		<link>http://feedproxy.google.com/~r/Kain64bsBlog/~3/2RXqsspCP0s/</link>
		<comments>http://kain64b.wordpress.com/2008/12/04/write-sourcecontrol-plugin-for-cruisecontrolnet/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 06:09:29 +0000</pubDate>
		<dc:creator>kain64b</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[CruiseControl.Net]]></category>
		<category><![CDATA[Sourcecontrol Plugin]]></category>

		<guid isPermaLink="false">http://kain64b.wordpress.com/?p=3</guid>
		<description><![CDATA[CruiseControl.Net is a port of famous CruiseControl &#8211; Continuous Intagration Server. In our firm we use remote Visual Source Safe Server via VSSConnect. And I write Sourcecontrol Plugin CruiseControl.Net. This plugin should only &#8220;Get Latest Version&#8221;   After some googling  I found interface ISourceControl.
Here result plugin code:


using System;
using System.Collections.Generic;
using System.Text;
using ThoughtWorks.CruiseControl.Core;
using ThoughtWorks.CruiseControl.Core.Util;
using Exortech.NetReflector;
using System.Diagnostics;
using [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kain64b.wordpress.com&blog=5737445&post=3&subd=kain64b&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a title="CruiseControl.Net" href="http://ccnet.thoughtworks.com/" target="_blank">CruiseControl.Net</a> is a port of famous <a title="CruiseControl" href="http://cruisecontrol.sourceforge.net/" target="_blank">CruiseControl</a> &#8211; <a title="Continuous Intagration Server" href="http://en.wikipedia.org/wiki/Continuous_integration">Continuous Intagration Server</a>. In our firm we use remote Visual Source Safe Server via <a title="vssconnect" href="http://www.vssconnect.com/vssconnect.htm">VSSConnect</a>. And I write Sourcecontrol Plugin CruiseControl.Net. This plugin should only &#8220;Get Latest Version&#8221; <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  After some googling  I found interface ISourceControl.</p>
<p>Here result plugin code:</p>
<pre class="brush: csharp;">

using System;
using System.Collections.Generic;
using System.Text;
using ThoughtWorks.CruiseControl.Core;
using ThoughtWorks.CruiseControl.Core.Util;
using Exortech.NetReflector;
using System.Diagnostics;
using System.IO;
using log4net;
using log4net.Core;
namespace ThoughtWorks.CruiseControl.vssprovider {

   [ReflectorType(&quot;VSSConnectPlugin&quot;)]
   public class VSSConnectPlugin : ISourceControl {
      private readonly ILog logger = LogManager.GetLogger(typeof(MyVssPlugin));

      #region public members
      [ReflectorProperty(&quot;args&quot;, Required = true)]
      public string Arguments {
         get {
            return _arguments;
         }
         set {
            _arguments = value;
         }
      }

      [ReflectorProperty(&quot;vsslog&quot;, Required = true)]
      public string VSSLogFile {
         get {
            return _vsslogFileName;
         }
         set {
            _vsslogFileName = value;
         }
      }

      #endregion
      #region private members
      string _arguments = &quot;&quot;;
      string _vsslogFileName = &quot;&quot;;
      #endregion
      #region ISourceControl Members

      /// Get Modification from vcs. because  vssconnect command line doesn't
      /// support this function, get code
      public Modification[] GetModifications(IIntegrationResult from, IIntegrationResult to) {
         Modification[] modificationArray = null;
         try {
            ProcessStartInfo processStartInfo = new ProcessStartInfo(&quot;vssc&quot;, Arguments);
            processStartInfo.RedirectStandardOutput = true;
            processStartInfo.UseShellExecute = false;
            Process process = new Process();
            process.StartInfo = processStartInfo;
            process.Start();
            StreamReader streamReader = process.StandardOutput;
            string resultString = streamReader.ReadToEnd();
            return vssoutputparser.Parse(resultString);
         }
         catch {
            if (((IntegrationResult)to).BuildCondition !=
                                      ThoughtWorks.CruiseControl.Remote.BuildCondition.ForceBuild) {
               ((IntegrationResult)to).BuildCondition =
                                      ThoughtWorks.CruiseControl.Remote.BuildCondition.NoBuild;
               ((IntegrationResult)from).BuildCondition =
                                      ThoughtWorks.CruiseControl.Remote.BuildCondition.NoBuild;
            }
            modificationArray = new Modification[0];
         }
         return modificationArray;

      }

      public void GetSource(IIntegrationResult result) {

      }

      public void Initialize(IProject project) {

      }

      public void LabelSourceControl(IIntegrationResult result) {

      }

      public void Purge(IProject project) {

      }

      #endregion
   }
}

using System;
using System.Collections.Generic;
using System.Text;
using ThoughtWorks.CruiseControl.Core;
using ThoughtWorks.CruiseControl.Core.Util;
namespace ThoughtWorks.CruiseControl.vssprovider {
   public class vssoutputparser {
      public static Modification[] Parse(string inStr) {
         List listOfModifiedFile = new List();
         string[] strArray = inStr.Split(new char[] { '\n', '\r' },
StringSplitOptions.RemoveEmptyEntries);
         foreach (string str in strArray) {
            if (str.ToUpper().Contains(&quot;Replacing&quot;.ToUpper())) {
               string fname = str.ToUpper().Replace(&quot;Replacing&quot;.ToUpper(), &quot;&quot;).Trim();
               listOfModifiedFile.Add(fname);
            }
         }
         Modification[] modificationArray = new Modification[listOfModifiedFile.Count];
         for (int i = 0; i &lt; modificationArray.Length; i++) {
            modificationArray[i] = new Modification();
            int slashPosition = listOfModifiedFile[i].LastIndexOf(&quot;\\&quot;);
            if (slashPosition != -1) {
               modificationArray[i].FileName =
                              listOfModifiedFile[i].Substring(slashPosition + 1,
                                              listOfModifiedFile[i].Length - slashPosition - 1);
               modificationArray[i].FolderName =
                               listOfModifiedFile[i].Substring(0, slashPosition + 1);
            }
            else {
               modificationArray[i].FileName = listOfModifiedFile[i];
               modificationArray[i].FolderName = &quot;&quot;;
            }
            modificationArray[i].ChangeNumber = 0;
            modificationArray[i].Type = &quot;modified&quot;;
            modificationArray[i].Version = &quot;0&quot;;
         }
         return modificationArray;
      }
   }
}
</pre>
<p>using in cruisecontrol config file</p>
<pre>&lt;sourcecontrol type="VSSConnectPlugin"&gt;
	&lt;args&gt;/s:ghttp://XX.XXX.XX.XXX:XXXX/lpath:XXXXXXXXXXXXXXXX
/cmd:getproject /user:"XXXXXXXXXX" /pw:XXXXXXXXX/sspath:$/XXXXXXXXXr&lt;/args&gt;
    	&lt;vsslog&gt;XXXXXXXXXXX&lt;/vsslog&gt;
&lt;/sourcecontrol&gt;</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kain64b.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kain64b.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kain64b.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kain64b.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kain64b.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kain64b.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kain64b.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kain64b.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kain64b.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kain64b.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kain64b.wordpress.com&blog=5737445&post=3&subd=kain64b&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/Kain64bsBlog/~4/2RXqsspCP0s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kain64b.wordpress.com/2008/12/04/write-sourcecontrol-plugin-for-cruisecontrolnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/74d1d37e317b4bd7bf5d8ca259a101dc?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kain64b</media:title>
		</media:content>
	<feedburner:origLink>http://kain64b.wordpress.com/2008/12/04/write-sourcecontrol-plugin-for-cruisecontrolnet/</feedburner:origLink></item>
	</channel>
</rss>
