Exemplo n.º 1
0
        //
        // One time initialization to supply the information needed to initialize the default domain and the  
        // the execution environment.
        //
        // Remarks:
        //   This design intentionally restricts you to one ExecutionEnvironment per side-by-side runtime in a process.
        //   Aside from the dubious value of allowing multiple executionEnvironments, there is no good way to
        //   for this scenario:
        //
        //            typeof(Foo).GetTypeInfo()
        //
        //   to "lookup" a domain in order to map the RuntimeTypeHandle to a specific ExecutionEnvironment.
        //
        public static void InitializeExecutionDomain(ReflectionDomainSetup executionDomainSetup, ExecutionEnvironment executionEnvironment)
        {
            ExecutionDomain executionDomain = new ExecutionDomain(executionDomainSetup, executionEnvironment);
            //@todo: This check has a race window but since this is a private api targeted by the toolchain, perhaps this is not so critical.
            if (_executionDomain != null)
                throw new InvalidOperationException(); // Multiple Initializes not allowed.
            _executionDomain = executionDomain;

            ReflectionCoreCallbacks reflectionCallbacks = new ReflectionCoreCallbacksImplementation();
            ReflectionAugments.Initialize(reflectionCallbacks);
            return;
        }
Exemplo n.º 2
0
        //
        // One time initialization to supply the information needed to initialize the execution environment.
        //
        public static void InitializeExecutionDomain(ReflectionDomainSetup executionDomainSetup, ExecutionEnvironment executionEnvironment)
        {
            ExecutionDomain executionDomain = new ExecutionDomain(executionDomainSetup, executionEnvironment);

            //@todo: This check has a race window but since this is a private api targeted by the toolchain, perhaps this is not so critical.
            if (s_executionDomain != null)
            {
                throw new InvalidOperationException(); // Multiple Initializes not allowed.
            }
            s_executionDomain = executionDomain;

            ReflectionCoreCallbacks reflectionCallbacks = new ReflectionCoreCallbacksImplementation();

            ReflectionAugments.Initialize(reflectionCallbacks);
            return;
        }
Exemplo n.º 3
0
 public Exception CreateMissingConstructedGenericTypeException(Type genericTypeDefinition, Type[] genericTypeArguments)
 {
     return(ReflectionDomainSetup.CreateMissingConstructedGenericTypeException(genericTypeDefinition, genericTypeArguments));
 }
Exemplo n.º 4
0
 public Exception CreateMissingArrayTypeException(Type elementType, bool isMultiDim, int rank)
 {
     return(ReflectionDomainSetup.CreateMissingArrayTypeException(elementType, isMultiDim, rank));
 }
Exemplo n.º 5
0
 internal ExecutionDomain(ReflectionDomainSetup executionDomainSetup, ExecutionEnvironment executionEnvironment)
 {
     ExecutionEnvironment  = executionEnvironment;
     ReflectionDomainSetup = executionDomainSetup;
 }
Exemplo n.º 6
0
 internal ExecutionDomain(ReflectionDomainSetup executionDomainSetup, ExecutionEnvironment executionEnvironment)
     : base(executionDomainSetup, 0)
 {
     this.ExecutionEnvironment = executionEnvironment;
 }
Exemplo n.º 7
0
 internal ExecutionDomain(ReflectionDomainSetup executionDomainSetup, ExecutionEnvironment executionEnvironment)
     : base(executionDomainSetup, 0)
 {
     this.ExecutionEnvironment = executionEnvironment;
 }
Exemplo n.º 8
0
 internal ExecutionDomain(ReflectionDomainSetup executionDomainSetup, ExecutionEnvironment executionEnvironment)
 {
     ExecutionEnvironment = executionEnvironment;
     ReflectionDomainSetup = executionDomainSetup;
 }