示例#1
0
        internal static void ZoomWindowIdeal(IntPtr windowRef, WindowPartCode inPartCode, ref CarbonPoint toIdealSize)
        {
            IntPtr num = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(CarbonPoint)));

            Marshal.StructureToPtr((object)toIdealSize, num, false);
            OSStatus errorCode = API._ZoomWindowIdeal(windowRef, (short)inPartCode, num);

            toIdealSize = (CarbonPoint)Marshal.PtrToStructure(num, typeof(CarbonPoint));
            Marshal.FreeHGlobal(num);
            if (errorCode != OSStatus.NoError)
            {
                throw new MacOSException(errorCode);
            }
        }
示例#2
0
        internal static void ZoomWindowIdeal(IntPtr windowRef, WindowPartCode inPartCode, ref CarbonPoint toIdealSize)
        {
            CarbonPoint pt = toIdealSize;
            OSStatus    error;
            IntPtr      handle = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(CarbonPoint)));

            Marshal.StructureToPtr(toIdealSize, handle, false);
            error       = _ZoomWindowIdeal(windowRef, (short)inPartCode, handle);
            toIdealSize = (CarbonPoint)Marshal.PtrToStructure(handle, typeof(CarbonPoint));
            Marshal.FreeHGlobal(handle);
            if (error != OSStatus.NoError)
            {
                throw new MacOSException(error);
            }
        }
示例#3
0
文件: API.cs 项目: tanis2000/FEZ
 internal static void ZoomWindowIdeal(IntPtr windowRef, WindowPartCode inPartCode, ref CarbonPoint toIdealSize)
 {
     IntPtr num = Marshal.AllocHGlobal(Marshal.SizeOf(typeof (CarbonPoint)));
       Marshal.StructureToPtr((object) toIdealSize, num, false);
       OSStatus errorCode = API._ZoomWindowIdeal(windowRef, (short) inPartCode, num);
       toIdealSize = (CarbonPoint) Marshal.PtrToStructure(num, typeof (CarbonPoint));
       Marshal.FreeHGlobal(num);
       if (errorCode != OSStatus.NoError)
     throw new MacOSException(errorCode);
 }
示例#4
0
        internal static void ZoomWindowIdeal(IntPtr windowRef, WindowPartCode inPartCode, ref Point toIdealSize)
        {
            Point pt = toIdealSize;
            OSStatus error ;
            IntPtr handle = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Point)));
            Marshal.StructureToPtr(toIdealSize, handle, false);

            error = _ZoomWindowIdeal(windowRef, (short)inPartCode, handle);

            toIdealSize = (Point)Marshal.PtrToStructure(handle,typeof(Point));

            Marshal.FreeHGlobal(handle);

            if (error != OSStatus.NoError)
            {
                throw new MacOSException(error);
            }
        }