mscorlib(4.0.0.0) API with additions
ConstructorInfo.cs
1 using System.Diagnostics;
5 
6 namespace System.Reflection
7 {
10  [ClassInterface(ClassInterfaceType.None)]
11  [ComDefaultInterface(typeof(_ConstructorInfo))]
12  [ComVisible(true)]
13  [__DynamicallyInvokable]
14  [PermissionSet(SecurityAction.InheritanceDemand, Name = "FullTrust")]
15  public abstract class ConstructorInfo : MethodBase, _ConstructorInfo
16  {
18  [ComVisible(true)]
19  [__DynamicallyInvokable]
20  public static readonly string ConstructorName = ".ctor";
21 
23  [ComVisible(true)]
24  [__DynamicallyInvokable]
25  public static readonly string TypeConstructorName = ".cctor";
26 
29  [ComVisible(true)]
30  public override MemberTypes MemberType
31  {
32  get
33  {
34  return MemberTypes.Constructor;
35  }
36  }
37 
43  [__DynamicallyInvokable]
44  public static bool operator ==(ConstructorInfo left, ConstructorInfo right)
45  {
46  if ((object)left == right)
47  {
48  return true;
49  }
50  if ((object)left == null || (object)right == null || left is RuntimeConstructorInfo || right is RuntimeConstructorInfo)
51  {
52  return false;
53  }
54  return left.Equals(right);
55  }
56 
62  [__DynamicallyInvokable]
63  public static bool operator !=(ConstructorInfo left, ConstructorInfo right)
64  {
65  return !(left == right);
66  }
67 
72  [__DynamicallyInvokable]
73  public override bool Equals(object obj)
74  {
75  return base.Equals(obj);
76  }
77 
80  [__DynamicallyInvokable]
81  public override int GetHashCode()
82  {
83  return base.GetHashCode();
84  }
85 
86  internal virtual Type GetReturnType()
87  {
88  throw new NotImplementedException();
89  }
90 
104  public abstract object Invoke(BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture);
105 
117  [DebuggerStepThrough]
118  [DebuggerHidden]
119  [__DynamicallyInvokable]
120  public object Invoke(object[] parameters)
121  {
122  return Invoke(BindingFlags.Default, null, parameters, null);
123  }
124 
128  {
129  return GetType();
130  }
131 
139  object _ConstructorInfo.Invoke_2(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
140  {
141  return Invoke(obj, invokeAttr, binder, parameters, culture);
142  }
143 
148  object _ConstructorInfo.Invoke_3(object obj, object[] parameters)
149  {
150  return Invoke(obj, parameters);
151  }
152 
159  object _ConstructorInfo.Invoke_4(BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
160  {
161  return Invoke(invokeAttr, binder, parameters, culture);
162  }
163 
167  object _ConstructorInfo.Invoke_5(object[] parameters)
168  {
169  return Invoke(parameters);
170  }
171 
175  void _ConstructorInfo.GetTypeInfoCount(out uint pcTInfo)
176  {
177  throw new NotImplementedException();
178  }
179 
185  void _ConstructorInfo.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
186  {
187  throw new NotImplementedException();
188  }
189 
197  void _ConstructorInfo.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
198  {
199  throw new NotImplementedException();
200  }
201 
212  void _ConstructorInfo.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
213  {
214  throw new NotImplementedException();
215  }
216  }
217 }
object Invoke_5(object[] parameters)
Provides COM objects with version-independent access to the M:System.Reflection.ConstructorInfo....
static readonly string TypeConstructorName
Represents the name of the type constructor method as it is stored in metadata. This name is always "...
Discovers the attributes of a class constructor and provides access to constructor metadata.
object Invoke_4(BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
Provides COM objects with version-independent access to the M:System.Reflection.ConstructorInfo....
static bool operator==(ConstructorInfo left, ConstructorInfo right)
Indicates whether two T:System.Reflection.ConstructorInfo objects are equal.
BindingFlags
Specifies flags that control binding and the way in which the search for members and types is conduct...
Definition: BindingFlags.cs:10
Definition: __Canon.cs:3
static readonly string ConstructorName
Represents the name of the class constructor method as it is stored in metadata. This name is always ...
override int GetHashCode()
Returns the hash code for this instance.
override MemberTypes MemberType
Gets a T:System.Reflection.MemberTypes value indicating that this member is a constructor.
override bool Equals(object obj)
Returns a value that indicates whether this instance is equal to a specified object.
SecurityAction
Specifies the security actions that can be performed using declarative security.
new Type GetType()
Provides COM objects with version-independent access to the M:System.Object.GetType method.
void GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
Maps a set of names to a corresponding set of dispatch identifiers.
Represents type declarations: class types, interface types, array types, value types,...
Definition: Type.cs:18
Provides information about methods and constructors.
Definition: MethodBase.cs:19
object Invoke_2(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
Provides COM objects with version-independent access to the M:System.Reflection.MethodBase....
object Invoke_3(object obj, object[] parameters)
Provides COM objects with version-independent access to the M:System.Reflection.MethodBase....
Exposes the public members of the T:System.Reflection.ConstructorInfo class to unmanaged code.
abstract object Invoke(BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
When implemented in a derived class, invokes the constructor reflected by this ConstructorInfo with t...
void GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
Retrieves the type information for an object, which can then be used to get the type information for ...
void GetTypeInfoCount(out uint pcTInfo)
Retrieves the number of type information interfaces that an object provides (either 0 or 1).
static bool operator !=(ConstructorInfo left, ConstructorInfo right)
Indicates whether two T:System.Reflection.ConstructorInfo objects are not equal.
Specifies that the class can be serialized.
ClassInterfaceType
Identifies the type of class interface that is generated for a class.
Specifies that the parameter is an input parameter.
Provides information about a specific culture (called a locale for unmanaged code development)....
Definition: CultureInfo.cs:16
object Invoke(object[] parameters)
Invokes the constructor reflected by the instance that has the specified parameters,...
MemberTypes
Marks each type of member that is defined as a derived class of T:System.Reflection....
Definition: MemberTypes.cs:9
The exception that is thrown when a requested method or operation is not implemented.
void Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
Provides access to properties and methods exposed by an object.