private static void Initialize() { Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); Type[] types = AssemblyLoader.LoadFrom(Managed.ManagedCallbacksDll).GetTypes(); Type type1 = (Type)null; foreach (Type type2 in types) { if (((IEnumerable <Type>)type2.GetInterfaces()).Contains <Type>(typeof(ICallbackManager))) { type1 = type2; break; } } Managed._callbackManager = type1.GetConstructor(new Type[0]).Invoke(new object[0]) as ICallbackManager; Managed._callbackManager.Initialize(); Delegate[] delegates = Managed._callbackManager.GetDelegates(); for (int index = 0; index < delegates.Length; ++index) { try { Managed.PassManagedEngineCallbackMethodPointers(delegates[index]); } catch (Exception ex) { Managed.PassManagedEngineCallbackMethodPointers((Delegate)null); // ISSUE: variable of a boxed type __Boxed <int> local = (ValueType)index; Console.WriteLine(ex.ToString() + " " + (object)local); } } LibraryApplicationInterface.SetObjects(Managed._callbackManager.GetScriptingInterfaceObjects()); }
internal static void SetObjects(Dictionary <string, object> objects) { LibraryApplicationInterface._objects = objects; LibraryApplicationInterface.IManaged = LibraryApplicationInterface.GetObject <IManaged>(); LibraryApplicationInterface.ITelemetry = LibraryApplicationInterface.GetObject <ITelemetry>(); LibraryApplicationInterface.ILibrarySizeChecker = LibraryApplicationInterface.GetObject <ILibrarySizeChecker>(); LibraryApplicationInterface.INativeArray = LibraryApplicationInterface.GetObject <INativeArray>(); LibraryApplicationInterface.INativeObjectArray = LibraryApplicationInterface.GetObject <INativeObjectArray>(); }