Exemplo n.º 1
0
 public PaperSize(GraphicsUnits units, double width, double height)
 {
     if (units == GraphicsUnits.Centimiters)
     {
         WidthMM = width * 10;
         HeightMM = height * 10;
     }
     else if (units == GraphicsUnits.Milimeters)
     {
         WidthMM = width;
         HeightMM = height;
     }
     else
     {
         throw new NotSupportedException(nameof(units));
     }
 }
Exemplo n.º 2
0
 public MarginsSize(GraphicsUnits units, double top, double bottom, double left, double right)
 {
     if (units == GraphicsUnits.Centimiters)
     {
         this.TopMM = top * 10;
         this.BottomMM = bottom * 10;
         this.LeftMM = left * 10;
         this.RightMM = right * 10;
     }
     else if (units == GraphicsUnits.Milimeters)
     {
         this.TopMM = top;
         this.BottomMM = bottom;
         this.LeftMM = left;
         this.RightMM = right;
     }
     else
     {
         throw new NotSupportedException(nameof(units));
     }
 }