Ejemplo n.º 1
0
        public override void GenerateXmlAttributes(XmlWriter writer)
        {
            base.GenerateXmlAttributes(writer);

            if (Label.IsNotWhiteSpace())
            {
                writer.WriteAttributeString("label", Label);
            }
            if (Align.HasValue)
            {
                writer.WriteAttributeString("Align", Align.ToString());
            }
            if (VAlign.HasValue)
            {
                writer.WriteAttributeString("VAlign", VAlign.ToString());
            }

            if (_fontAttr != null)
            {
                _fontAttr.GenerateXmlAttributes(writer);
            }

            if (LetterSpacing.HasValue)
            {
                writer.WriteAttributeString("LetterSpacing", LetterSpacing.ToString());
            }
            if (LeftMargin.HasValue)
            {
                writer.WriteAttributeString("LeftMargin", LeftMargin.ToString());
            }
            if (BgColor.HasValue)
            {
                writer.WriteAttributeString("BgColor", BgColor.Value.ToHexString());
            }
            if (BorderColor.HasValue)
            {
                writer.WriteAttributeString("BorderColor", BorderColor.Value.ToHexString());
            }
            if (Wrap.HasValue)
            {
                writer.WriteAttributeString("Wrap", Wrap.GetHashCode().ToString());
            }
            if (WrapWidth.HasValue)
            {
                writer.WriteAttributeString("WrapWidth", WrapWidth.ToString());
            }
            if (WrapHeight.HasValue)
            {
                writer.WriteAttributeString("WrapHeight", WrapHeight.ToString());
            }
        }
Ejemplo n.º 2
0
        private void paperSizeCombo_SelectedIndexChanged(object sender, EventArgs e)
        {
            PaperSize size = WbContext.get_paper_sizes()[paperSizeCombo.SelectedIndex];

            paperSizeLabel.Text = size.description;
            if (size.margins_set)
            {
                topMarginText.Text    = size.margin_top.ToString();
                bottomMarginText.Text = size.margin_bottom.ToString();
                leftMarginText.Text   = size.margin_left.ToString();
                rightMarginText.Text  = size.margin_right.ToString();
            }
            else
            {
                topMarginText.Text    = TopMargin.ToString();
                bottomMarginText.Text = BottomMargin.ToString();
                leftMarginText.Text   = LeftMargin.ToString();
                rightMarginText.Text  = RightMargin.ToString();
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 序列化xml
 /// </summary>
 /// <param name="p_writer"></param>
 public void WriteXml(XmlWriter p_writer)
 {
     p_writer.WriteStartElement("Page");
     // 不保存纸张名称
     //string val = Data.Str("papername");
     //if (val != "IsoA4")
     //    p_writer.WriteAttributeString("papername", val);
     if (Height != _defaultHeight)
     {
         p_writer.WriteAttributeString("height", Height.ToString());
     }
     if (Width != _defaultWidth)
     {
         p_writer.WriteAttributeString("width", Width.ToString());
     }
     if (LeftMargin != _defaultMargin)
     {
         p_writer.WriteAttributeString("leftmargin", LeftMargin.ToString());
     }
     if (TopMargin != _defaultMargin)
     {
         p_writer.WriteAttributeString("topmargin", TopMargin.ToString());
     }
     if (RightMargin != _defaultMargin)
     {
         p_writer.WriteAttributeString("rightmargin", RightMargin.ToString());
     }
     if (BottomMargin != _defaultMargin)
     {
         p_writer.WriteAttributeString("bottommargin", BottomMargin.ToString());
     }
     if (Landscape)
     {
         p_writer.WriteAttributeString("landscape", "True");
     }
     p_writer.WriteEndElement();
 }