<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: A Generic Singleton Form Provider for C#</title>
	<atom:link href="http://craz.net/blog/2008/06/19/a-generic-singleton-form-provider-for-c/feed/" rel="self" type="application/rss+xml" />
	<link>http://craz.net/blog/2008/06/19/a-generic-singleton-form-provider-for-c/</link>
	<description>The blog of David Hammerton</description>
	<lastBuildDate>Sat, 01 Oct 2011 22:00:11 +1000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Nanu</title>
		<link>http://craz.net/blog/2008/06/19/a-generic-singleton-form-provider-for-c/comment-page-1/#comment-15099</link>
		<dc:creator>Nanu</dc:creator>
		<pubDate>Wed, 22 Jun 2011 14:47:09 +0000</pubDate>
		<guid isPermaLink="false">http://craz.new.eco-shout.org/blog/?p=5#comment-15099</guid>
		<description>Excelente trabajo! Muchísimas gracias por compartirlo...!
Felicitaciones!!

Saludos cordiales desde Argentina</description>
		<content:encoded><![CDATA[<p>Excelente trabajo! Muchísimas gracias por compartirlo&#8230;!<br />
Felicitaciones!!</p>
<p>Saludos cordiales desde Argentina</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ganga</title>
		<link>http://craz.net/blog/2008/06/19/a-generic-singleton-form-provider-for-c/comment-page-1/#comment-14886</link>
		<dc:creator>Ganga</dc:creator>
		<pubDate>Fri, 10 Jun 2011 06:59:24 +0000</pubDate>
		<guid isPermaLink="false">http://craz.new.eco-shout.org/blog/?p=5#comment-14886</guid>
		<description>That&#039;s an amazing solution. I second your statement about being as elegant as it can get. 

Works like a charm.

Thanks heaps for that.</description>
		<content:encoded><![CDATA[<p>That&#8217;s an amazing solution. I second your statement about being as elegant as it can get. </p>
<p>Works like a charm.</p>
<p>Thanks heaps for that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jeff</title>
		<link>http://craz.net/blog/2008/06/19/a-generic-singleton-form-provider-for-c/comment-page-1/#comment-11208</link>
		<dc:creator>jeff</dc:creator>
		<pubDate>Thu, 25 Nov 2010 00:14:03 +0000</pubDate>
		<guid isPermaLink="false">http://craz.new.eco-shout.org/blog/?p=5#comment-11208</guid>
		<description>Its working now! thanks, How could I miss that...
using System.Windows.Forms;


Thanks a lot.</description>
		<content:encoded><![CDATA[<p>Its working now! thanks, How could I miss that&#8230;<br />
using System.Windows.Forms;</p>
<p>Thanks a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jeff</title>
		<link>http://craz.net/blog/2008/06/19/a-generic-singleton-form-provider-for-c/comment-page-1/#comment-11198</link>
		<dc:creator>jeff</dc:creator>
		<pubDate>Wed, 24 Nov 2010 00:43:38 +0000</pubDate>
		<guid isPermaLink="false">http://craz.new.eco-shout.org/blog/?p=5#comment-11198</guid>
		<description>im getting this,



Error	2	The type or namespace name &#039;Form&#039; could not be found (are you missing a using directive or an assembly reference?)	


do i need to change the Form to the name of the Form i need to be singleton? how?

Thnak you.</description>
		<content:encoded><![CDATA[<p>im getting this,</p>
<p>Error	2	The type or namespace name &#8216;Form&#8217; could not be found (are you missing a using directive or an assembly reference?)	</p>
<p>do i need to change the Form to the name of the Form i need to be singleton? how?</p>
<p>Thnak you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rizwan</title>
		<link>http://craz.net/blog/2008/06/19/a-generic-singleton-form-provider-for-c/comment-page-1/#comment-10482</link>
		<dc:creator>Rizwan</dc:creator>
		<pubDate>Wed, 22 Sep 2010 14:35:56 +0000</pubDate>
		<guid isPermaLink="false">http://craz.new.eco-shout.org/blog/?p=5#comment-10482</guid>
		<description>Thanks for your very nice example. Its really very worthful.</description>
		<content:encoded><![CDATA[<p>Thanks for your very nice example. Its really very worthful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alvaro</title>
		<link>http://craz.net/blog/2008/06/19/a-generic-singleton-form-provider-for-c/comment-page-1/#comment-9947</link>
		<dc:creator>Alvaro</dc:creator>
		<pubDate>Wed, 21 Jul 2010 10:12:23 +0000</pubDate>
		<guid isPermaLink="false">http://craz.new.eco-shout.org/blog/?p=5#comment-9947</guid>
		<description>Hello David!
Thanks for the code above. It&#039;s perfect for me.
In my code I have included two more things:
1. MdiParent
2. BringToFront
The only thing I have changed is the GetInstance method:
public static T GetInstance(Form owner, params object[] args) where T : Form
        {
            if (!mTypeFormLookup.ContainsKey(typeof(T)))
            {
                Form f = (Form)Activator.CreateInstance(typeof(T), args);
                mTypeFormLookup.Add(typeof(T), f);
                f.Owner = owner;
                f.MdiParent = owner;
                f.FormClosed += new FormClosedEventHandler(remover);
            }
            else
            {
                Form f;
                mTypeFormLookup.TryGetValue(typeof(T),out f);
                f.BringToFront();
            }
            return (T)mTypeFormLookup[typeof(T)];
        }</description>
		<content:encoded><![CDATA[<p>Hello David!<br />
Thanks for the code above. It&#8217;s perfect for me.<br />
In my code I have included two more things:<br />
1. MdiParent<br />
2. BringToFront<br />
The only thing I have changed is the GetInstance method:<br />
public static T GetInstance(Form owner, params object[] args) where T : Form<br />
        {<br />
            if (!mTypeFormLookup.ContainsKey(typeof(T)))<br />
            {<br />
                Form f = (Form)Activator.CreateInstance(typeof(T), args);<br />
                mTypeFormLookup.Add(typeof(T), f);<br />
                f.Owner = owner;<br />
                f.MdiParent = owner;<br />
                f.FormClosed += new FormClosedEventHandler(remover);<br />
            }<br />
            else<br />
            {<br />
                Form f;<br />
                mTypeFormLookup.TryGetValue(typeof(T),out f);<br />
                f.BringToFront();<br />
            }<br />
            return (T)mTypeFormLookup[typeof(T)];<br />
        }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://craz.net/blog/2008/06/19/a-generic-singleton-form-provider-for-c/comment-page-1/#comment-8686</link>
		<dc:creator>James</dc:creator>
		<pubDate>Wed, 21 Apr 2010 17:04:03 +0000</pubDate>
		<guid isPermaLink="false">http://craz.new.eco-shout.org/blog/?p=5#comment-8686</guid>
		<description>Thank you so much.
Huge help.</description>
		<content:encoded><![CDATA[<p>Thank you so much.<br />
Huge help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sudhi</title>
		<link>http://craz.net/blog/2008/06/19/a-generic-singleton-form-provider-for-c/comment-page-1/#comment-8330</link>
		<dc:creator>Sudhi</dc:creator>
		<pubDate>Fri, 05 Mar 2010 02:31:44 +0000</pubDate>
		<guid isPermaLink="false">http://craz.new.eco-shout.org/blog/?p=5#comment-8330</guid>
		<description>Thank you for Nice example</description>
		<content:encoded><![CDATA[<p>Thank you for Nice example</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nuno Coimbra</title>
		<link>http://craz.net/blog/2008/06/19/a-generic-singleton-form-provider-for-c/comment-page-1/#comment-3885</link>
		<dc:creator>Nuno Coimbra</dc:creator>
		<pubDate>Mon, 18 May 2009 09:09:30 +0000</pubDate>
		<guid isPermaLink="false">http://craz.new.eco-shout.org/blog/?p=5#comment-3885</guid>
		<description>Hello David!

I&#039;m know for, sometimes, miss the tinny picture, i.e., the details... By rushing into things without proper first reading.

My code is exactly the one here. :) I&#039;ve created a new C# project, copy and pasted your code into it and run it. In fact I was surprised it didn&#039;t work, since I&#039;ve seen no reason for it to fail... Until now. Now I see what I&#039;ve missed. :S It&#039;s supposed to be used with regular forms... duh! :P 

Thanks! As I said before, this is truly a cool implementation and it can provide me a way for getting rid of all my Singleton forms... I&#039;ll put it to a good test. :)</description>
		<content:encoded><![CDATA[<p>Hello David!</p>
<p>I&#8217;m know for, sometimes, miss the tinny picture, i.e., the details&#8230; By rushing into things without proper first reading.</p>
<p>My code is exactly the one here. <img src='http://craz.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I&#8217;ve created a new C# project, copy and pasted your code into it and run it. In fact I was surprised it didn&#8217;t work, since I&#8217;ve seen no reason for it to fail&#8230; Until now. Now I see what I&#8217;ve missed. :S It&#8217;s supposed to be used with regular forms&#8230; duh! <img src='http://craz.net/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  </p>
<p>Thanks! As I said before, this is truly a cool implementation and it can provide me a way for getting rid of all my Singleton forms&#8230; I&#8217;ll put it to a good test. <img src='http://craz.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Hammerton</title>
		<link>http://craz.net/blog/2008/06/19/a-generic-singleton-form-provider-for-c/comment-page-1/#comment-3842</link>
		<dc:creator>David Hammerton</dc:creator>
		<pubDate>Sat, 16 May 2009 22:34:40 +0000</pubDate>
		<guid isPermaLink="false">http://craz.new.eco-shout.org/blog/?p=5#comment-3842</guid>
		<description>Hi Nuno,

There isn&#039;t any reason for it not to work under .NET 3.5, that I can see. What&#039;s the exact problem you&#039;re seeing?

You are correct, you don&#039;t inherit from the Singleton object, your Forms shouldn&#039;t be &#039;Singleton objects&#039;. You simply use the class&#039; GetInstance method to create singleton instances of forms for you.

Feel free to paste your code if you are having trouble.

David</description>
		<content:encoded><![CDATA[<p>Hi Nuno,</p>
<p>There isn&#8217;t any reason for it not to work under .NET 3.5, that I can see. What&#8217;s the exact problem you&#8217;re seeing?</p>
<p>You are correct, you don&#8217;t inherit from the Singleton object, your Forms shouldn&#8217;t be &#8216;Singleton objects&#8217;. You simply use the class&#8217; GetInstance method to create singleton instances of forms for you.</p>
<p>Feel free to paste your code if you are having trouble.</p>
<p>David</p>
]]></content:encoded>
	</item>
</channel>
</rss>

