예제 #1
0
        public void ScreenToMargins(BindingAssembly.Margins margins)
        {
            margins.Perform = chkSetMargins.Checked;
            double top = 0.0, bottom = 0.0, left = 0.0, right = 0.0, gutter = 0.0, header = 0.0, footer = 0.0;

            if (double.TryParse(txtTop.Text, out top))
            {
                margins.Top = top;
            }
            if (double.TryParse(txtBottom.Text, out bottom))
            {
                margins.Bottom = bottom;
            }
            if (double.TryParse(txtLeft.Text, out left))
            {
                margins.Left = left;
            }
            if (double.TryParse(txtRight.Text, out right))
            {
                margins.Right = right;
            }
            if (double.TryParse(txtGutter.Text, out gutter))
            {
                margins.Gutter = gutter;
            }
            if (double.TryParse(txtHeader.Text, out header))
            {
                margins.Header = header;
            }
            if (double.TryParse(txtFooter.Text, out footer))
            {
                margins.Footer = footer;
            }
        }
예제 #2
0
 public void MarginsToScreen(BindingAssembly.Margins margins)
 {
     chkSetMargins.Checked = margins.Perform;
     txtTop.Text           = $"{margins.Top:0.####}";
     txtBottom.Text        = $"{margins.Bottom:0.####}";
     txtLeft.Text          = $"{margins.Left:0.####}";
     txtRight.Text         = $"{margins.Right:0.####}";
     txtGutter.Text        = $"{margins.Gutter:0.####}";
     txtHeader.Text        = $"{margins.Header:0.####}";
     txtFooter.Text        = $"{margins.Footer:0.####}";
     setMarginControlsEnabled();
 }