public MininumMarginSale(decimal?minMarginPercentage, decimal?minMarginUSD, MarginTypes mininumMarginSourcePercentage, MarginTypes mininumMarginSourceUSD) { MinimumMarginPercentage = (decimal)minMarginPercentage; MinimumMarginUSD = (decimal)(minMarginUSD != null ? minMarginUSD : 0); MininumMarginSourceUSD = mininumMarginSourceUSD; MininumMarginSourcePercentage = mininumMarginSourcePercentage; }
private Padding GetThemeMargins(IDeviceContext dc, MarginTypes marginType) { try { var ok = NativeMethods.GetThemeMargins(_renderer.Handle, dc.GetHdc(), _renderer.Part, _renderer.State, (int)marginType, IntPtr.Zero, out var margins) == 0; return(!ok ? new Padding(0) : new Padding(margins.cxLeftWidth, margins.cyTopHeight, margins.cxRightWidth, margins.cyBottomHeight)); } finally { dc.ReleaseHdc(); } }
Padding GetThemeMargins(IDeviceContext dc, MarginTypes marginType) { NativeMethods.MARGINS margins; try { IntPtr hDC = dc.GetHdc(); if (0 == NativeMethods.GetThemeMargins(renderer.Handle, hDC, renderer.Part, renderer.State, (int)marginType, IntPtr.Zero, out margins)) { return(new Padding(margins.cxLeftWidth, margins.cyTopHeight, margins.cxRightWidth, margins.cyBottomHeight)); } return(new Padding(0)); } finally { dc.ReleaseHdc(); } }
Padding GetThemeMargins(IDeviceContext dc, MarginTypes marginType) { NativeMethods.Margins margins; try { IntPtr hDc = dc.GetHdc(); if (NativeMethods.GetThemeMargins(Renderer.Handle, hDc, Renderer.Part, Renderer.State, (int)marginType, IntPtr.Zero, out margins) == 0) { return new Padding(margins.cxLeftWidth, margins.cyTopHeight, margins.cxRightWidth, margins.cyBottomHeight); } return new Padding(0); } finally { dc.ReleaseHdc(); } }
private Padding GetThemeMargins(IDeviceContext dc, MarginTypes marginType) { try { IntPtr hDC = dc.GetHdc(); MARGINS margins; if (DllImports.GetThemeMargins(_renderer.Handle, hDC, _renderer.Part, _renderer.State, (int)marginType, IntPtr.Zero, out margins) == 0) { return(new Padding(margins.cxLeftWidth, margins.cyTopHeight, margins.cxRightWidth, margins.cyBottomHeight)); } return(new Padding(0)); } finally { dc.ReleaseHdc(); } }
private Padding GetThemeMargins(IDeviceContext dc, MarginTypes marginType) { Padding padding; try { NativeMethods.MARGINS margins; IntPtr hdc = dc.GetHdc(); if ( NativeMethods.GetThemeMargins(renderer.Handle, hdc, renderer.Part, renderer.State, (int)marginType, IntPtr.Zero, out margins) == 0) { return(new Padding(margins.cxLeftWidth, margins.cyTopHeight, margins.cxRightWidth, margins.cyBottomHeight)); } padding = new Padding(0); } finally { dc.ReleaseHdc(); } return(padding); }
private Padding GetThemeMargins(IDeviceContext dc, MarginTypes marginType) { MARGINS margins; try { IntPtr hDC = dc.GetHdc(); if (0 == GetThemeMargins(_renderer.Handle, hDC, _renderer.Part, _renderer.State, (int) marginType, IntPtr.Zero, out margins)) return new Padding(margins.cxLeftWidth, margins.cyTopHeight, margins.cxRightWidth, margins.cyBottomHeight); return new Padding(0); } finally { dc.ReleaseHdc(); } }
public MaxMinimunMarginSale(decimal?marginValue, MarginTypes marginSource) { MarginValue = marginValue; MarginSource = marginSource; }
private Padding GetThemeMargins(IDeviceContext dc, MarginTypes marginType) { Padding padding; try { NativeMethods.MARGINS margins; IntPtr hdc = dc.GetHdc(); if ( NativeMethods.GetThemeMargins(renderer.Handle, hdc, renderer.Part, renderer.State, (int) marginType, IntPtr.Zero, out margins) == 0) { return new Padding(margins.cxLeftWidth, margins.cyTopHeight, margins.cxRightWidth, margins.cyBottomHeight); } padding = new Padding(0); } finally { dc.ReleaseHdc(); } return padding; }