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); } }
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); } }
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); }
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); } }