コード例 #1
0
        public override void SetSize(FixedPage fixedPage)
        {
            var converter = new LengthConverter();

            // ReSharper disable once PossibleNullReferenceException
            fixedPage.Width = (double)converter.ConvertFromInvariantString("29.7cm");
            // ReSharper disable once PossibleNullReferenceException
            fixedPage.Height = (double)converter.ConvertFromInvariantString("21cm");
        }
コード例 #2
0
ファイル: Print.cs プロジェクト: GrayJumba/Onion
        public Print(string w, string h, string left, string top, string right, string bottom)
        {
            var converter = new LengthConverter();
            var width = (double)converter.ConvertFromInvariantString(w);
            var height = (double)converter.ConvertFromInvariantString(h);
            var marginLeft = (double)converter.ConvertFromInvariantString(left);
            var marginTop = (double)converter.ConvertFromInvariantString(top);
            var marginRight = (double)converter.ConvertFromInvariantString(right);
            var marginBottom = (double)converter.ConvertFromInvariantString(bottom);
            this._Size = new Size(width, height);
            this._Margin = new Thickness(marginLeft, marginTop, marginRight, marginBottom);

        }