System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor C# (CSharp) 메소드

RunClassConstructor() 개인적인 메소드

private RunClassConstructor ( Type type ) : void
type Type
리턴 void
        public static extern void RunClassConstructor(Type type);
    }

Usage Example

예제 #1
0
 /// <summary>Runs a specified class constructor method.</summary>
 /// <param name="type">A <see cref="T:System.RuntimeTypeHandle" /> specifying the class constructor method to run. </param>
 /// <exception cref="T:System.TypeInitializationException">The class initializer threw an exception. </exception>
 public static void RunClassConstructor(RuntimeTypeHandle type)
 {
     if (type.Value == IntPtr.Zero)
     {
         throw new ArgumentException("Handle is not initialized.", "type");
     }
     RuntimeHelpers.RunClassConstructor(type.Value);
 }