コード例 #1
0
        public override void CreateGenerics()
        {
            Generics.Clear();
            GenericCallTypes.Clear();

            foreach (TypeSig t in AssociatedTypes)
            {
                if (!Generics.ContainsKey(t.ScopeType.MDToken.Raw))
                {
                    Generics.Add(t.ScopeType.MDToken.Raw,
                                 new GenericParamUser(
                                     (ushort)(TargetType.GenericParameters.Count + Generics.Count()),
                                     GenericParamAttributes.NoSpecialConstraint, GenericParamName)); //gen name
                    GenericCallTypes.Add(t);
                }
            }
        }
コード例 #2
0
        public void Dispose()
        {
            if (Generics != null)
            {
                foreach (KeyValuePair <string, HIDDevice> entry in Generics)
                {
                    entry.Value.Dispose();
                }


                Generics.Clear();
            }

            Debug.Log("Try to remove Drivers");
            if (__drivers != null)
            {
                __drivers.Clear();
            }
        }
コード例 #3
0
        void IDisposable.Dispose()
        {
            if (hidmanager != IntPtr.Zero)
            {
                //throw exception don't know why
//				if(RunLoop!=IntPtr.Zero && InputLoopMode!=IntPtr.Zero)
//				Native.IOHIDDeviceUnscheduleWithRunLoop(hidmanager,
//				                                        RunLoop, InputLoopMode);


                Debug.Log("Try to remove OSXHIDInterface registers");

                Native.IOHIDManagerRegisterDeviceMatchingCallback(
                    hidmanager, IntPtr.Zero, IntPtr.Zero);
                Native.IOHIDManagerRegisterDeviceRemovalCallback(
                    hidmanager, IntPtr.Zero, IntPtr.Zero);

                Debug.Log("Try to release HIDManager");
                Native.CFRelease(hidmanager);
            }

            lock (syncRoot){
                if (Generics != null)
                {
                    foreach (KeyValuePair <string, HIDDevice> entry in Generics)
                    {
                        entry.Value.Dispose();
                    }


                    Generics.Clear();
                }


                Debug.Log("Try to remove Drivers");
                if (__drivers != null)
                {
                    __drivers.Clear();
                }
            }
        }