<?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>Bee Eee Blog &#187; Uncategorized</title>
	<atom:link href="http://blog.bee-eee.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bee-eee.com</link>
	<description>-- C# hints and tips</description>
	<lastBuildDate>Wed, 23 Dec 2009 19:00:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Gay Marriage &#8212;  The farce.</title>
		<link>http://blog.bee-eee.com/2009/04/14/gay-marriage-the-farce/</link>
		<comments>http://blog.bee-eee.com/2009/04/14/gay-marriage-the-farce/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 16:51:56 +0000</pubDate>
		<dc:creator>brian</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.bee-eee.com/?p=71</guid>
		<description><![CDATA[Here we go again.  I suppose my beliefs will be mocked and I&#8217;ll be called a bigot, but public discussion needs to be open and full.  Not just one side.  So I&#8217;ll share my beliefs. Marriage between a man and a women, fulfill a useful role to our society.  They raise citizens.  Even at 50% [...]]]></description>
			<content:encoded><![CDATA[<p>Here we go again.  I suppose my beliefs will be mocked and I&#8217;ll be called a bigot, but public discussion needs to be open and full.  Not just one side.  So I&#8217;ll share my beliefs.</p>
<p>Marriage between a man and a women, fulfill a useful role to our society.  They raise citizens.  Even at 50% divorce rate the marriage relationship is by far the most stable, and best environment to raise children to become productive members of a society.  It has been proved that a child is mostly likely to grow up well adjusted with both a Father and a Mother.  As such it is in the interest of our society to protect and foster marriage between a man and a women.</p>
<p>In the eyes of the society in general the purpose of marriage is NOT sexual fulfillment, and NOT expression of love, but a means of perpetuating a sustainable society with productive citizens.</p>
<p>So what good are homosexual marriages to the state?  There is none.  They cannot procreate.  They also cannot provide both a father and a mother through adoption.  They cannot reliably raise well adjusted individuals.</p>
<p>I hear the cries of we have a right!  It&#8217;s not fair!  I ask when did you have the right to do what was wrong?</p>
<p>Jesus would never condone such homosexual actions.  Why?  Because he loves us and wants us to be truly happy.  He has said no unclean thing can enter the kingdom of God.  He has defined homosexuality as an action that will defile an individual and disqualify him/her to enter the kingdom of God.  How can we be happy if we cannot enter God&#8217;s kingdom in the end?  You cannot.  Nor can you have peace in this life.</p>
<p>Again I&#8217;m sure I&#8217;ll be mocked as old fashioned and out of touch.  But true principles do not change regardless of whether you believe them or not.</p>
<p>One unchanging fact is that God lives.  I witness it, and am not ashamed to stand as a witness.   From my own experience I know God lives.</p>
<p>Go on ahead and call me a bigot.  Mock if you wish.   I stand for virtue, I stand for that which is right and good and beautiful.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bee-eee.com/2009/04/14/gay-marriage-the-farce/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>c# Property Grid &#8211; Getting a combo box</title>
		<link>http://blog.bee-eee.com/2008/10/31/c-property-grid-getting-a-combo-box/</link>
		<comments>http://blog.bee-eee.com/2008/10/31/c-property-grid-getting-a-combo-box/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 17:15:26 +0000</pubDate>
		<dc:creator>brian</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.bee-eee.com/?p=52</guid>
		<description><![CDATA[You&#8217;d think getting a combox display into the property grid would be really simple to do since it&#8217;s used everywhere in Visual Studio 2008.  And although it isn&#8217;t horrible it isn&#8217;t exactly straight forward.  I found a couple of dead-ends, poorly explained, or difficult to find the pith of examples.  Finally I ran across this [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;d think getting a combox display into the property grid would be really simple to do since it&#8217;s used everywhere in Visual Studio 2008.  And although it isn&#8217;t horrible it isn&#8217;t exactly straight forward.  I found a couple of dead-ends, poorly explained, or difficult to find the pith of examples.  Finally I ran across <a href="http://gaaton.blogspot.com/2007/11/how-to-add-combobox-to-propertygrid.html" target="_self">this </a>one at <a href="http://gaaton.blogspot.com/">http://gaaton.blogspot.com/</a> It&#8217;s nice and concise, easy to understand, and easy to adapt.  I&#8217;m going to put in my sample which essentially taken from gaaton.</p>
<pre class="code">
internal class ProtcolConverter : StringConverter
    {
        public override bool
            GetStandardValuesSupported(
            ITypeDescriptorContext context)
        {
            //True - means show a Combobox
            //and False for show a Modal
            return true;
        }

        public override bool
            GetStandardValuesExclusive(
            ITypeDescriptorContext context)
        {
            //False - a option to edit values
            //and True - set values to state readonly
            return true;
        }

        public override StandardValuesCollection
            GetStandardValues(
            ITypeDescriptorContext context)
        {
            return new StandardValuesCollection(
                new string[] { "net.tcp", "http" });
        }
    }
</pre>
<p>And finally the we need to attach the string converter to the property by the following.</p>
<pre class="code">
[TypeConverter(typeof(ProtcolConverter))]
public string ServiceProtocol
{
     get { return MediaServiceConfig.WCFProtocol; }
     set { MediaServiceConfig.WCFProtocol = value; }
}
</pre>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bee-eee.com/2008/10/31/c-property-grid-getting-a-combo-box/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>c# Command Line Arguments</title>
		<link>http://blog.bee-eee.com/2008/04/14/c-command-line-arguments/</link>
		<comments>http://blog.bee-eee.com/2008/04/14/c-command-line-arguments/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 20:53:39 +0000</pubDate>
		<dc:creator>brian</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[c# .Net]]></category>

		<guid isPermaLink="false">http://blog.bee-eee.com/2008/04/14/c-command-line-arguments/</guid>
		<description><![CDATA[Here&#8217;s how you access the command line arguments: string[] argv = Environment.GetCommandLineArgs();]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how you access the command line arguments:</p>
<pre class="code">
string[] argv = Environment.GetCommandLineArgs();</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.bee-eee.com/2008/04/14/c-command-line-arguments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>O how beautiful!</title>
		<link>http://blog.bee-eee.com/2008/03/10/o-how-beautiful/</link>
		<comments>http://blog.bee-eee.com/2008/03/10/o-how-beautiful/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 14:41:44 +0000</pubDate>
		<dc:creator>brian</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.bee-eee.com/2008/03/10/o-how-beautiful/</guid>
		<description><![CDATA[&#8220;&#8230;Oh how beautiful upon the mountains are the feet of him that bringeth good tiding, that is the founder of peace, yea, even the Lord, who has redeemed his people; yea, him who has granted salvation unto his people&#8230;&#8221; Mosiah 15:18 &#8220;&#8230;being filled with compassion towards the children of men; standing betwixt [me] and justice; [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;&#8230;Oh how beautiful upon the mountains are the feet of him that bringeth good tiding, that is the founder of peace, yea, even the Lord, who has redeemed his people; yea, him who has granted salvation unto his people&#8230;&#8221; Mosiah 15:18</p>
<p>&#8220;&#8230;being filled with compassion towards the children of men; standing betwixt [me] and justice; having broken the bands of death, taken upon himself [my] iniquity and [my] transgressions, having redeemed [me], and satisfied the demands of justice.&#8221; &#8211; Mosiah 15:9</p>
<p>He lives.  I testify of it.  I&#8217;ve felt His heavenward pull, His encouragement all my days!  I stand as a witness of Jesus Christ and of his love.  Follow where He leads for He only leads to happiness.  Beginning steps may be painful, but  always, always, his ways lead to happiness.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bee-eee.com/2008/03/10/o-how-beautiful/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>c# Copying a 2 Dimensional Array</title>
		<link>http://blog.bee-eee.com/2008/02/12/c-copying-a-2-dimensional-array/</link>
		<comments>http://blog.bee-eee.com/2008/02/12/c-copying-a-2-dimensional-array/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 19:11:49 +0000</pubDate>
		<dc:creator>brian</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.bee-eee.com/2008/02/12/c-copying-a-2-dimensional-array/</guid>
		<description><![CDATA[Here&#8217;s a snippet to copy a 2D array. double[,] a = new double[3,3]{{1,2,3},{2,3,4},{3,4,5}}; double[,] b = new double[3,3]; Array.Copy(a,b,a.Length); Pretty simple isn&#8217;t it!]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a snippet to copy a 2D array.</p>
<pre class="code">
double[,] a = new double[3,3]{{1,2,3},{2,3,4},{3,4,5}};
double[,] b = new double[3,3];
Array.Copy(a,b,a.Length);
</pre>
<p>Pretty simple isn&#8217;t it!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bee-eee.com/2008/02/12/c-copying-a-2-dimensional-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>c# and Linq</title>
		<link>http://blog.bee-eee.com/2008/01/28/c-and-linq/</link>
		<comments>http://blog.bee-eee.com/2008/01/28/c-and-linq/#comments</comments>
		<pubDate>Mon, 28 Jan 2008 19:15:55 +0000</pubDate>
		<dc:creator>brian</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.bee-eee.com/2008/01/28/c-and-linq/</guid>
		<description><![CDATA[Today I&#8217;ve been working at the usual problems of querying internal data model then flushing the changes out to an sqlite database. This is a real drag. I was going to clean up the class and make it more to my liking, so I went to add a new class when I noticed a &#8216;linq [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;ve been working at the usual problems of querying internal data model then flushing the changes out to an sqlite database.  This is a real drag.  I was going to clean up the class and make it more to my liking, so I went to add a new class when I noticed a &#8216;linq to sql&#8217; option.  Then it struck me that this must be something like automatic mapping of programming objects to database much like is had in ruby and rails.  If so this would save me a ton of trouble</p>
<p>Well I started to dig.  Wow!  I&#8217;ve been programming for more than 20 years and had many different paradigm shifts.  First of functional programming, object oriented programming, patterns, state machines and finite automota, standard template library, Borlands vcl libraries, and now I&#8217;m thinking linq is the next big paradigm shift.</p>
<p>I can remember many years ago wishing I&#8217;d had a way to do sql queries on my internal objects instead of a for loop over the list.  Well I do know!!!  Whoo hoo!!  This is where the Linq technology comes in.  Take a look at the following example:</p>
<pre class="code">
public class Person
{
  public int id;
  public string firstName;
  public string lastName;
  public decimal cash;
  public Person(int ID, string FirstName, string LastName, decimal Cash)
  {
      id = ID;
      firstName = FirstName;
      lastName = LastName;
      cash = Cash;
  }
}
....
List&amp;gtperson&lt; people = new List&amp;gtperson&lt;();
people.Add(new Person(1, "George", "McNommy",50));
people.Add( new Person(2,"Adam","Bobbly",1500));
people.Add( new Person(3,"Billy","Freddy",2212));
people.Add( new Person(4,"Caddice","Anderdotter",-34));
IEnumerable&amp;gtstring&lt; result =
     from person in people
     orderby person.lastName
     where person.cash &gt; 0
     select person.lastName+", "+person.firstName+": $"+person.cash.ToString();

foreach (string r in result)
     log.Text += r + "\r\n";</pre>
<p>And here the results as displayed in a rich edit box.</p>
<pre class="code">
Bobbly, Adam: $1500
Freddy, Billy: $2212
McNommy, George: $50</pre>
<p>I&#8217;m just scratching the surface here.  This will make my life as a programmer so, so, so, much easier!!!</p>
<p>Thanks to <a href="http://www.code-magazine.com/article.aspx?quickid=0603021&amp;page=1" title="CoDe Magazine - Article: LINQ">Markus Egger</a> for his article I&#8217;ve just begun reading and was so excited that I had to make a blog entry before I could finish the article.  I sure there are more wonderful surprises coming.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bee-eee.com/2008/01/28/c-and-linq/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>C# writing and xml file.</title>
		<link>http://blog.bee-eee.com/2008/01/11/c-writing-and-xml-file/</link>
		<comments>http://blog.bee-eee.com/2008/01/11/c-writing-and-xml-file/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 15:50:53 +0000</pubDate>
		<dc:creator>brian</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.bee-eee.com/?p=19</guid>
		<description><![CDATA[Writing xml files in c# is fairly painless and straight forward. I&#8217;ll use XmlTextWriter in the following example. using System.Xml; string name = "Joe"; int age = 23; // create writer XmlTextWriter writer = new System.Xml.XmlTextWriter("test.xml", Encoding.UTF8); writer.Indentation = 1; writer.IndentChar = '\t'; // start the document writer.WriteStartDocument(true); // start an element writer.WriteStartElement("templates"); writer.WriteAttributeString("version", "1.0.0.0"); [...]]]></description>
			<content:encoded><![CDATA[<p>Writing xml files in c# is fairly painless and straight forward.  I&#8217;ll use XmlTextWriter in the following example.</p>
<pre class="code">
using System.Xml;
string name = "Joe";
int age = 23;

// create writer
XmlTextWriter writer =
         new System.Xml.XmlTextWriter("test.xml", Encoding.UTF8);
writer.Indentation = 1;
writer.IndentChar = '\t';

// start the document
writer.WriteStartDocument(true);

// start an element
writer.WriteStartElement("templates");
writer.WriteAttributeString("version", "1.0.0.0");

// create a sub tag people
writer.WriteStartElement("people");

// create a sub tag person
writer.WriteStartElement("person");

// add the attribute age="23"
writer.WriteAttributeString("age",age.ToString());

// write out the full tag <name>Joe</name>
writer.WriteElementString("name",name);

// close out the person tag
writer.WriteEndElement();

// close out the people tag
writer.WriteEndElement();

// close the template tag
writer.WriteEndElement();

// end the document
writer.WriteEndDocument();

// close and write to file.
writer.Close();</pre>
<p>Here is the resulting xml (formatting added)</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8" standalone="yes"?&gt;
&lt;templates version="1.0.0.0"&gt;
  &lt;people&gt;
    &lt;person age="23"&gt;
      &lt;name&gt;Joe&lt;/name&gt;
    &lt;/person&gt;
  &lt;/people&gt;
&lt;/templates&gt;</pre>
<p>As I said writing xml is a piece of cake.  Parsing on the other hand&#8230;  I&#8217;ll keep you posted.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bee-eee.com/2008/01/11/c-writing-and-xml-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting the current state of keyboard and mouse.</title>
		<link>http://blog.bee-eee.com/2008/01/09/getting-the-current-state-of-keyboard-and-mouse/</link>
		<comments>http://blog.bee-eee.com/2008/01/09/getting-the-current-state-of-keyboard-and-mouse/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 22:45:57 +0000</pubDate>
		<dc:creator>brian</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.bee-eee.com/?p=18</guid>
		<description><![CDATA[Every once and a while I need to know whether the Control key is being pressed when I process a mouse event. And sometimes I need to know the mouse position when a key is hit. Of course the keyboard modifiers aren&#8217;t passed in mouse events and the mouse button state isn&#8217;t passed in the [...]]]></description>
			<content:encoded><![CDATA[<p>Every once and a while I need to know whether the Control key is being pressed when I process a mouse event.  And sometimes I need to know the mouse position when a key is hit.  Of course the keyboard modifiers aren&#8217;t passed in mouse events and the mouse button state isn&#8217;t passed in the keyboard events.</p>
<p>No problem.  For keyboard modifier state use these properties:</p>
<pre class="code">
Control.ModifierKeys</pre>
<p>For the mouse state use these properties:</p>
<pre class="code">
Control.MouseButtons

Cursor.Position // this one you can set :)

Control.MousePosition</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.bee-eee.com/2008/01/09/getting-the-current-state-of-keyboard-and-mouse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>c# .Net double buffering &#8212; plus a little</title>
		<link>http://blog.bee-eee.com/2008/01/08/c-net-double-buffering-plus-a-little/</link>
		<comments>http://blog.bee-eee.com/2008/01/08/c-net-double-buffering-plus-a-little/#comments</comments>
		<pubDate>Tue, 08 Jan 2008 16:25:35 +0000</pubDate>
		<dc:creator>brian</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[GUI]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[c# coding GUI]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[c# gui]]></category>

		<guid isPermaLink="false">http://blog.bee-eee.com/?p=17</guid>
		<description><![CDATA[It seems I left out something that helps the quality of the .Net provided form double buffering when you are doing custom drawing. Just override OnPaintBackground and leaving it blank. This prevents the background from being momentarily drawn when you don&#8217;t want it to be. so again here&#8217;s how to enable double buffering on the [...]]]></description>
			<content:encoded><![CDATA[<p>It seems I left out something that helps the quality of the .Net provided form double buffering when you are doing custom drawing.  Just override OnPaintBackground and leaving it blank.  This prevents the background from being momentarily drawn when you don&#8217;t want it to be.</p>
<p>so again here&#8217;s how to enable double buffering on the form:</p>
<pre class="code">
this.SetStyle(
          ControlStyles.AllPaintingInWmPaint |
          ControlStyles.UserPaint |
          ControlStyles.DoubleBuffer,true);</pre>
<p>And then the override</p>
<pre>
protected override void OnPaintBackground(PaintEventArgs e)
{
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.bee-eee.com/2008/01/08/c-net-double-buffering-plus-a-little/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Making a UserControl a design time container for controls.</title>
		<link>http://blog.bee-eee.com/2008/01/04/making-a-usercontrol-a-design-time-container-for-controls/</link>
		<comments>http://blog.bee-eee.com/2008/01/04/making-a-usercontrol-a-design-time-container-for-controls/#comments</comments>
		<pubDate>Fri, 04 Jan 2008 14:52:22 +0000</pubDate>
		<dc:creator>brian</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.bee-eee.com/?p=12</guid>
		<description><![CDATA[It turns out that a user control can fairly easily become a container control during design time. In other words being able to put other controls within your user control is fairly straight forward. The steps are as follows. add the following to your usings section: using System.ComponentModel.Design; and then add the following attribute just [...]]]></description>
			<content:encoded><![CDATA[<p>It turns out that a user control can fairly easily become a container control during design time.  In other words being able to put other controls within your user control is fairly straight forward.</p>
<p>The steps are as follows.</p>
<p>add the following to your usings section:</p>
<pre class="code">using System.ComponentModel.Design;</pre>
<p>and then add the following attribute just above your declared class.</p>
<pre class="code">
[Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", typeof(IDesigner))]

public class UserControl1 : System.Windows.Forms.UserControl

{
...
}</pre>
<p>Then recompile the project and there it is.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bee-eee.com/2008/01/04/making-a-usercontrol-a-design-time-container-for-controls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
