<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx</link><description>Admitted, we blew it in the first version of the framework with System.Collections.ICollection , which is next to useless. But we fixed it up pretty well when generics came along in .NET framework 2.0: System.Collections.Generic.ICollection&amp;lt;T&amp;gt; lets</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Community Convergence VII</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#835314</link><pubDate>Tue, 17 Oct 2006 19:51:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:835314</guid><dc:creator>Charlie Calvert's Community Blog</dc:creator><description>&lt;p&gt;The C# team needs your help debugging the new Visual Studio 2005 Service Pack 1 Beta . I've written about&lt;/p&gt;
</description></item><item><title>What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#835327</link><pubDate>Tue, 17 Oct 2006 19:57:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:835327</guid><dc:creator>DotNetKicks.com</dc:creator><description>&lt;p&gt;You've been kicked (a good thing) - Trackback from DotNetKicks.com&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#838521</link><pubDate>Wed, 18 Oct 2006 13:38:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:838521</guid><dc:creator>Wesner Moise</dc:creator><description>&lt;p&gt;&amp;gt;&amp;gt; A collection is a type that implements IEnumerable and has a public Add method.&lt;/p&gt;
&lt;p&gt;Hmmm!&lt;/p&gt;
&lt;p&gt;What if the type derives from ICollection&amp;lt;T&amp;gt; but has a non-public Add method, which is also an explicit interface method.&lt;/p&gt;
&lt;p&gt;In such cases, the type might actually use a differently named Add method or require an explicit interface cast. (Eg, priority queue or stack can have enqueue or push, for example.)&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#838530</link><pubDate>Wed, 18 Oct 2006 13:41:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:838530</guid><dc:creator>Wesner Moise</dc:creator><description>&lt;p&gt;Another advantage to examining the interface method if possible is the ability for non-English developers to construct friendlier native language methods for their objects.&lt;/p&gt;
</description></item><item><title>Community Convergence VIII</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#859900</link><pubDate>Mon, 23 Oct 2006 09:03:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:859900</guid><dc:creator>Charlie Calvert's Community Blog</dc:creator><description>&lt;p&gt;Welcome to the eighth installment of Community Convergence . This week let's focus on two C# Wikis available&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#883373</link><pubDate>Fri, 27 Oct 2006 22:51:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:883373</guid><dc:creator>Omer van Kloeten</dc:creator><description>&lt;p&gt;&amp;gt;&amp;gt; If an entry in the list consists of multiple arguments to an Add method, these are enclosed in { curly braces }.&lt;/p&gt;
&lt;p&gt;To me, curly brackets have always said one of two things in c#: array contents and code blocks.&lt;/p&gt;
&lt;p&gt;So it's a bit confusing to me why you chose curly brackets to indicate parameter tuples being sent to a method, when clearly the logical choice would have been the simple parenthesis:&lt;/p&gt;
&lt;p&gt;Plurals myPlurals = new Plurals { “collection”, ( “query”, “queries” ), new KeyValuePair(“child”, “children”) };&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#915958</link><pubDate>Wed, 01 Nov 2006 01:28:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:915958</guid><dc:creator>madstorgersen</dc:creator><description>&lt;p&gt;Thank you for these comments. A comment related to Wesner's was also given to me offline: since we have syntax for calling with multiple arguments we could have special support not only for ICollection&amp;lt;T&amp;gt; but also for IDictionary&amp;lt;K,T&amp;gt;. It adds to the complexity but may capture some good scenarios. We'll certainly revisit it in the design group.&lt;/p&gt;
&lt;p&gt;As for the curly syntax for multiple arguments, let it be no secret that parentheses and curlies were both strong candidates. Both are also already overloaded. Omer's comment outlines that clearly for curlies; however, parentheses are also already heavily used; for grouping, invoking, casting etc. Curlies have the advantage of not falsely suggesting that we have tuples in the language.&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#916170</link><pubDate>Wed, 01 Nov 2006 02:46:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:916170</guid><dc:creator>Sepilin Uzah</dc:creator><description>&lt;p&gt;Which tools I need to play with LINQ?&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#918371</link><pubDate>Wed, 01 Nov 2006 11:22:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:918371</guid><dc:creator>Tommy Carlier</dc:creator><description>&lt;p&gt;You could make it a lot cleaner by implementing a KeyValuePair operator, that creates a KeyValuePair-instance, like in Smalltalk:&lt;/p&gt;
&lt;p&gt;var pair = key -&amp;gt; value;&lt;/p&gt;
&lt;p&gt;// same as: var pair = new KeyValuePair(key, value);&lt;/p&gt;
&lt;p&gt;Then you can remove the curly braces from your initializer:&lt;/p&gt;
&lt;p&gt;var p = new Plurals { &amp;quot;mouse&amp;quot; -&amp;gt; &amp;quot;mice&amp;quot;, &amp;quot;child&amp;quot; -&amp;gt; &amp;quot;children&amp;quot;, &amp;quot;fish&amp;quot; -&amp;gt; &amp;quot;fish&amp;quot; };&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#918393</link><pubDate>Wed, 01 Nov 2006 11:25:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:918393</guid><dc:creator>Omer van Kloeten</dc:creator><description>&lt;p&gt;&amp;gt;&amp;gt; parentheses are also already heavily used; for grouping, invoking, casting etc.&lt;/p&gt;
&lt;p&gt;You mention invoking and this is exactly the situation here - you're invoking an overload. You can say that the pure mathematical definition of a function dictates that the above pair is a tuple and that the language doesn't have them, but the fact remains that this is a method call and not a type initialization (I'm talking about only the query/queries part) which would make the use of curly brackets inconsistent with the rest of the language (which uses curly brackets for initialization: anonymous types, collection initializers, array initializers, anonymous methods, etc.).&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#932353</link><pubDate>Thu, 02 Nov 2006 18:16:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:932353</guid><dc:creator>Gordon Nanninga</dc:creator><description>&lt;p&gt;When implenting ICollection&amp;lt;T&amp;gt; I have also been adding AddNew(T t). &amp;nbsp;This takes the passed item and makes a new copy to put in the array. &amp;nbsp;It would seem this is preferable for a constuction call as I would assume the braced items could be changed later. &amp;nbsp;If the litorals were added with the normal Add() then the complier should complain when the program attemps to change a read only value.&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#942798</link><pubDate>Fri, 03 Nov 2006 16:51:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:942798</guid><dc:creator>Aaron Erickson</dc:creator><description>&lt;p&gt;Curious, why not just inherit your collection class (or the abstract version of your collection, if so inclined) from List&amp;lt;T&amp;gt; - and get all this IEnumerable related cool stuff for basically free?&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1004816</link><pubDate>Tue, 07 Nov 2006 00:22:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1004816</guid><dc:creator>JD</dc:creator><description>&lt;p&gt;When you identified the 'collections' in your framework that did not implement ICollection&amp;lt;T&amp;gt;... why didn't you fix that?&lt;/p&gt;
&lt;p&gt;Is it because inheriting and implementing ICollection&amp;lt;T&amp;gt; is too costly/breaking?&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1015328</link><pubDate>Tue, 07 Nov 2006 15:20:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1015328</guid><dc:creator>commenter</dc:creator><description>&lt;p&gt;Interesting article.&lt;/p&gt;
&lt;p&gt;[syntax niggle]&lt;/p&gt;
&lt;p&gt;[question w obvious answer]&lt;/p&gt;
&lt;p&gt;Hope this comment proved my cleverness!&lt;/p&gt;
</description></item><item><title>Opinion: Collection Initializers Syntax</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1077567</link><pubDate>Tue, 14 Nov 2006 23:50:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1077567</guid><dc:creator>Omer van Kloeten's .NET Zen</dc:creator><description>&lt;p&gt;Mads Torgersen (have I got it right? you never wrote your full name) wrote last month in his weblogabout&lt;/p&gt;
</description></item><item><title>Opinion: Collection Initializers Syntax</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1077568</link><pubDate>Tue, 14 Nov 2006 23:50:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1077568</guid><dc:creator>עומר.נט</dc:creator><description>&lt;p&gt;Mads Torgersen (have I got it right? you never wrote your full name) wrote last month in his weblog about&lt;/p&gt;
</description></item><item><title>Are you sure?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1084899</link><pubDate>Thu, 16 Nov 2006 06:29:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1084899</guid><dc:creator>David</dc:creator><description>&lt;p&gt;I hate to be negative, but this is a terrible idea. Has Microsoft been looking for community feedback on this?&lt;/p&gt;
&lt;p&gt;I can understand now wanting to limit the application of this feature to ICollection&amp;lt;T&amp;gt;, since that interface requires a Remove method, which may not always be appropriate. But, as has already been mentioned, what if I don't want to use Add as the name of the method to add new items? For example, the Queue&amp;lt;T&amp;gt; class does not implement ICollection&amp;lt;T&amp;gt;, presumably because the Remove method as defined in that interface has no meaning for a queue. And its &amp;quot;Add&amp;quot; method is called Enqueue. But clearly a Queue has the ability to be initialized from a list of items. But since you are only looking for ICollection (and maybe IDictionary), the Queue class will completely miss out on this functionality.&lt;/p&gt;
&lt;p&gt;Also, what if I have an IEnumerable class which implements an Add method for another purpose? Imagine if the string class had methods &amp;quot;string Add(char)&amp;quot; and &amp;quot;string Add(string)&amp;quot;, that functioned like the + operator. Based on that, the compiler would allow syntax like&lt;/p&gt;
&lt;p&gt;new string {&amp;quot;a&amp;quot;, 'b', &amp;quot;cde&amp;quot;}&lt;/p&gt;
&lt;p&gt;But the result would be an empty string. The same would be true for any class which was designed to be immutable but wanted to use an Add method to return combined objects (think something similar to MulticastDelegate). Talk about non-intuitive!&lt;/p&gt;
&lt;p&gt;This article indicates that the reason this approach is necessary is because many collection classes don't implement ICollection&amp;lt;T&amp;gt;. Queue is a good example. It seems to me that the real problem here is that there is an entire set of logical types, such as Queue, to which items can be arbitrarily added but not removed. These types should also be able to participate in this pattern, since there's nothing about the pattern that requires the ability to arbitrarily remove items. However, these types are missing interface representation in the framework, resulting in the need for the approach described in this article. Instead of hacking up some behind-the-scenes signature binding, shouldn't this be fixed? You're already admitted that ICollection was a mistake; can you go a little farther and fix the real hole in this scenario, instead of trying to mask it?&lt;/p&gt;
&lt;p&gt;It seems to me that the core of the problem is that the compiler is attempting to assign semantic meaning to a particular member name. C-style programming has never included this concept; the GetEnumerator example cited in this article is the only other example I can think of (the fact that the author notes that most developers don't even know about this is evidence of how foreign the concept is to most C-style developers). Even the using keyword insists on the IDisposable interface; it doesn't go looking for a Dispose method all on its own. &lt;/p&gt;
&lt;p&gt;This is not simply resistence to change; semantics of member names should remain soley at the discretion of the developer, to determine the best name to use in a particular context (such as Queue.Enqueue). Microsoft should seek community feedback on this issue, and seriously reconsider whether this is the best thing for the future of the C# language.&lt;/p&gt;
&lt;p&gt;As a side note, while I don't feel as strongly about it, I tend to agree with Omer, that parentheses make more sense in context than braces.&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1088447</link><pubDate>Thu, 16 Nov 2006 22:54:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1088447</guid><dc:creator>oli</dc:creator><description>&lt;p&gt;Why not create a new interfaces ICollector&amp;lt;T&amp;gt; and ICollector defining only a Add Method. Existing collection interfaces (including ICollection&amp;lt;T&amp;gt;)and classes (including Queue) implementing some kind of add-functionality could be changed to implement ICollector&amp;lt;T&amp;gt; or ICollector. This would not break existing code.&lt;/p&gt;
&lt;p&gt;What is a collection? The answered could be: It is a class implementing ICollector&amp;lt;T&amp;gt; or ICollector. &lt;/p&gt;
&lt;p&gt;An IPairCollector&amp;lt;T&amp;gt; interface could be used in the same way.&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1108316</link><pubDate>Mon, 20 Nov 2006 14:14:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1108316</guid><dc:creator>Soby Zacharia</dc:creator><description>&lt;p&gt;This Is really nice But Need More Examples&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1110310</link><pubDate>Mon, 20 Nov 2006 21:49:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1110310</guid><dc:creator>Mike Brown</dc:creator><description>&lt;p&gt;Are you sure that GetInterfaceTypes walks up the inheritance tree? Because if it doesn't and I implement IList&amp;lt;T&amp;gt;, then even though IList&amp;lt;T&amp;gt; implements ICollection&amp;lt;T&amp;gt;, my class won't show in that query.&lt;/p&gt;
&lt;p&gt;I can tell you that we EXTENSIVELY use generic collections here.&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1123563</link><pubDate>Wed, 22 Nov 2006 23:06:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1123563</guid><dc:creator>oli</dc:creator><description>&lt;p&gt;Here some examples to my prevoius e-mail:&lt;/p&gt;
&lt;p&gt;namespace Test.Normal {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;// Sample interfaces and classes without special handling of add-functionality&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;interface ICollection&amp;lt;T&amp;gt; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;void Add(T item);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bool Remove(T item);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;class NomalCollection&amp;lt;T&amp;gt; : ICollection&amp;lt;T&amp;gt; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void Add(T item) { }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public bool Remove(T item) { return true; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;class NormalQueue&amp;lt;T&amp;gt; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void Enqueue(T item) { }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public T Dequeue() { return default(T); }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;namespace Test.Enhanced {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;// Sample interfaces and classes with special handling of add-functionality intoducing ICollector&amp;lt;T&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;interface ICollector&amp;lt;T&amp;gt; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;void Add(T item);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;interface ICollection&amp;lt;T&amp;gt; : ICollector&amp;lt;T&amp;gt; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bool Remove(T item);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;class EnhancedCollection&amp;lt;T&amp;gt; : ICollection&amp;lt;T&amp;gt; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void Add(T item) { }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public bool Remove(T item) { return true; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;class EnhancedQueue&amp;lt;T&amp;gt; : ICollector&amp;lt;T&amp;gt; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void Enqueue(T item) { }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public T Dequeue() { return default(T); }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;void ICollector&amp;lt;T&amp;gt;.Add(T item) { Enqueue(item); }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;------------------------------------&lt;/p&gt;
&lt;p&gt;using System;&lt;/p&gt;
&lt;p&gt;namespace Test {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;class Program {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;static bool IsICollector(object o)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ &amp;nbsp; // The test &amp;quot;o is ICollector&amp;lt;&amp;gt;&amp;quot; with empty generic type parameter is not possible.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// This method does it using Reflection.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Type[] interfaces;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Type iCollectorType;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (o == null)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return false; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;interfaces=o.GetType().GetInterfaces();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iCollectorType = typeof(Enhanced.ICollector&amp;lt;&amp;gt;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;foreach (Type t in interfaces){&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (t.IsGenericType &amp;amp;&amp;amp; t.GetGenericTypeDefinition() == iCollectorType)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return true;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return false;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;static void Main(string[] args)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Normal.ICollection&amp;lt;int&amp;gt; normColl1 = new Normal.NomalCollection&amp;lt;int&amp;gt;();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Normal.NomalCollection&amp;lt;int&amp;gt; normColl2 = new Normal.NomalCollection&amp;lt;int&amp;gt;();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Enhanced.ICollection&amp;lt;int&amp;gt; enhColl1 = new Enhanced.EnhancedCollection&amp;lt;int&amp;gt;();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Enhanced.EnhancedCollection&amp;lt;int&amp;gt; enhColl2 = new Enhanced.EnhancedCollection&amp;lt;int&amp;gt;();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;normColl1.Add(1); &amp;nbsp; normColl2.Add(2);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;enhColl1.Add(3); &amp;nbsp; &amp;nbsp;enhColl2.Add(4);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(&amp;quot;normColl1 IS ICollector: {0}&amp;quot;, IsICollector(normColl1)); // ==&amp;gt; false&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(&amp;quot;normColl2 IS ICollector: {0}&amp;quot;, IsICollector(normColl2)); // ==&amp;gt; false&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(&amp;quot;enhColl1 IS ICollector: {0}&amp;quot;, IsICollector(enhColl1)); // ==&amp;gt; true&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(&amp;quot;enhColl2 IS ICollector: {0}&amp;quot;, IsICollector(enhColl2)); // ==&amp;gt; true&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Normal.NormalQueue&amp;lt;int&amp;gt; normQueue = new Normal.NormalQueue&amp;lt;int&amp;gt;();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Enhanced.ICollector&amp;lt;int&amp;gt; enhQueue1 = new Enhanced.EnhancedQueue&amp;lt;int&amp;gt;();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Enhanced.EnhancedQueue&amp;lt;int&amp;gt; enhQueue2 = new Enhanced.EnhancedQueue&amp;lt;int&amp;gt;();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;normQueue.Enqueue(1);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;((Enhanced.EnhancedQueue&amp;lt;int&amp;gt;)enhQueue1).Enqueue(2); &amp;nbsp; enhQueue1.Add(3);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;enhQueue2.Enqueue(4); &amp;nbsp; ((Enhanced.ICollector&amp;lt;int&amp;gt;)enhQueue2).Add(5);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(&amp;quot;normQueue IS ICollector: {0}&amp;quot;, IsICollector(normQueue)); // ==&amp;gt; false&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(&amp;quot;enhQueue1 IS ICollector: {0}&amp;quot;, IsICollector(enhQueue1)); // ==&amp;gt; true&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(&amp;quot;enhQueue2 IS ICollector: {0}&amp;quot;, IsICollector(enhQueue2)); // ==&amp;gt; true&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.ReadLine();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1124519</link><pubDate>Thu, 23 Nov 2006 02:13:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1124519</guid><dc:creator>Andres Cartin</dc:creator><description>&lt;p&gt;How about using attributes for this? Then you could use an [CollectionAddMethod] and [CollectionRemoveMethod] for example instead of looking for an actual implementation of an ICollection...&lt;/p&gt;
</description></item><item><title>Add extension method?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1143684</link><pubDate>Sat, 25 Nov 2006 01:47:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1143684</guid><dc:creator>Colin</dc:creator><description>&lt;p&gt;Would an Add extension method (new feature in C# 3.0) that was in scope also be accepted by the compiler for collection initialization?&lt;/p&gt;
&lt;p&gt;For example (bear with me - I'm new to this stuff), assume there exists a Queue&amp;lt;&amp;gt; class which is IEnumerable&amp;lt;&amp;gt; but not ICollection&amp;lt;&amp;gt; and has an Enqueue method but no Add method. If the following extension method was defined:&lt;/p&gt;
&lt;p&gt;public static void Add&amp;lt;T&amp;gt;(this Queue&amp;lt;T&amp;gt; queue, T item)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp;queue.Enqueue(item);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;would that work? I know in this case it seems an unnecessary method call because Add just wraps Enqueue, but taking it further, it would allow any number of custom Add methods to be added to any collection type and participate in the collection initialization syntax.&lt;/p&gt;
</description></item><item><title>Despre iniţializarea unei colecţii</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1155701</link><pubDate>Mon, 27 Nov 2006 02:39:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1155701</guid><dc:creator>Small place on earth</dc:creator><description>&lt;p&gt;Nu ştiu c&amp;#226;ţi dintre voi au păstrat setarea standard a Visual Studio, şi anume aceea de a-ţi deschide&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1160176</link><pubDate>Mon, 27 Nov 2006 18:50:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1160176</guid><dc:creator>cgh</dc:creator><description>&lt;p&gt;I like Andres Cartin's suggestion for Attributes. Feels more flexible.&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1161970</link><pubDate>Tue, 28 Nov 2006 02:28:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1161970</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;With curly braces...hmmm looks like PERL!&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1165790</link><pubDate>Tue, 28 Nov 2006 17:42:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1165790</guid><dc:creator>Donald Mull</dc:creator><description>&lt;p&gt;About the collection initializer: Couldn't the same thing be accomplished with a constructor like this:&lt;/p&gt;
&lt;p&gt;public Collection(params T[] items)&lt;/p&gt;
&lt;p&gt;and not have to introduce new syntax?&lt;/p&gt;
&lt;p&gt;Collection&amp;lt;String&amp;gt; myStrings = &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;new Collection&amp;lt;String&amp;gt;(&amp;quot;One&amp;quot;, &amp;quot;Two&amp;quot;, &amp;quot;Three&amp;quot;);&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1183281</link><pubDate>Fri, 01 Dec 2006 15:42:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1183281</guid><dc:creator>ramooon</dc:creator><description>&lt;p&gt;Andres Cartin's suggestion is great !&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1188672</link><pubDate>Sat, 02 Dec 2006 04:56:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1188672</guid><dc:creator>Mike</dc:creator><description>&lt;p&gt;It looks like Microsoft has taken a big step backwards with LINQ. The syntax/semantics are counter-intuitive and makes readability a great challenge.&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1199733</link><pubDate>Sun, 03 Dec 2006 18:19:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1199733</guid><dc:creator>Bob Falooley</dc:creator><description>&lt;p&gt;Querying function names for the correct funciton to call is a bad idea. &amp;nbsp;I think you should just fix the collections you have found with this query with one of the suggested methods above. &amp;nbsp;What this artical does do is show the power of LINQ, and how its power can be used with reflection for analysis of source code. &amp;nbsp;I think developers are more interested in this power then saving a few lines of code when initializing a collection.&lt;/p&gt;
&lt;p&gt;--Falooley&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1204331</link><pubDate>Mon, 04 Dec 2006 14:00:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1204331</guid><dc:creator>Topcoder</dc:creator><description>&lt;p&gt;there might be a bit of stupidity in every revolutionary thing but I as a database freak for the last 10-12 years am thinking that LINQ is the worst I've seen from MS. it is refering to object data (fields) as if they are relational data(columns). this comes to confuse the already confused c# developer about everything he is supposed to do with a database. well, their RELATIONAL database. we've got tons of rubbish sql from our web developers anyway and this now will make things even worse!&lt;/p&gt;
</description></item><item><title>Collection Initializers and Duck Typing</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1237101</link><pubDate>Fri, 08 Dec 2006 09:49:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1237101</guid><dc:creator>Technical Articles</dc:creator><description>&lt;p&gt;Recently I came across a blog post by Mads Torgersen , the project manager for the C# language team at&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1516354</link><pubDate>Tue, 23 Jan 2007 22:27:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1516354</guid><dc:creator>madstorgersen</dc:creator><description>&lt;p&gt;Thanks again for all your comments. Many of you suggest that we introduce some mechanism (new interface, attributes, special methods etc) to better mark the fact that something &amp;quot;is a collection&amp;quot; and how it should be initialized with a collection initializer. &lt;/p&gt;
&lt;p&gt;This does not address the problem we set out to solve, which is to make collection initialization possible on a number of existing classes without modification. The only suggestion I've seen that does that is the one about allowing colleciton initializers to make use of Add methods added as extension methods.&lt;/p&gt;
&lt;p&gt;We will look at that, but as it is, we are currently finishing up the last bits of coding for Orcas, and can hardly fit any more changes in. Heck we gotta ship at some point. Luckily this is the kind of limitations that we can lift in the next version if the need is there; we are not designing ourselves out of it.&lt;/p&gt;
</description></item><item><title>Community Convergence XIX</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1518297</link><pubDate>Wed, 24 Jan 2007 03:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1518297</guid><dc:creator>Charlie Calvert's Community Blog</dc:creator><description>&lt;p&gt;Welcome to the nineteenth Community Convergence. I'm Charlie Calvert, the C# Community PM, and this is&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1531379</link><pubDate>Thu, 25 Jan 2007 23:07:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1531379</guid><dc:creator>damien morton</dc:creator><description>&lt;p&gt;Why do you microsft guys go public with your language design issues just as you go into lockdown. Surely it would be more meaningful to engage the community at a point where their input can make a difference.&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#1531935</link><pubDate>Fri, 26 Jan 2007 01:24:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1531935</guid><dc:creator>madstorgersen</dc:creator><description>&lt;p&gt;LINQ and C# 3.0 have been public since PDC in september 2005, with active forums, blogs, website etc. We got a ton of useful input from the community which has made quite a difference. Welcome to the game :-)&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#3448112</link><pubDate>Thu, 21 Jun 2007 23:56:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3448112</guid><dc:creator>Kirill Osenkov</dc:creator><description>&lt;p&gt;Sorry for being late.&lt;/p&gt;
&lt;p&gt;My personal experience has been that ICollection and the like are not fine-granular enough. The interfaces should be more fine-granular. My rule of thumb is: every interface in the system should have at most one member. Works amazingly since 2003.&lt;/p&gt;
&lt;p&gt;Interfaces should more use interface inheritance to provide more flexibility in distilling out certain facets of the functionality.&lt;/p&gt;
&lt;p&gt;I totally agree with Oli that a special interface is needed, with the only Add(T item) method.&lt;/p&gt;
&lt;p&gt;I don't really like the proposal of Andres Cartin about attributes, this should be solved with interfaces - interfaces are there and can handle it well.&lt;/p&gt;
&lt;p&gt;My own little library includes the IFillable&amp;lt;T&amp;gt; interface with the only method Add(T item). The name (Fillable) isn't probably the best, ICollector might be an option, but the idea served me very well all the time. There are a lot of scenarios where the only thing that we want to do with a parameter is to add an item to it. Almost everywhere, where we use yield return to return a number of items, we can use a parameter of type IFillable. The only difference is that it won't be lazy anymore.&lt;/p&gt;
&lt;p&gt;Some examples from my own &amp;quot;base class library&amp;quot;:&lt;/p&gt;
&lt;p&gt;public interface IFillable&amp;lt;T&amp;gt;&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;	void Add(T item);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;public interface ISet&amp;lt;T&amp;gt;&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;	bool Contains(T item);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;public interface IClearable&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;	void Clear();&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;public class ListSet&amp;lt;T&amp;gt; : List&amp;lt;T&amp;gt;,&lt;/p&gt;
&lt;p&gt;	ISet&amp;lt;T&amp;gt;,&lt;/p&gt;
&lt;p&gt;	IFillable&amp;lt;T&amp;gt;,&lt;/p&gt;
&lt;p&gt;	IClearable&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;public class Set&amp;lt;T&amp;gt; : &lt;/p&gt;
&lt;p&gt;	Dictionary&amp;lt;T, Object&amp;gt;, &lt;/p&gt;
&lt;p&gt;	IEnumerable&amp;lt;T&amp;gt;,&lt;/p&gt;
&lt;p&gt;	ISet&amp;lt;T&amp;gt;,&lt;/p&gt;
&lt;p&gt;	IFillable&amp;lt;T&amp;gt;,&lt;/p&gt;
&lt;p&gt;	IClearable&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
</description></item><item><title>An XML Document should be considered a collection...</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#5123650</link><pubDate>Tue, 25 Sep 2007 19:01:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5123650</guid><dc:creator>tourbillon</dc:creator><description>&lt;p&gt;How sad it is that Microsoft doesn't consider an XML document a collection! For example, it is not possible to us a For/Each block to iterate through each element in an XML document using VB or C#. It is possible to do with XSL. &lt;/p&gt;
&lt;p&gt;I've submitted a case (SRZ070705000503) about Microsoft's misconception that everything between the start and end tags of an element is a single element when it is not. That is only true for elements with text content; not xml content (descendants). This case has been escalated for weeks now so I assume that there is some validity to my claim.&lt;/p&gt;
&lt;p&gt;XML would be SO MUCH MORE USEFUL if each element (node) could be dealt with individually without affecting the descendants of the element. A good example would be to delete or move an element leaving the descendants as descendants of the deleted or moved element.&lt;/p&gt;
&lt;p&gt;Consider an XML document with elements that have an attribute called Approved which can be True or False and you want to end up with an XML document that consists only of the elements with Approved=True using an XPath predicate. Currently, this can only be done by converting the XML to a NodeList which loses the hierarchical structure.&lt;/p&gt;
&lt;p&gt;I've recommended that the XMLNode object in the MSXMLDOM get a new property called ExcludeDescendants. That property would be False by default in existing applications that don't have the ExcludeDescendants property so that existing applications would work as they do now. New instances of controls that would be affected such as the XMLDataSource control would have the ability to set that property to True so that individual elements could be manipulated the same way that they can be using XSL.&lt;/p&gt;
&lt;p&gt;If Microsoft were to include an XML document as a collection, that would open up many new potential uses for XML which currently can't be done or require dozens of lines of code to do.&lt;/p&gt;
&lt;p&gt;There are plenty of name/value pair collections, now it's time to provide developers with hierarchical collections!&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;
</description></item><item><title>re: What is a collection?</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#6520486</link><pubDate>Sun, 25 Nov 2007 22:22:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6520486</guid><dc:creator>Chris Sells</dc:creator><description>&lt;p&gt;I couldn't find GetInterfaceTypes, but GetInterfaces seems to do the trick:&lt;/p&gt;
&lt;p&gt;from name in assemblyNames&lt;/p&gt;
&lt;p&gt; &amp;nbsp;select Assembly.LoadWithPartialName(name) into a&lt;/p&gt;
&lt;p&gt; &amp;nbsp;from c in a.GetTypes()&lt;/p&gt;
&lt;p&gt; &amp;nbsp;where c.IsPublic &amp;amp;&amp;amp;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; c.GetConstructors().Any(m =&amp;gt; m.IsPublic) &amp;amp;&amp;amp;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; c.GetInterfaces().Contains(typeof(ICollection&amp;lt;&amp;gt;)) &lt;/p&gt;
&lt;p&gt; &amp;nbsp;select c.FullName&lt;/p&gt;
&lt;p&gt;However, it's interesting that &lt;/p&gt;
&lt;p&gt;typeof(Dictionary&amp;lt;,&amp;gt;.KeyCollection).GetInterfaces().Contains(typeof(ICollection&amp;lt;&amp;gt;))&lt;/p&gt;
&lt;p&gt;returns False, even though KeyCollection implements ICollection&amp;lt;&amp;gt;. Why would that be?&lt;/p&gt;
</description></item><item><title>Collection Initializers</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#7009555</link><pubDate>Sun, 06 Jan 2008 23:19:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7009555</guid><dc:creator>Community Blogs</dc:creator><description>&lt;p&gt;File this in my learn something new every day bucket. I received an email from Steve Maine after he read&lt;/p&gt;
</description></item><item><title>Ultracet.</title><link>http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx#8763049</link><pubDate>Tue, 22 Jul 2008 06:42:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8763049</guid><dc:creator>Ultracet.</dc:creator><description>&lt;p&gt;Ultracet and coumadin. Ultracet.&lt;/p&gt;
</description></item></channel></rss>