<?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"
	>
<channel>
	<title>Comments for Guy Mahieu's Blog</title>
	<atom:link href="http://blog.guymahieu.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.guymahieu.com</link>
	<description>Agile OO Software Development and More</description>
	<pubDate>Sun, 01 Aug 2010 00:24:35 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>Comment on Deep reflection of properties: PropertyReflector by Property in Vietnam</title>
		<link>http://blog.guymahieu.com/2006/07/11/deep-reflection-of-properties-propertyreflector/#comment-16781</link>
		<dc:creator>Property in Vietnam</dc:creator>
		<pubDate>Mon, 12 Jul 2010 07:05:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.guymahieu.com/?p=9#comment-16781</guid>
		<description>Thanks for sharing these tips. It is very helpful for us.</description>
		<content:encoded><![CDATA[<p>Thanks for sharing these tips. It is very helpful for us.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Deep reflection of properties: PropertyReflector by Adolfo</title>
		<link>http://blog.guymahieu.com/2006/07/11/deep-reflection-of-properties-propertyreflector/#comment-16773</link>
		<dc:creator>Adolfo</dc:creator>
		<pubDate>Fri, 09 Jul 2010 20:51:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.guymahieu.com/?p=9#comment-16773</guid>
		<description>Hi Guy,

The modified version of GetValue method I just posted got chopped off it should be:
 public object GetValue(object target, string propertyName)
        {
            if (propertyName.IndexOf(PropertyNameSeparator) &#62; -1)
            {
                int index = -1;
                string[] propertyList = propertyName.Split(PropertyNameSeparator);
                for (int i = 0; i = 0)
                    {
                        var List = (IList) target;
                        if (index &#60; List.Count)
                        {
                            target = List[index];
                        }
                    }
                    if (target == null)
                    {
                        return null;
                    }
                }
                return target;
            }
            else
            {
                return GetValueImpl(target, propertyName);
            }
        }
Regards,
Adolfo</description>
		<content:encoded><![CDATA[<p>Hi Guy,</p>
<p>The modified version of GetValue method I just posted got chopped off it should be:<br />
 public object GetValue(object target, string propertyName)<br />
        {<br />
            if (propertyName.IndexOf(PropertyNameSeparator) &gt; -1)<br />
            {<br />
                int index = -1;<br />
                string[] propertyList = propertyName.Split(PropertyNameSeparator);<br />
                for (int i = 0; i = 0)<br />
                    {<br />
                        var List = (IList) target;<br />
                        if (index &lt; List.Count)<br />
                        {<br />
                            target = List[index];<br />
                        }<br />
                    }<br />
                    if (target == null)<br />
                    {<br />
                        return null;<br />
                    }<br />
                }<br />
                return target;<br />
            }<br />
            else<br />
            {<br />
                return GetValueImpl(target, propertyName);<br />
            }<br />
        }<br />
Regards,<br />
Adolfo</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Deep reflection of properties: PropertyReflector by Adolfo</title>
		<link>http://blog.guymahieu.com/2006/07/11/deep-reflection-of-properties-propertyreflector/#comment-16772</link>
		<dc:creator>Adolfo</dc:creator>
		<pubDate>Fri, 09 Jul 2010 20:41:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.guymahieu.com/?p=9#comment-16772</guid>
		<description>This was very helpful thanks for the great article. I made some modifications to the GetValue Method so it can handle generic Lists:


Notice it uses an extra method to test if a Type is a Generic List:

        public static bool IsGenericList(Type type)
        {
            foreach (Type @interface in type.GetInterfaces())
            {
                if (@interface.IsGenericType)
                {
                    if (@interface.GetGenericTypeDefinition() == typeof(ICollection))
                    {
                        return true;
                    }
                }
            }
            return false;
        }

        public object GetValue(object target, string propertyName)
        {
            if (propertyName.IndexOf(PropertyNameSeparator) &#62; -1)
            {
                int index = -1;
                string[] propertyList = propertyName.Split(PropertyNameSeparator);
                for (int i = 0; i = 0)
                    {
                        IList list = (IList) target;
                        if (index &#60; list.Count)
                        {
                            //Get the corresponding item in the list
                            target = list[index];
                        }
                    }
                    if (target == null)
                    {
                        return null;
                    }
                }
                return target;
            }
            else
            {
                return GetValueImpl(target, propertyName);
            }
        }
An example of the usage:

        public class Store
        {
            public Store()
            {
                StringInstruments = new PluckedStrings();
            }
            public PluckedStrings StringInstruments { get; set; }
        }

        public class PluckedStrings
        {
            // Fields
            private List guitars = new List();

            // Properties
            public List Guitars
            {
                get { return this.guitars; }
                set { this.guitars = value; }
            }
        }

        public class Guitar
        {
            public string Brand { get; set; }
        }

And Finally we test it:
            Store mystore = new Store();
            Guitar lucille = new Guitar();
            lucille.Brand = "Gibson";
            mystore.StringInstruments.Guitars.Add(lucille);
            //Get the Brand value for Guitar Item at position 0, or any other index
            object brand = pr.GetValue(mystore, "StringInstruments.Guitars[0].Brand");

I hope this helps and thanks again for the post,
Adolfo</description>
		<content:encoded><![CDATA[<p>This was very helpful thanks for the great article. I made some modifications to the GetValue Method so it can handle generic Lists:</p>
<p>Notice it uses an extra method to test if a Type is a Generic List:</p>
<p>        public static bool IsGenericList(Type type)<br />
        {<br />
            foreach (Type @interface in type.GetInterfaces())<br />
            {<br />
                if (@interface.IsGenericType)<br />
                {<br />
                    if (@interface.GetGenericTypeDefinition() == typeof(ICollection))<br />
                    {<br />
                        return true;<br />
                    }<br />
                }<br />
            }<br />
            return false;<br />
        }</p>
<p>        public object GetValue(object target, string propertyName)<br />
        {<br />
            if (propertyName.IndexOf(PropertyNameSeparator) &gt; -1)<br />
            {<br />
                int index = -1;<br />
                string[] propertyList = propertyName.Split(PropertyNameSeparator);<br />
                for (int i = 0; i = 0)<br />
                    {<br />
                        IList list = (IList) target;<br />
                        if (index &lt; list.Count)<br />
                        {<br />
                            //Get the corresponding item in the list<br />
                            target = list[index];<br />
                        }<br />
                    }<br />
                    if (target == null)<br />
                    {<br />
                        return null;<br />
                    }<br />
                }<br />
                return target;<br />
            }<br />
            else<br />
            {<br />
                return GetValueImpl(target, propertyName);<br />
            }<br />
        }<br />
An example of the usage:</p>
<p>        public class Store<br />
        {<br />
            public Store()<br />
            {<br />
                StringInstruments = new PluckedStrings();<br />
            }<br />
            public PluckedStrings StringInstruments { get; set; }<br />
        }</p>
<p>        public class PluckedStrings<br />
        {<br />
            // Fields<br />
            private List guitars = new List();</p>
<p>            // Properties<br />
            public List Guitars<br />
            {<br />
                get { return this.guitars; }<br />
                set { this.guitars = value; }<br />
            }<br />
        }</p>
<p>        public class Guitar<br />
        {<br />
            public string Brand { get; set; }<br />
        }</p>
<p>And Finally we test it:<br />
            Store mystore = new Store();<br />
            Guitar lucille = new Guitar();<br />
            lucille.Brand = &#8220;Gibson&#8221;;<br />
            mystore.StringInstruments.Guitars.Add(lucille);<br />
            //Get the Brand value for Guitar Item at position 0, or any other index<br />
            object brand = pr.GetValue(mystore, &#8220;StringInstruments.Guitars[0].Brand&#8221;);</p>
<p>I hope this helps and thanks again for the post,<br />
Adolfo</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Getting the svn HEAD revision number from a windows batch file by Damon</title>
		<link>http://blog.guymahieu.com/2008/06/09/getting-the-svn-head-revision-number-from-a-windows-batch-file/#comment-16590</link>
		<dc:creator>Damon</dc:creator>
		<pubDate>Wed, 02 Jun 2010 18:39:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.guymahieu.com/2008/06/09/getting-the-svn-head-revision-number-from-a-windows-batch-file/#comment-16590</guid>
		<description>svnversion</description>
		<content:encoded><![CDATA[<p>svnversion</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Getting the svn HEAD revision number from a windows batch file by Colin</title>
		<link>http://blog.guymahieu.com/2008/06/09/getting-the-svn-head-revision-number-from-a-windows-batch-file/#comment-16530</link>
		<dc:creator>Colin</dc:creator>
		<pubDate>Wed, 26 May 2010 09:27:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.guymahieu.com/2008/06/09/getting-the-svn-head-revision-number-from-a-windows-batch-file/#comment-16530</guid>
		<description>Fantastic just what I needed!
Thanks</description>
		<content:encoded><![CDATA[<p>Fantastic just what I needed!<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on System.Delegate is not a delegate type&#8230; by James (Triynko)</title>
		<link>http://blog.guymahieu.com/2006/11/15/systemdelegate-is-not-a-delegate-type/#comment-15304</link>
		<dc:creator>James (Triynko)</dc:creator>
		<pubDate>Tue, 02 Mar 2010 23:45:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.guymahieu.com/?p=32#comment-15304</guid>
		<description>Wow.  A delegate is not a Delegate.  W.T.G. Microsoft.  This is sooo irritating, because this is probably the most appropriate conceivable use of an anonymous delegate.  You'd think an anonymous method would allow us to keep it as simple as possible by calling control.Invoke( delegate{control.Enabled = true;} ), but behold... you run into the described error.  Why doesn't the setter properties of the control just handle the invoke internally on it's own?  I mean... it's like.. I'm just going to call that anyway, and if I was worried about blocking, I'd check the InvokeRequired property and take unblocking actions anyway.</description>
		<content:encoded><![CDATA[<p>Wow.  A delegate is not a Delegate.  W.T.G. Microsoft.  This is sooo irritating, because this is probably the most appropriate conceivable use of an anonymous delegate.  You&#8217;d think an anonymous method would allow us to keep it as simple as possible by calling control.Invoke( delegate{control.Enabled = true;} ), but behold&#8230; you run into the described error.  Why doesn&#8217;t the setter properties of the control just handle the invoke internally on it&#8217;s own?  I mean&#8230; it&#8217;s like.. I&#8217;m just going to call that anyway, and if I was worried about blocking, I&#8217;d check the InvokeRequired property and take unblocking actions anyway.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Getting the svn HEAD revision number from a windows batch file by Tom</title>
		<link>http://blog.guymahieu.com/2008/06/09/getting-the-svn-head-revision-number-from-a-windows-batch-file/#comment-14798</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Wed, 03 Feb 2010 19:22:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.guymahieu.com/2008/06/09/getting-the-svn-head-revision-number-from-a-windows-batch-file/#comment-14798</guid>
		<description>Great, just what I was just looking for. Thank!
Cheers
Tom</description>
		<content:encoded><![CDATA[<p>Great, just what I was just looking for. Thank!<br />
Cheers<br />
Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Deep reflection of properties: PropertyReflector by Francesco</title>
		<link>http://blog.guymahieu.com/2006/07/11/deep-reflection-of-properties-propertyreflector/#comment-12268</link>
		<dc:creator>Francesco</dc:creator>
		<pubDate>Wed, 21 Oct 2009 09:06:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.guymahieu.com/?p=9#comment-12268</guid>
		<description>Thank you Guy and congratulations for your very clear explanation.</description>
		<content:encoded><![CDATA[<p>Thank you Guy and congratulations for your very clear explanation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on System.Delegate is not a delegate type&#8230; by John</title>
		<link>http://blog.guymahieu.com/2006/11/15/systemdelegate-is-not-a-delegate-type/#comment-11473</link>
		<dc:creator>John</dc:creator>
		<pubDate>Sat, 12 Sep 2009 00:42:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.guymahieu.com/?p=32#comment-11473</guid>
		<description>For what it is worth, this works without any special cast in Silverlight.
I'll bet they will fix this one in a future release.

John</description>
		<content:encoded><![CDATA[<p>For what it is worth, this works without any special cast in Silverlight.<br />
I&#8217;ll bet they will fix this one in a future release.</p>
<p>John</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Getting the svn HEAD revision number from a windows batch file by Bala</title>
		<link>http://blog.guymahieu.com/2008/06/09/getting-the-svn-head-revision-number-from-a-windows-batch-file/#comment-11278</link>
		<dc:creator>Bala</dc:creator>
		<pubDate>Fri, 04 Sep 2009 14:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.guymahieu.com/2008/06/09/getting-the-svn-head-revision-number-from-a-windows-batch-file/#comment-11278</guid>
		<description>Thank you. Very helpful script.

Bala</description>
		<content:encoded><![CDATA[<p>Thank you. Very helpful script.</p>
<p>Bala</p>
]]></content:encoded>
	</item>
</channel>
</rss>
