예제 #1
0
 public MininumMarginSale(decimal?minMarginPercentage, decimal?minMarginUSD, MarginTypes mininumMarginSourcePercentage, MarginTypes mininumMarginSourceUSD)
 {
     MinimumMarginPercentage       = (decimal)minMarginPercentage;
     MinimumMarginUSD              = (decimal)(minMarginUSD != null ? minMarginUSD : 0);
     MininumMarginSourceUSD        = mininumMarginSourceUSD;
     MininumMarginSourcePercentage = mininumMarginSourcePercentage;
 }
예제 #2
0
 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();
     }
 }
예제 #3
0
 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();
     }
 }
예제 #4
0
        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();
            }
        }
예제 #5
0
        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();
            }
        }
예제 #6
0
        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();
     }
 }
예제 #8
0
 public MaxMinimunMarginSale(decimal?marginValue, MarginTypes marginSource)
 {
     MarginValue  = marginValue;
     MarginSource = marginSource;
 }
예제 #9
0
		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;
		}