示例#1
0
        public static T AEGetNthPtr <T> (ref AEDesc descList, int index, OSType desiredType) where T : struct
        {
            int    len       = Marshal.SizeOf(typeof(T));
            IntPtr bufferPtr = Marshal.AllocHGlobal(len);

            try {
                CheckReturn(AEGetNthPtr(ref descList, index, desiredType, 0, 0, bufferPtr, len, 0));
                T val = (T)Marshal.PtrToStructure(bufferPtr, typeof(T));
                return(val);
            } finally{
                Marshal.FreeHGlobal(bufferPtr);
            }
        }
示例#2
0
 public static void AECreateDesc(OSType typeCode, byte[] data, out AEDesc result)
 {
     CheckReturn(AECreateDesc(typeCode, data, data.Length, out result));
 }
示例#3
0
 public static extern AEDescStatus AESizeOfNthItem(ref AEDesc descList, int index, ref OSType type, out int size);
示例#4
0
 static extern AEDescStatus AEGetNthPtr(ref AEDesc descList, int index, OSType desiredType, uint keyword,
                                        uint zero, out IntPtr outPtr, int bufferSize, int zero2);
示例#5
0
 static extern AEDescStatus AEGetNthPtr(ref AEDesc descList, int index, OSType desiredType, uint keyword,
                                        out CarbonEventParameterType actualType, IntPtr buffer, int bufferSize, out int actualSize);
示例#6
0
 static extern AEDescStatus AECreateDesc(OSType typeCode, byte[] data, int dataSize, out AEDesc desc);
示例#7
0
 static extern AEDescStatus AECreateDesc(OSType typeCode, IntPtr dataPtr, int dataSize, out AEDesc desc);
示例#8
0
        public static T[] GetListFromAEDesc <T, TRef> (ref AEDesc list, AEDescValueSelector <TRef, T> sel, OSType type)
            where TRef : struct
        {
            long count = AppleEvent.AECountItems(ref list);

            T[] arr = new T[count];
            for (int i = 1; i <= count; i++)
            {
                TRef r = AppleEvent.AEGetNthPtr <TRef> (ref list, i, type);
                arr [i - 1] = sel(ref r);
            }
            return(arr);
        }
示例#9
0
 public static extern ComponentInstance OpenDefaultComponent(OSType componentType, OSType componentSubType);
示例#10
0
 static extern NavStatus NavCreatePutFileDialog(ref NavDialogCreationOptionsData options, OSType inFileType,
                                                OSType inFileCreator, NavEventUPP inEventProc,
                                                IntPtr inClientData, out IntPtr navDialogRef);