Exemplo n.º 1
0
 public T Get <T>(string name) where T : NativeWrapper, new()
 {
     CheckValidity();
     if (WrapperTypeMapping.ContainsKey(typeof(T)))
     {
         IntPtr ptr = APIWrapper.Level_GetWrapper(NativeInstance, WrapperTypeMapping[typeof(T)], name);
         return(RegisterChild(FromNative <T>(ptr)));
     }
     return(null);
 }
Exemplo n.º 2
0
        public T[] Get <T>() where T : NativeWrapper, new()
        {
            CheckValidity();
            T[] wrappers = new T[0];
            if (WrapperTypeMapping.ContainsKey(typeof(T)))
            {
                IntPtr ptr = APIWrapper.Level_GetWrappers(NativeInstance, WrapperTypeMapping[typeof(T)], out uint num, out uint inc);

                wrappers = MemUtils.IntPtrToWrapperArray <T>(ptr, (int)num, (int)inc);
                for (int i = 0; i < wrappers.Length; i++)
                {
                    RegisterChild(wrappers[i]);
                }
            }
            return(wrappers);
        }