internal Addin(Dictionary <Guid, Addin> guid2Addins, RuntimeSystem runtimeSystem, AddinIndexRecord addinIndex) { var addinFileSystem = new AddinFileSystem(guid2Addins, addinIndex); _adnContext = new AddinContext(runtimeSystem, addinFileSystem); }
/// <summary> /// Terminate RealDWG RuntimeSystem. set the global instance of the app services object as null. /// </summary> public static void Terminate() { // Note: Though HostApplicationServices is an IDisposable, it seems that actually calling Dispose on it (or allowing it to be GC'd) // conflicts with the call to RuntimeSystem.Terminate. If you do both things, in either order, bad exceptions result. RuntimeSystem.Terminate(); HostApplicationServices.Current = null; }
/// <summary> /// Creates a new launcher method. /// </summary> /// <param name="runtimeSystem">The current runtime system.</param> /// <param name="instanceType">The instance type (if any).</param> /// <param name="methodEmitter">The method emitter.</param> /// <returns>The acquired scoped lock.</returns> internal RuntimeSystem.ScopedLock CreateLauncherMethod( RuntimeSystem runtimeSystem, Type instanceType, out RuntimeSystem.MethodEmitter methodEmitter) { var parameterTypes = new Type[ Parameters.Count + Kernel.KernelParameterOffset]; // Launcher(Kernel, AcceleratorStream, [Index], ...) parameterTypes[Kernel.KernelInstanceParamIdx] = instanceType ?? typeof(Kernel); parameterTypes[Kernel.KernelStreamParamIdx] = typeof(AcceleratorStream); parameterTypes[Kernel.KernelParamDimensionIdx] = IndexType.GetManagedIndexType(); Parameters.CopyTo(parameterTypes, Kernel.KernelParameterOffset); var writeScope = runtimeSystem.DefineRuntimeMethod( typeof(void), parameterTypes, out methodEmitter); // TODO: we have to port the following snippet to .Net Core // in order to support "in" parameters //if (Parameters.IsByRef(i)) //{ // var paramIndex = Kernel.KernelParameterOffset + i; // result.MethodBuilder.DefineParameter( // paramIndex, // ParameterAttributes.In, // null); //} return(writeScope); }
public SystemGroup(World world, string name) { this.name = name; this.world = world; this.worldIndex = -1; this.runtimeSystem = new RuntimeSystem(); this.worldIndex = world.AddSystemGroup(ref this); }
public AddinEngine(AddinConfiguration addinConfig) { _adnConfig = addinConfig; _guid2Addins = new Dictionary <Guid, Addin>(); _asmResolver = new RuntimeAssemblyResolver(); _runtimeSystem = new RuntimeSystem(_asmResolver); _exSystemLoader = new ExtensionSystemLoader(_asmResolver); }
public static RuntimeSystem GetRuntimeSystem() { if (_RuntimeSystem == RuntimeSystem.Unknown) { int i = (int) Environment.OSVersion.Platform; switch (i) { case 4 : case 128 : _RuntimeSystem = RuntimeSystem.Unix; break; case 6 : _RuntimeSystem = RuntimeSystem.MacOSX; break; default : _RuntimeSystem = RuntimeSystem.Windows; break; } } return _RuntimeSystem; }
public static RuntimeSystem GetRuntimeSystem() { if (_RuntimeSystem == RuntimeSystem.Unknown) { int i = (int)Environment.OSVersion.Platform; switch (i) { case 4: case 128: _RuntimeSystem = RuntimeSystem.Unix; break; case 6: _RuntimeSystem = RuntimeSystem.MacOSX; break; default: _RuntimeSystem = RuntimeSystem.Windows; break; } } return(_RuntimeSystem); }
/// <summary> /// Initialize RealDWG. Static call will force call of static constructor and then /// set the global instance of the app services object as "Current". /// </summary> public static void Initialize() { // This has side effect of setting HostApplicationServices.Current to Global RuntimeSystem.Initialize(new ApplicationServices(), CultureInfo.CurrentUICulture.LCID); }
public MyHost() { RuntimeSystem.Initialize(this, 1033); }
public AppService() { RuntimeSystem.Initialize(this, 1033); }