using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
-#if NET_2_0
using System.Runtime.InteropServices.ComTypes;
using STATSTG = System.Runtime.InteropServices.ComTypes.STATSTG;
-#else
-using IStream = System.Runtime.InteropServices.UCOMIStream;
-#endif
namespace System.Drawing
{
return -1;
}
}
-}
\ No newline at end of file
+}
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
+using System.Diagnostics;
namespace System.Collections.ObjectModel
{
[ComVisible (false)]
[Serializable]
+ [DebuggerDisplay ("Count={Count}")]
+ [DebuggerTypeProxy (typeof (CollectionDebuggerView<>))]
public class Collection <T> : IList <T>, ICollection <T>, IEnumerable <T>, IList, ICollection, IEnumerable
{
IList <T> list;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
+using System.Diagnostics;
namespace System.Collections.ObjectModel
{
[ComVisible(false)]
[Serializable]
+ [DebuggerDisplay ("Count={Count}")]
+ [DebuggerTypeProxy (typeof (CollectionDebuggerView<,>))]
public abstract class KeyedCollection<TKey, TItem> : Collection<TItem>
{
private Dictionary<TKey, TItem> dictionary;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
+using System.Diagnostics;
namespace System.Collections.ObjectModel
{
[ComVisible (false)]
[Serializable]
+ [DebuggerDisplay ("Count={Count}")]
+ [DebuggerTypeProxy (typeof (CollectionDebuggerView<>))]
public class ReadOnlyCollection <T> : IList <T>, ICollection <T>, IEnumerable <T>, IList, ICollection, IEnumerable
{
IList <T> list;
return new NotSupportedException ("The invoked member is not supported in a dynamic module.");
}
- public override MethodInfo MakeGenericMethod (params Type [] methodInstantiation)
+ public override MethodInfo MakeGenericMethod (params Type [] typeArguments)
{
if (!IsGenericMethodDefinition)
throw new InvalidOperationException ("Method is not a generic method definition");
- if (methodInstantiation == null)
- throw new ArgumentNullException ("methodInstantiation");
- if (generic_params.Length != methodInstantiation.Length)
- throw new ArgumentException ("Incorrect length", "methodInstantiation");
- foreach (Type type in methodInstantiation) {
+ if (typeArguments == null)
+ throw new ArgumentNullException ("typeArguments");
+ if (generic_params.Length != typeArguments.Length)
+ throw new ArgumentException ("Incorrect length", "typeArguments");
+ foreach (Type type in typeArguments) {
if (type == null)
- throw new ArgumentNullException ("methodInstantiation");
+ throw new ArgumentNullException ("typeArguments");
}
- return new MethodOnTypeBuilderInst (this, methodInstantiation);
+ return new MethodOnTypeBuilderInst (this, typeArguments);
}
public override bool IsGenericMethodDefinition {
public struct CustomAttributeNamedArgument {
CustomAttributeTypedArgument typedArgument;
MemberInfo memberInfo;
-
- internal CustomAttributeNamedArgument (MemberInfo memberInfo, object typedArgument)
+
+#if NET_4_0
+ public
+#endif
+ CustomAttributeNamedArgument (MemberInfo memberInfo, object value)
+ {
+ this.memberInfo = memberInfo;
+ this.typedArgument = (CustomAttributeTypedArgument) value;
+ }
+
+#if NET_4_0
+ public CustomAttributeNamedArgument (MemberInfo memberInfo, CustomAttributeTypedArgument typedArgument)
{
this.memberInfo = memberInfo;
- this.typedArgument = (CustomAttributeTypedArgument) typedArgument;
+ this.typedArgument = typedArgument;
}
+#endif
public MemberInfo MemberInfo {
get {
Type argumentType;
object value;
- internal CustomAttributeTypedArgument (Type argumentType, object value)
+#if NET_4_0
+ public
+#endif
+ CustomAttributeTypedArgument (Type argumentType, object value)
{
+ if (argumentType == null)
+ throw new ArgumentNullException ("argumentType");
+
this.argumentType = argumentType;
this.value = value;
this.value = new ReadOnlyCollection <CustomAttributeTypedArgument> (new_value);
}
}
+
+#if NET_4_0
+ public CustomAttributeTypedArgument (object value)
+ {
+ if (value == null)
+ throw new ArgumentNullException ("value");
+
+ this.argumentType = value.GetType ();
+ this.value = value;
+ }
+#endif
public Type ArgumentType {
get {
}
#if NET_4_0
- public override bool Equals (object obj)
+ public override bool Equals (object o)
{
- return obj == (object) this;
+ return o == (object) this;
}
public override int GetHashCode ()
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
- public static extern void RunModuleConstructor (IntPtr module);
+ static extern void RunModuleConstructor (IntPtr module);
}
}
{
string reason;
- public TargetedPatchingOptOutAttribute () : this ("") {
- }
-
public TargetedPatchingOptOutAttribute (string reason)
{
if (reason == null)
this.reason = reason;
}
- public string Reason
- {
+ public string Reason {
get {
return reason;
}
return Current;
}
}
+
+#if NET_4_0
+ public void Dispose ()
+#else
+ void IDisposable.Dispose ()
+#endif
+ {
+ // nop
+ }
// Methods
public object Clone ()
{
index = -1;
}
-
- void IDisposable.Dispose ()
- {
- // nop
- }
}
}
// memory usage from 16 to 8 bytes, see bug: 592221. This also fixes the
// 622127 issue and simplifies the code in reflection.c to encode DateTimes
//
- public long encoded;
+ long encoded;
const long TicksMask = 0x3fffffffffffffff;
const long KindMask = unchecked ((long) 0xc000000000000000);
const int KindShift = 62;
return new DateTimeOffset (dt.AddHours (hours).Ticks, utc_offset);
}
- public static DateTimeOffset operator + (DateTimeOffset dateTimeTz, TimeSpan timeSpan)
+ public static DateTimeOffset operator + (DateTimeOffset dateTimeOffset, TimeSpan timeSpan)
{
- return dateTimeTz.Add (timeSpan);
+ return dateTimeOffset.Add (timeSpan);
}
public DateTimeOffset AddMilliseconds (double milliseconds)
return left.Subtract (right);
}
- public static DateTimeOffset operator - (DateTimeOffset dateTimeTz, TimeSpan timeSpan)
+ public static DateTimeOffset operator - (DateTimeOffset dateTimeOffset, TimeSpan timeSpan)
{
- return dateTimeTz.Subtract (timeSpan);
+ return dateTimeOffset.Subtract (timeSpan);
}
public long ToFileTime ()
}
#if NET_4_0
- public static bool operator==(double a, double b)
+ public static bool operator==(double left, double right)
{
- return a == b;
+ return left == right;
}
- public static bool operator!=(double a, double b)
+ public static bool operator!=(double left, double right)
{
- return a != b;
+ return left != right;
}
- public static bool operator>(double a, double b)
+ public static bool operator>(double left, double right)
{
- return a > b;
+ return left > right;
}
- public static bool operator>=(double a, double b)
+ public static bool operator>=(double left, double right)
{
- return a >= b;
+ return left >= right;
}
- public static bool operator<(double a, double b)
+ public static bool operator<(double left, double right)
{
- return a < b;
+ return left < right;
}
- public static bool operator<=(double a, double b)
+ public static bool operator<=(double left, double right)
{
- return a <= b;
+ return left <= right;
}
#endif
public interface IObserver<in T>
{
void OnCompleted ();
- void OnError (Exception exception);
- void OnNext(T arg);
+ void OnError (Exception error);
+ void OnNext(T value);
}
}
#if NET_2_1
[ComVisible (false)]
#endif
- public static int Compare<T> (T? value1, T? value2) where T: struct
+ public static int Compare<T> (T? n1, T? n2) where T: struct
{
- if (value1.has_value) {
- if (!value2.has_value)
+ if (n1.has_value) {
+ if (!n2.has_value)
return 1;
- return Comparer<T>.Default.Compare (value1.value, value2.value);
+ return Comparer<T>.Default.Compare (n1.value, n2.value);
}
- return value2.has_value ? -1 : 0;
+ return n2.has_value ? -1 : 0;
}
#if NET_2_1
[ComVisible (false)]
#endif
- public static bool Equals<T> (T? value1, T? value2) where T: struct
+ public static bool Equals<T> (T? n1, T? n2) where T: struct
{
- if (value1.has_value != value2.has_value)
+ if (n1.has_value != n2.has_value)
return false;
- if (!value1.has_value)
+ if (!n1.has_value)
return true;
- return EqualityComparer<T>.Default.Equals (value1.value, value2.value);
+ return EqualityComparer<T>.Default.Equals (n1.value, n2.value);
}
public static Type GetUnderlyingType (Type nullableType)
}
#if NET_4_0
- public static bool operator==(float a, float b)
+ public static bool operator==(float left, float right)
{
- return a == b;
+ return left == right;
}
- public static bool operator!=(float a, float b)
+ public static bool operator!=(float left, float right)
{
- return a != b;
+ return left != right;
}
- public static bool operator>(float a, float b)
+ public static bool operator>(float left, float right)
{
- return a > b;
+ return left > right;
}
- public static bool operator>=(float a, float b)
+ public static bool operator>=(float left, float right)
{
- return a >= b;
+ return left >= right;
}
- public static bool operator<(float a, float b)
+ public static bool operator<(float left, float right)
{
- return a < b;
+ return left < right;
}
- public static bool operator<=(float a, float b)
+ public static bool operator<=(float left, float right)
{
- return a <= b;
+ return left <= right;
}
#endif
return InternalIsInterned (str);
}
- public static string Join (string separator, string [] value)
+ public static string Join (string separator, params string [] value)
{
if (value == null)
throw new ArgumentNullException ("value");
}
#if NET_4_0 || MOONLIGHT
- public static TimeSpan Parse (string s, IFormatProvider formatProvider)
+ public static TimeSpan Parse (string input, IFormatProvider formatProvider)
{
- if (s == null)
- throw new ArgumentNullException ("s");
+ if (input == null)
+ throw new ArgumentNullException ("input");
TimeSpan result;
- Parser p = new Parser (s, formatProvider);
+ Parser p = new Parser (input, formatProvider);
p.Execute (false, out result);
return result;
}
- public static bool TryParse (string s, IFormatProvider formatProvider, out TimeSpan result)
+ public static bool TryParse (string input, IFormatProvider formatProvider, out TimeSpan result)
{
- if (s == null || s.Length == 0) {
+ if (string.IsNullOrEmpty (input)) {
result = TimeSpan.Zero;
return false;
}
- Parser p = new Parser (s, formatProvider);
+ Parser p = new Parser (input, formatProvider);
return p.Execute (true, out result);
}