Mono.NativeDependencyObjectHelper.AddNativeMapping C# (CSharp) Метод

AddNativeMapping() публичный статический Метод

public static AddNativeMapping ( IntPtr native, INativeEventObjectWrapper wrapper ) : bool
native System.IntPtr
wrapper INativeEventObjectWrapper
Результат bool
		public static bool AddNativeMapping (IntPtr native, INativeEventObjectWrapper wrapper)
		{
			EventObjectToggleRef tref;
			
			if (native == IntPtr.Zero)
				return false;

			lock (objects) {
				if (objects.ContainsKey (native)) {
	#if DEBUG
					throw new ExecutionEngineException ("multiple mappings registered for the same unmanaged peer");
	#endif
					Console.WriteLine ("multiple mappings registered for the same unmanaged peer 0x{0:x}, type = {1}", native, wrapper.GetType());
					Console.WriteLine (Environment.StackTrace);
					return false;
				}
				
				tref = new EventObjectToggleRef (wrapper);
				objects[native] = tref;
			}
			tref.Initialize ();
			return true;
		}