Exemplo n.º 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);
            }
        }
Exemplo n.º 2
0
 public static void AECreateDesc(OSType typeCode, byte[] data, out AEDesc result)
 {
     CheckReturn(AECreateDesc(typeCode, data, data.Length, out result));
 }
Exemplo n.º 3
0
 public static extern AEDescStatus AESizeOfNthItem(ref AEDesc descList, int index, ref OSType type, out int size);
Exemplo n.º 4
0
 static extern AEDescStatus AEGetNthPtr(ref AEDesc descList, int index, OSType desiredType, uint keyword,
                                        uint zero, out IntPtr outPtr, int bufferSize, int zero2);
Exemplo n.º 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);
Exemplo n.º 6
0
 static extern AEDescStatus AECreateDesc(OSType typeCode, byte[] data, int dataSize, out AEDesc desc);
Exemplo n.º 7
0
 static extern AEDescStatus AECreateDesc(OSType typeCode, IntPtr dataPtr, int dataSize, out AEDesc desc);
Exemplo n.º 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);
        }
Exemplo n.º 9
0
 public static extern ComponentInstance OpenDefaultComponent(OSType componentType, OSType componentSubType);
Exemplo n.º 10
0
 static extern NavStatus NavCreatePutFileDialog(ref NavDialogCreationOptionsData options, OSType inFileType,
                                                OSType inFileCreator, NavEventUPP inEventProc,
                                                IntPtr inClientData, out IntPtr navDialogRef);