<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Stories about everyday life &#187; Programming</title>
	<atom:link href="http://www.hariscusto.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hariscusto.com</link>
	<description>my playground</description>
	<lastBuildDate>Wed, 14 Dec 2011 23:10:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>My first blog post series, are you interested in it?</title>
		<link>http://www.hariscusto.com/programming/my-fist-blog-post-series-are-you-interested-in-it/</link>
		<comments>http://www.hariscusto.com/programming/my-fist-blog-post-series-are-you-interested-in-it/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 10:54:35 +0000</pubDate>
		<dc:creator>Haris Čusto</dc:creator>
				<category><![CDATA[Blend]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SQLite]]></category>
		<category><![CDATA[blog post series]]></category>
		<category><![CDATA[wpf]]></category>

		<guid isPermaLink="false">http://www.hariscusto.com/?p=232</guid>
		<description><![CDATA[I was thinking to write blog post series about process of developing WPF applications. The series would be about WPF and: Main architecture of Client/Server application (the big picture) Using Entity Framework with SQL Server, SQLite (or SQL CE)  and WPF (+Advanced topic on Error handling on Model level) Authentication and Authorization Navigation through Forms [...]]]></description>
			<content:encoded><![CDATA[<p>I was thinking to write blog post series about process of developing WPF applications.</p>
<p>The series would be about WPF and:</p>
<ol>
<li>Main architecture of Client/Server application (the big picture)</li>
<li>Using Entity Framework with SQL Server, SQLite (or SQL CE)  and WPF (+Advanced topic on Error handling on Model level)</li>
<li>Authentication and Authorization</li>
<li>Navigation through Forms in WPF app.<span id="more-232"></span></li>
<li>Implementing MVVM pattern and using Commands (to have clear XAML forms without Code Behind files)</li>
<li>Localization with RESX files (+Special chapter of localization using Google Translate API)</li>
<li>Synchronization between multiple clients and Server (with sync framework)</li>
<li>Implementing design (From image to actual application)</li>
<li>Creating bindable User Controlls</li>
<li>Creating Styles, templates and Themes</li>
<li>Advanced printing in WPF</li>
<li>Creating Installation</li>
<li>Creating custom application updater</li>
<li>Easy way to control Errors in one place</li>
</ol>
<p>Let me know in comments if you are interested in these topics or what else do you want to know?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hariscusto.com/programming/my-fist-blog-post-series-are-you-interested-in-it/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Sneak peek at ISOR login screen</title>
		<link>http://www.hariscusto.com/programming/c/sneak-peek-at-isor-login-screen/</link>
		<comments>http://www.hariscusto.com/programming/c/sneak-peek-at-isor-login-screen/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 09:10:14 +0000</pubDate>
		<dc:creator>Haris Čusto</dc:creator>
				<category><![CDATA[Blend]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[isor]]></category>
		<category><![CDATA[outsourcing]]></category>
		<category><![CDATA[sneak peek]]></category>
		<category><![CDATA[wpf]]></category>

		<guid isPermaLink="false">http://www.hariscusto.com/?p=229</guid>
		<description><![CDATA[ISOR is our latest WPF application, outsourced for Government of Bosnia and Herzegovina (Federal Ministry of Development, Entrepreneurship and Crafts). Case study will be published in next posts, but for now, how do you like our Login Screen ?]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.hariscusto.com/wp-content/uploads/2010/10/login-app2.jpg"><img class="alignnone size-full wp-image-230" title="ISOR Login screen" src="http://www.hariscusto.com/wp-content/uploads/2010/10/login-app2.jpg" alt="" width="580" height="421" /></a>ISOR is our latest WPF application, outsourced for Government  of Bosnia and Herzegovina (Federal Ministry of Development, Entrepreneurship and Crafts). Case study will be published in next posts, but for now, how do you like our Login Screen <img src='http://www.hariscusto.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hariscusto.com/programming/c/sneak-peek-at-isor-login-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create one click update from bin/debug folder?</title>
		<link>http://www.hariscusto.com/programming/how-to-create-one-click-update-from-bindebug-folder/</link>
		<comments>http://www.hariscusto.com/programming/how-to-create-one-click-update-from-bindebug-folder/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 19:00:28 +0000</pubDate>
		<dc:creator>Haris Čusto</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[batch timesaver time]]></category>

		<guid isPermaLink="false">http://www.hariscusto.com/?p=165</guid>
		<description><![CDATA[Well, it&#8217;s really easy! I don&#8217;t know about you, but I have huge problem with copying files from my debug folders. First of all, it&#8217;s annoying, and second of all it takes time. I&#8217;m using Visual Studio 2010 . I have Solution with 14 projects (yes, it&#8217;s big solution &#8211; actually it&#8217;s POS Sector Solution, [...]]]></description>
			<content:encoded><![CDATA[<p>Well, it&#8217;s really easy!</p>
<p>I don&#8217;t know about you, but I have huge problem with copying files from my debug folders. First of all, it&#8217;s annoying, and second of all it takes time. <span id="more-165"></span></p>
<p>I&#8217;m using Visual Studio 2010 .</p>
<p>I have Solution with 14 projects (yes, it&#8217;s big solution &#8211; actually it&#8217;s <a href="http://pos-sector.com/en">POS Sector Solution</a>, one of our products for <a title="Software for Clubs" href="http://pos-sector.com/en/pages/view/bars-and-nightclubs">Clubs</a> and <a title="Software for Restaurants" href="http://pos-sector.com/en/pages/view/restaurants">Restaurants</a>), and not all projects are referenced between themselves, so there is no way  to have all of .exe and .dll files in one Debug directory.</p>
<p>When there is tough day, i need to copy about 20 files from 5 directories for about 10 times in a day, and send them to my teammates for purpose of testing. All that ALT + TAB, CTRL + C, ALT + TAB, CTRL + V x 5 folders * 10 times = 45min / 1h lost every day.</p>
<p>To solve this, i created Batch file which copy all of files that i need, from Debug  to Update directory.</p>
<p>Here is example of batch file :</p>
<p>@echo off</p>
<p>copy &#8220;D:\projects\POS Sector\bin\Debug\POS.BusinessLogic.dll&#8221; &#8220;C:\UPDATE\POS.BusinessLogic.dll&#8221; /y<br />
copy &#8220;D:\projects\POS Sector\bin\Debug\POS.DataAccess.dll&#8221; &#8220;C:\UPDATE\POS.DataAccess.dll&#8221; /y</p>
<p>print</p>
<p>You can have as many as you need copy statements, but they must be on new line.</p>
<p>@echo off on first line will prevent any commands in the batch file to be sent to the screen when executed.</p>
<p>/y param means overwrite existing file.</p>
<p>Here is <a href="http://www.wikihow.com/Write-a-Batch-File">how you create batch file</a></p>
<p>The same way you can create batch file which will backup your directory.</p>
<h2>Do you have some tricks like this one, which are ease to do, but save a lot of time?</h2>
]]></content:encoded>
			<wfw:commentRss>http://www.hariscusto.com/programming/how-to-create-one-click-update-from-bindebug-folder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Communication between JavaScript and Actionscript (AS3) and vice versa</title>
		<link>http://www.hariscusto.com/programming/communication-between-javascript-and-actionscript-as3-and-vice-versa/</link>
		<comments>http://www.hariscusto.com/programming/communication-between-javascript-and-actionscript-as3-and-vice-versa/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 14:52:16 +0000</pubDate>
		<dc:creator>Haris Čusto</dc:creator>
				<category><![CDATA[Action Script]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[communication]]></category>
		<category><![CDATA[js]]></category>

		<guid isPermaLink="false">http://www.hariscusto.com/?p=155</guid>
		<description><![CDATA[I haven&#8217;t used flash for a while, and today while creating little news slider in flash which communicate with Javascript (and vice versa), i lost 30 min to find the best way to communicate between Flash and Javascript. So to save you a lot of time here is simple description. To Call Javascript function from [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t used flash for a while, and today while creating little news slider in flash which communicate with Javascript (and vice versa), i lost 30 min to find the best way to communicate between Flash and Javascript. So to save you a lot of time here is simple description.<br />
<span id="more-155"></span><br />
To Call Javascript function from Flash: </p>
<pre class="brush: csharp; title: ; notranslate">import flash.external.ExternalInterface;
...
ExternalInterface.call(&quot;my_js_function()&quot;);
</pre>
<p>To get a return value:</p>
<pre class="brush: csharp; title: ; notranslate">
var el_width:int = ExternalInterface.call(&quot;get_width()&quot;);
</pre>
<p>To pass an argument try:</p>
<pre class="brush: csharp; title: ; notranslate">
var el_width:int = ExternalInterface.call(&quot;get_width()&quot;, &quot;my_el_id&quot;);
</pre>
<p>And that&#8217;s it <img src='http://www.hariscusto.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>Communication with flash from javascript is a little bit harder, but if you follow these steps it sholud work.<br />
To Communicate with Flash from Javascript you need to adjust 3 different thing HTML, JS, AS.  </p>
<p>First HTML</p>
<p>The <object> tag must have an id.  For example, <object id="myFlashMovie" .....></object></p>
<p>The <embed> tag must be inside object and it must have a name attribute &#8211; name=&#8221;myFlashMovie&#8221;</p>
<p>so you will get something like this</p>
<pre class="brush: xml; title: ; notranslate">
&lt;object height=&quot;250&quot; width=&quot;380&quot; id=&quot;myFlashMovie&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8&quot; classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;&gt;
&lt;param value=&quot;myflash.swf&quot; name=&quot;movie&quot;&gt;
&lt;param value=&quot;high&quot; name=&quot;quality&quot;&gt;
&lt;param value=&quot;transparent&quot; name=&quot;wmode&quot;&gt;
&lt;param value=&quot;#FFFFFF&quot; name=&quot;bgcolor&quot;&gt;
&lt;param value=&quot;true&quot; name=&quot;allowFullScreen&quot;&gt;
&lt;param value=&quot;true&quot; name=&quot;swLiveConnect&quot;&gt;
&lt;param value=&quot;always&quot; name=&quot;allowScriptAccess&quot;&gt;

    &lt;embed height=&quot;250&quot; align=&quot;middle&quot; width=&quot;380&quot; src=&quot;myflash.swf&quot; quality=&quot;high&quot; pluginspage=&quot;http://www.macromedia.com/go/getflashplayer&quot; play=&quot;true&quot; loop=&quot;true&quot; scale=&quot;showall&quot; wmode=&quot;transparent&quot; devicefont=&quot;false&quot; bgcolor=&quot;#000000&quot; menu=&quot;true&quot; allowfullscreen=&quot;false&quot; allowscriptaccess=&quot;always&quot; salign=&quot;&quot; type=&quot;application/x-shockwave-flash&quot; name=&quot;myFlashMovie&quot;&gt;
&lt;/object&gt;
</pre>
<p>Now go to Flash.<br />
first import ExternalInterface </p>
<pre class="brush: csharp; title: ; notranslate">
import flash.external.ExternalInterface;
</pre>
<p>and now you can prepare function which will be contacted from JS </p>
<pre class="brush: csharp; title: ; notranslate">
ExternalInterface.addCallback(&quot;sendToActionScript&quot;, receivedFromJavaScript);

function receivedFromJavaScript()
{
  //code
}
</pre>
<p>You&#8217;ll see that <strong>ExternalInterface.addCallback</strong> accept 2 params, first is name of function that you call on flash object inside Javascript, and the second one i reference to as function inside Flash.</p>
<p>So when you call sendToActionScript from JS, receivedFromJavaScript will be triggered inside flash. </p>
<p>Well, we are finished with Html and Flash. Now we&#8217;ll step into JS</p>
<p>Because of browser differencies you need to have little JS function which returns your flash object (well, if this function don&#8217;t work for your browser than you should google how to get flash object). </p>
<pre class="brush: jscript; title: ; notranslate">
function get_flash(flash_id)
{
var flash;
	if(navigator.appName.indexOf(&quot;Microsoft&quot;) != -1)
		flash = window.flash_id;
	else
		flash = window.document.flash_id;
return flash;

}
</pre>
<p>Remeber that our flash expect that we call sendToActionScript in JS to trigger receivedFromJavaScript function in flash, so<br />
we will do something like this</p>
<pre class="brush: jscript; title: ; notranslate">
var flash = get_flash(&quot;myFlashMovie&quot;);
flash.sendToActionScript();
</pre>
<p>And finally this should trigger Flash function. </p>
<p>Do you need source for this? If you do, leave a comment and i will find a time to prepare it. Also if you have any questions feel free to ask. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.hariscusto.com/programming/communication-between-javascript-and-actionscript-as3-and-vice-versa/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>WordPress plugin for Google buzz this button</title>
		<link>http://www.hariscusto.com/programming/wordpress-plugin-for-google-buzz-this-button/</link>
		<comments>http://www.hariscusto.com/programming/wordpress-plugin-for-google-buzz-this-button/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 12:39:56 +0000</pubDate>
		<dc:creator>Haris Čusto</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.hariscusto.com/?p=128</guid>
		<description><![CDATA[Yesterday Google released to public Post to Buzz and Follow on Buzz buttons. You can choose from predefined list of button templates, how your button will look like and what will be posted to Buzz (description, image, url of website). With this plugin, you can do all that (and much more), from within plugin configuration [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday Google released to public <a href="http://www.google.com/buzz/api/admin/configPostWidget">Post to Buzz</a> and <a href="http://www.google.com/buzz/api/admin/configFollowWidget">Follow on Buzz</a> buttons. You can choose from predefined list of button templates, how your button will look like and what will be posted to Buzz (description, image, url of website).</p>
<p>With this plugin, you can do all that (and much more), from within plugin configuration page. Besides defining look of your button you can choose where and how it will be placed.</p>
<p>More details and screenshots you can find at <a href="http://www.hariscusto.com/buzz-this/">http://www.hariscusto.com/buzz-this/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hariscusto.com/programming/wordpress-plugin-for-google-buzz-this-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ExportData Table to Excel using C#</title>
		<link>http://www.hariscusto.com/programming/export-data-table-to-excel-using-c/</link>
		<comments>http://www.hariscusto.com/programming/export-data-table-to-excel-using-c/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 17:08:14 +0000</pubDate>
		<dc:creator>Haris Čusto</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[datatable]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[xls]]></category>

		<guid isPermaLink="false">http://www.hariscusto.com/?p=83</guid>
		<description><![CDATA[Here is little class that I wrote some time ago that helps you export data from DataTable into Excell xls file. It format fields in xls file based on data type from data table. It&#8217;s not a perfect but it will help you to quickly save data from Data Table to Excel file. Example of [...]]]></description>
			<content:encoded><![CDATA[<p>Here is little class that I wrote some time ago that helps you export data from DataTable into Excell xls file. It format fields in xls file based on data type from data table.</p>
<p>It&#8217;s not a perfect but it will help you to quickly save data from Data Table to Excel file.</p>
<p>Example of usage:</p>
<pre class="brush: csharp; title: ; notranslate">
Common.Data.Export2Excel(dataTableWithData, &quot;exported.xls&quot;);
</pre>
<p><span id="more-83"></span></p>
<pre class="brush: csharp; title: ; notranslate">
using System;
using System.Data;
using System.Data.OleDb;
using System.IO;

namespace Common.Data
{
	public class Export2Excel
	{
		public static bool Export(DataTable tbl, string fileName, bool createTable, bool overwriteFile)
		{
      string tableName = tbl.TableName.Replace(&amp;quot; &amp;quot;, &amp;quot;_&amp;quot;);
			tableName = String.IsNullOrEmpty(tableName) ? &amp;quot;Sheet1&amp;quot; : tableName;
			try
			{
				System.Globalization.CultureInfo _infoEn = System.Globalization.CultureInfo.GetCultureInfo(&amp;quot;en-GB&amp;quot;);
				string sql = &amp;quot;&amp;quot;;
				if (overwriteFile)
					if (File.Exists(fileName))
						File.Delete(fileName);

				using (OleDbConnection con = new OleDbConnection(&amp;quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&amp;quot; + fileName + &amp;quot;;Extended Properties='Excel 8.0;HDR=Yes'&amp;quot;))
				{
					con.Open();
					OleDbCommand cmdInsert;
					if (createTable || !File.Exists(fileName))
					{
						sql = &amp;quot;CREATE TABLE &amp;quot; + tableName + &amp;quot; (&amp;quot;;
						for (int i = 0; i &amp;lt; tbl.Columns.Count; i++)
						{
							sql += tbl.Columns[i].ColumnName;
							if (i + 1 == tbl.Columns.Count) //Here we decide should we close insert command or appebd another create column command
								sql += &amp;quot; &amp;quot; + GetColumnType(tbl.Columns[i]) + &amp;quot;)&amp;quot;; //Close insert
							else
								sql += &amp;quot; &amp;quot; + GetColumnType(tbl.Columns[i]) + &amp;quot;,&amp;quot;; //there is more columns to add
						}
					}
					if (!String.IsNullOrEmpty(sql))
					{
						cmdInsert = new OleDbCommand(sql, con);
						cmdInsert.ExecuteNonQuery();
					}
					foreach (DataRow row in tbl.Rows)
					{
						//Dodati parametre na comandu
						string values = &amp;quot;(&amp;quot;;
						for (int i = 0; i &amp;lt; tbl.Columns.Count; i++)
						{
							if (i + 1 == tbl.Columns.Count)
							{
								if (tbl.Columns[i].DataType == System.Type.GetType(&amp;quot;System.Decimal&amp;quot;) ||
									 tbl.Columns[i].DataType == System.Type.GetType(&amp;quot;System.Int64&amp;quot;) ||
									 tbl.Columns[i].DataType == System.Type.GetType(&amp;quot;System.Double&amp;quot;))
									values += String.IsNullOrEmpty(row[i].ToString()) ? &amp;quot;0)&amp;quot; : Convert.ToDecimal(row[i]).ToString(&amp;quot;#0.00&amp;quot;, _infoEn) + &amp;quot;)&amp;quot;;
								else
									values += &amp;quot;'&amp;quot; + System.Security.SecurityElement.Escape(row[i].ToString()) + &amp;quot;')&amp;quot;;
							}
							else
							{
								if (tbl.Columns[i].DataType == System.Type.GetType(&amp;quot;System.Decimal&amp;quot;) ||
									 tbl.Columns[i].DataType == System.Type.GetType(&amp;quot;System.Int64&amp;quot;) ||
									 tbl.Columns[i].DataType == System.Type.GetType(&amp;quot;System.Double&amp;quot;))
									values += String.IsNullOrEmpty(row[i].ToString()) ? &amp;quot;0,&amp;quot; : Convert.ToDecimal(row[i]).ToString(&amp;quot;#0.00&amp;quot;, _infoEn) + &amp;quot;,&amp;quot;;
								else
									values += &amp;quot;'&amp;quot; + System.Security.SecurityElement.Escape(row[i].ToString()) + &amp;quot;',&amp;quot;;
							}
						}
						string sqlInsert = String.Format(&amp;quot;Insert into [{0}$] VALUES {1}&amp;quot;, tableName, values);
						cmdInsert = new OleDbCommand(sqlInsert, con);

						cmdInsert.ExecuteNonQuery();
					}
				}
			}
			catch (Exception)
			{
				return false;
			}
				return true;
		}

		private static string GetColumnType(DataColumn dataColumn)
		{
			string t;
			if (dataColumn.DataType == System.Type.GetType(&amp;quot;System.Decimal&amp;quot;))
				t = &amp;quot;decimal&amp;quot;;
			else if (dataColumn.DataType == System.Type.GetType(&amp;quot;System.Int64&amp;quot;))
				t = &amp;quot;INT&amp;quot;;
			else if (dataColumn.DataType == System.Type.GetType(&amp;quot;System.Double&amp;quot;))
				t = &amp;quot;double&amp;quot;;
			else
				t = &amp;quot;VARCHAR(255)&amp;quot;;
			return t;
		}
		public static bool Export(DataTable tbl, string fileName)
		{
			return Export(tbl, fileName, true, true);
		}
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.hariscusto.com/programming/export-data-table-to-excel-using-c/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Google buzz Plugin for WordPress (Widget ready)</title>
		<link>http://www.hariscusto.com/programming/google-buzz-plugin-for-wordpress-widget-ready/</link>
		<comments>http://www.hariscusto.com/programming/google-buzz-plugin-for-wordpress-widget-ready/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 00:43:08 +0000</pubDate>
		<dc:creator>Haris Čusto</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[google buzz]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://www.hariscusto.com/?p=64</guid>
		<description><![CDATA[I&#8217;m sure in the past 24h you have heard for Google Buzz but for all you that haven&#8217;t check:  http://www.google.com/buzz I have created widget ready plugin for WordPress which you can use for displaying your latest buzz. If you are interested in it than check it out on: http://www.hariscusto.com/buzz/]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure in the past 24h you have heard for Google Buzz but for all you that haven&#8217;t check:  http://www.google.com/buzz</p>
<p>I have created widget ready plugin for WordPress which you can use for displaying your latest buzz.</p>
<p>If you are interested in it than check it out on: <a href="http://www.hariscusto.com/plugins/buzz/">http://www.hariscusto.com/buzz/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hariscusto.com/programming/google-buzz-plugin-for-wordpress-widget-ready/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Escape string in C#</title>
		<link>http://www.hariscusto.com/programming/escape-string-in-c/</link>
		<comments>http://www.hariscusto.com/programming/escape-string-in-c/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 15:33:45 +0000</pubDate>
		<dc:creator>Haris Čusto</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[MySQLd]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SQLite]]></category>

		<guid isPermaLink="false">http://www.hariscusto.com/?p=48</guid>
		<description><![CDATA[I have searched more than 30 min. for string escape method in C#, and finally here it is. You can find it deep inside Security namspace You can use it to sanitize values before saving to database.]]></description>
			<content:encoded><![CDATA[<p>I have searched more than 30 min. for string escape method in C#, and finally here it is.</p>
<p>You can find it deep inside Security namspace</p>
<pre class="brush: csharp; title: ; notranslate">
string safeString = System.Security.SecurityElement.Escape(&quot;St'ring to escpa&quot;);
</pre>
<p>You can use it to sanitize values before saving to database. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.hariscusto.com/programming/escape-string-in-c/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Reset all controls on form (Windows forms &#8211; C#)</title>
		<link>http://www.hariscusto.com/programming/reset-all-controls-on-forms/</link>
		<comments>http://www.hariscusto.com/programming/reset-all-controls-on-forms/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 16:13:54 +0000</pubDate>
		<dc:creator>Haris Čusto</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[WinForms]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.hariscusto.com/?p=16</guid>
		<description><![CDATA[Well i had a situation where i need to reset all controls (mostly Textboxes and Comboboxes) on form to their default (entry ready) state. Well, at first sight I was thinking it&#8217;s not a problem, my .net Win form have property called Controls &#8211; list of all controls on form. But problem was that i [...]]]></description>
			<content:encoded><![CDATA[<p>Well i had a situation where i need to reset all controls (mostly Textboxes and Comboboxes)  on form to their default (entry ready) state.  Well, at first sight I was thinking it&#8217;s not a problem, my .net Win form have property called <strong>Controls</strong> &#8211; list of all controls on form.  But problem was that i had overlapping panels which i used for positioning, and inside of panels was Group box control. So it&#8217;s allready complicated then at first sight.</p>
<p>I have created little Form helper which will help you reset all controls on form to their default state.<br />
<span id="more-16"></span></p>
<pre class="brush: csharp; title: ; notranslate">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace UI.Forms
{
	public class FormHelper
	{
		public static void ResetFields(Control form)
		{
			foreach (Control ctrl in form.Controls)
			{
				if (ctrl.Controls.Count &amp;gt; 0)
					ResetFields(ctrl);
				Reset(ctrl);
			}
		}
		public static void Reset(Control ctrl)
		{
			if (ctrl is TextBox)
			{
				TextBox tb = (TextBox)ctrl;
				if (tb != null)
				{
					tb.ResetText();
				}
			}
			else if (ctrl is ComboBox)
			{
				ComboBox dd = (ComboBox)ctrl;
				if (dd != null)
				{
					dd.SelectedIndex = 0;
				}
			}
		}
	}
}
</pre>
<p>Sample usage &#8211; calling method from code behind form:<br />
Example:</p>
<pre class="brush: csharp; title: ; notranslate">FormHelper.ResetFields(this);
</pre>
<p>Where <strong>this</strong> is reference to Form on which controls resides</p>
<p>I hope you&#8217;ll find it useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hariscusto.com/programming/reset-all-controls-on-forms/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

