Sfoglia il codice sorgente

clean this mess once in for all

svn path=/trunk/mcs/; revision=102300
Jb Evain 17 anni fa
parent
commit
fedf99df53

+ 1 - 1
mcs/class/System.Core/System.Linq/Grouping.cs

@@ -26,7 +26,7 @@ using System.Collections.Generic;
 
 namespace System.Linq
 {
-	public class Grouping<K, T> : IGrouping<K, T>
+	class Grouping<K, T> : IGrouping<K, T>
 	{
 		K key;
 		IEnumerable<T> group;

+ 7 - 9
mcs/class/System.Core/System.Linq/IGrouping.cs

@@ -5,10 +5,10 @@
 // distribute, sublicense, and/or sell copies of the Software, and to
 // permit persons to whom the Software is furnished to do so, subject to
 // the following conditions:
-// 
+//
 // The above copyright notice and this permission notice shall be
 // included in all copies or substantial portions of the Software.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -20,13 +20,11 @@
 //        Alejandro Serrano "Serras" ([email protected])
 //
 
-using System;
 using System.Collections.Generic;
 
-namespace System.Linq
-{
-        public interface IGrouping<TKey, TElement> : IEnumerable<TElement>
-        {
-                TKey Key { get; }
-        }
+namespace System.Linq {
+
+	public interface IGrouping<TKey, TElement> : IEnumerable<TElement> {
+		TKey Key { get; }
+	}
 }

+ 6 - 5
mcs/class/System.Core/System.Linq/ILookup_T.cs

@@ -28,12 +28,13 @@
 
 using System.Collections.Generic;
 
-namespace System.Linq
-{
-	public interface ILookup<TKey, TElement>: IEnumerable<IGrouping <TKey, TElement>>
-	{
-		bool Contains (TKey key);
+namespace System.Linq {
+
+	public interface ILookup<TKey, TElement>: IEnumerable<IGrouping <TKey, TElement>> {
+
 		int Count { get; }
 		IEnumerable<TElement> this [TKey key] { get; }
+
+		bool Contains (TKey key);
 	}
 }

+ 3 - 5
mcs/class/System.Core/System.Linq/IOrderedEnumerable_T.cs

@@ -27,12 +27,10 @@
 //
 
 using System.Collections.Generic;
-using System.Linq.Expressions;
 
-namespace System.Linq
-{
-	public interface IOrderedEnumerable<TElement> : IEnumerable<TElement>
-	{
+namespace System.Linq {
+
+	public interface IOrderedEnumerable<TElement> : IEnumerable<TElement> {
 		IOrderedEnumerable<TElement> CreateOrderedEnumerable<TKey> (Func<TElement, TKey> selector, IComparer<TKey> comparer, bool descending);
 	}
 }

+ 7 - 7
mcs/class/System.Core/System.Linq/IOrderedQueryable.cs

@@ -5,10 +5,10 @@
 // distribute, sublicense, and/or sell copies of the Software, and to
 // permit persons to whom the Software is furnished to do so, subject to
 // the following conditions:
-// 
+//
 // The above copyright notice and this permission notice shall be
 // included in all copies or substantial portions of the Software.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -23,9 +23,9 @@
 using System;
 using System.Collections;
 
-namespace System.Linq
-{
-        public interface IOrderedQueryable : IEnumerable, IQueryable
-        {
-        }
+namespace System.Linq {
+
+	public interface IOrderedQueryable : IEnumerable, IQueryable
+	{
+	}
 }

+ 7 - 7
mcs/class/System.Core/System.Linq/IOrderedQueryable_T.cs

@@ -5,10 +5,10 @@
 // distribute, sublicense, and/or sell copies of the Software, and to
 // permit persons to whom the Software is furnished to do so, subject to
 // the following conditions:
-// 
+//
 // The above copyright notice and this permission notice shall be
 // included in all copies or substantial portions of the Software.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -23,9 +23,9 @@
 using System;
 using System.Collections.Generic;
 
-namespace System.Linq
-{
-        public interface IOrderedQueryable<T> : IOrderedQueryable, IEnumerable<T>, IQueryable<T>
-        {
-        }
+namespace System.Linq {
+
+	public interface IOrderedQueryable<T> : IOrderedQueryable, IEnumerable<T>, IQueryable<T>
+	{
+	}
 }

+ 9 - 10
mcs/class/System.Core/System.Linq/IQueryable.cs

@@ -5,10 +5,10 @@
 // distribute, sublicense, and/or sell copies of the Software, and to
 // permit persons to whom the Software is furnished to do so, subject to
 // the following conditions:
-// 
+//
 // The above copyright notice and this permission notice shall be
 // included in all copies or substantial portions of the Software.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -25,12 +25,11 @@ using System;
 using System.Collections;
 using System.Linq.Expressions;
 
-namespace System.Linq
-{
-        public interface IQueryable : IEnumerable
-        {
-                Type ElementType { get; }
-                Expression Expression { get; }
-                IQueryProvider Provider { get; }
-        }
+namespace System.Linq {
+
+	public interface IQueryable : IEnumerable {
+		Type ElementType { get; }
+		Expression Expression { get; }
+		IQueryProvider Provider { get; }
+	}
 }

+ 7 - 7
mcs/class/System.Core/System.Linq/IQueryable_T.cs

@@ -5,10 +5,10 @@
 // distribute, sublicense, and/or sell copies of the Software, and to
 // permit persons to whom the Software is furnished to do so, subject to
 // the following conditions:
-// 
+//
 // The above copyright notice and this permission notice shall be
 // included in all copies or substantial portions of the Software.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -24,9 +24,9 @@
 using System;
 using System.Collections.Generic;
 
-namespace System.Linq
-{
-        public interface IQueryable<T> : IQueryable, IEnumerable<T>
-        {
-        }
+namespace System.Linq {
+
+	public interface IQueryable<T> : IQueryable, IEnumerable<T>
+	{
+	}
 }

+ 43 - 42
mcs/class/System.Core/System.Linq/Lookup.cs

@@ -32,46 +32,47 @@ using System;
 using System.Collections;
 using System.Collections.Generic;
 
-namespace System.Linq
-{
-        public class Lookup<TKey, TElement> : IEnumerable<IGrouping<TKey, TElement>>, ILookup<TKey, TElement>
-        {
-                Dictionary<TKey, IGrouping<TKey, TElement>> groups;
-                
-                internal Lookup (Dictionary<TKey, List<TElement>> groups)
-                {
-                        this.groups = new Dictionary<TKey, IGrouping<TKey, TElement>> ();
-                        foreach (KeyValuePair<TKey, List<TElement>> group in groups)
-                                this.groups.Add (group.Key, new Grouping<TKey, TElement>(group.Key, group.Value));
-                }
-                
-                public IEnumerable<TResult> ApplyResultSelector<TResult>(Func<TKey, IEnumerable <TElement>, TResult> selector)
-                {
-                	throw new NotImplementedException ();
-                }
-                
-                public int Count {
-                        get { return groups.Count; }
-                }
-                
-                public bool Contains (TKey key)
-                {
-                        return groups.ContainsKey (key);
-                }
-                
-                public IEnumerable<TElement> this [TKey key]
-                {
-                        get { return groups[key]; }
-                }
-                
-                public IEnumerator<IGrouping<TKey, TElement>> GetEnumerator ()
-                {
-                        return groups.Values.GetEnumerator ();
-                }
-                
-                IEnumerator IEnumerable.GetEnumerator ()
-                {
-                        return groups.Values.GetEnumerator ();
-                }
-        }
+namespace System.Linq {
+
+	class Lookup<TKey, TElement> : IEnumerable<IGrouping<TKey, TElement>>, ILookup<TKey, TElement> {
+
+		Dictionary<TKey, IGrouping<TKey, TElement>> groups;
+
+		internal Lookup (Dictionary<TKey, List<TElement>> groups)
+		{
+			this.groups = new Dictionary<TKey, IGrouping<TKey, TElement>> ();
+			foreach (KeyValuePair<TKey, List<TElement>> group in groups)
+				this.groups.Add (group.Key, new Grouping<TKey, TElement> (group.Key, group.Value));
+		}
+
+		public IEnumerable<TResult> ApplyResultSelector<TResult> (Func<TKey, IEnumerable<TElement>, TResult> selector)
+		{
+			throw new NotImplementedException ();
+		}
+
+		public int Count
+		{
+			get { return groups.Count; }
+		}
+
+		public bool Contains (TKey key)
+		{
+			return groups.ContainsKey (key);
+		}
+
+		public IEnumerable<TElement> this [TKey key]
+		{
+			get { return groups [key]; }
+		}
+
+		public IEnumerator<IGrouping<TKey, TElement>> GetEnumerator ()
+		{
+			return groups.Values.GetEnumerator ();
+		}
+
+		IEnumerator IEnumerable.GetEnumerator ()
+		{
+			return groups.Values.GetEnumerator ();
+		}
+	}
 }

+ 2 - 4
mcs/class/System.Core/System.Linq/Queryable.cs

@@ -35,11 +35,9 @@ using System.Linq.Expressions;
 using System.Reflection;
 using System.Linq;
 
-namespace System.Linq
-{
+namespace System.Linq {
 
-	public static class Queryable
-	{
+	public static class Queryable {
 
 		static MethodInfo MakeGeneric (MethodBase method, params Type [] parameters)
 		{