当前位置: 首页>>代码示例>>C#>>正文


C# Serializer.BeginAttributes方法代码示例

本文整理汇总了C#中Serializer.BeginAttributes方法的典型用法代码示例。如果您正苦于以下问题:C# Serializer.BeginAttributes方法的具体用法?C# Serializer.BeginAttributes怎么用?C# Serializer.BeginAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Serializer的用法示例。


在下文中一共展示了Serializer.BeginAttributes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Serialize

        /// <summary>
        /// Converts Table into DDL.
        /// </summary>
        internal override void Serialize(Serializer serializer)
        {
            serializer.WriteComment(_comment.Value);

            serializer.WriteLine("\\table");

            int pos = serializer.BeginAttributes();

            if (_style.Value != String.Empty)
                serializer.WriteSimpleAttribute("Style", Style);

            if (!IsNull("Format"))
                _format.Serialize(serializer, "Format", null);

            if (!_topPadding.IsNull)
                serializer.WriteSimpleAttribute("TopPadding", TopPadding);

            if (!_leftPadding.IsNull)
                serializer.WriteSimpleAttribute("LeftPadding", LeftPadding);

            if (!_rightPadding.IsNull)
                serializer.WriteSimpleAttribute("RightPadding", RightPadding);

            if (!_bottomPadding.IsNull)
                serializer.WriteSimpleAttribute("BottomPadding", BottomPadding);

            if (!IsNull("Borders"))
                _borders.Serialize(serializer, null);

            if (!IsNull("Shading"))
                _shading.Serialize(serializer);

            serializer.EndAttributes(pos);

            serializer.BeginContent();
            Columns.Serialize(serializer);
            Rows.Serialize(serializer);
            serializer.EndContent();
        }
开发者ID:Sl0vi,项目名称:MigraDoc,代码行数:42,代码来源:Table.cs

示例2: Serialize

        /// <summary>
        /// Converts Columns into DDL.
        /// </summary>
        internal override void Serialize(Serializer serializer)
        {
            serializer.WriteComment(_comment.Value);
            serializer.WriteLine("\\columns");

            int pos = serializer.BeginAttributes();

            if (!_width.IsNull)
                serializer.WriteSimpleAttribute("Width", Width);

            serializer.EndAttributes(pos);

            serializer.BeginContent();
            int clms = Count;
            if (clms > 0)
            {
                for (int clm = 0; clm < clms; clm++)
                    this[clm].Serialize(serializer);
            }
            else
                serializer.WriteComment("Invalid - no columns defined. Table will not render.");
            serializer.EndContent();
        }
开发者ID:Sl0vi,项目名称:MigraDoc,代码行数:26,代码来源:Columns.cs

示例3: Serialize

    /// <summary>
    /// Converts PlotArea into DDL.
    /// </summary>
    internal override void Serialize(Serializer serializer)
    {
      serializer.WriteLine("\\plotarea");
      int pos = serializer.BeginAttributes();

      if (!this.topPadding.IsNull)
        serializer.WriteSimpleAttribute("TopPadding", this.TopPadding);
      if (!this.leftPadding.IsNull)
        serializer.WriteSimpleAttribute("LeftPadding", this.LeftPadding);
      if (!this.rightPadding.IsNull)
        serializer.WriteSimpleAttribute("RightPadding", this.RightPadding);
      if (!this.bottomPadding.IsNull)
        serializer.WriteSimpleAttribute("BottomPadding", this.BottomPadding);

      if (!this.IsNull("LineFormat"))
        this.lineFormat.Serialize(serializer);
      if (!this.IsNull("FillFormat"))
        this.fillFormat.Serialize(serializer);

      serializer.EndAttributes(pos);

      serializer.BeginContent();
      serializer.EndContent();
    }
开发者ID:GorelH,项目名称:PdfSharp,代码行数:27,代码来源:PlotArea.cs

示例4: Serialize

    /// <summary>
    /// Converts Table into DDL.
    /// </summary>
    internal override void Serialize(Serializer serializer)
    {
      serializer.WriteComment(this.comment.Value);

      serializer.WriteLine("\\table");

      int pos = serializer.BeginAttributes();

      if (this.style.Value != String.Empty)
        serializer.WriteSimpleAttribute("Style", this.Style);

      if (!this.IsNull("Format"))
        this.format.Serialize(serializer, "Format", null);

      if (!this.topPadding.IsNull)
        serializer.WriteSimpleAttribute("TopPadding", this.TopPadding);

      if (!this.leftPadding.IsNull)
        serializer.WriteSimpleAttribute("LeftPadding", this.LeftPadding);

      if (!this.rightPadding.IsNull)
        serializer.WriteSimpleAttribute("RightPadding", this.RightPadding);

      if (!this.bottomPadding.IsNull)
        serializer.WriteSimpleAttribute("BottomPadding", this.BottomPadding);

      if (!this.IsNull("Borders"))
        this.borders.Serialize(serializer, null);

      if (!this.IsNull("Shading"))
        this.shading.Serialize(serializer);

      serializer.EndAttributes(pos);

      serializer.BeginContent();
      this.Columns.Serialize(serializer);
      this.Rows.Serialize(serializer);
      serializer.EndContent();
    }
开发者ID:GorelH,项目名称:PdfSharp,代码行数:42,代码来源:Table.cs

示例5: Serialize

        /// <summary>
        /// Converts Barcode into DDL.
        /// </summary>
        internal override void Serialize(Serializer serializer)
        {
            if (_code.Value == "")
                throw new InvalidOperationException(DomSR.MissingObligatoryProperty("Name", "BookmarkField"));

            serializer.WriteLine("\\barcode(\"" + Code + "\")");

            int pos = serializer.BeginAttributes();

            base.Serialize(serializer);

            if (!_orientation.IsNull)
                serializer.WriteSimpleAttribute("Orientation", Orientation);
            if (!_bearerBars.IsNull)
                serializer.WriteSimpleAttribute("BearerBars", BearerBars);
            if (!_text.IsNull)
                serializer.WriteSimpleAttribute("Text", Text);
            if (!_type.IsNull)
                serializer.WriteSimpleAttribute("Type", Type);
            if (!_lineRatio.IsNull)
                serializer.WriteSimpleAttribute("LineRatio", LineRatio);
            if (!_lineHeight.IsNull)
                serializer.WriteSimpleAttribute("LineHeight", LineHeight);
            if (!_narrowLineWidth.IsNull)
                serializer.WriteSimpleAttribute("NarrowLineWidth", NarrowLineWidth);

            serializer.EndAttributes(pos);
        }
开发者ID:Sl0vi,项目名称:MigraDoc,代码行数:31,代码来源:Barcode.cs

示例6: Serialize

    /// <summary>
    /// Converts Row into DDL.
    /// </summary>
    internal override void Serialize(Serializer serializer)
    {
      serializer.WriteComment(this.comment.Value);
      serializer.WriteLine("\\row");

      int pos = serializer.BeginAttributes();

      if (this.style.Value != String.Empty)
        serializer.WriteSimpleAttribute("Style", this.Style);

      if (!this.IsNull("Format"))
        this.format.Serialize(serializer, "Format", null);

      if (!this.height.IsNull)
        serializer.WriteSimpleAttribute("Height", this.Height);

      if (!this.heightRule.IsNull)
        serializer.WriteSimpleAttribute("HeightRule", this.HeightRule);

      if (!this.topPadding.IsNull)
        serializer.WriteSimpleAttribute("TopPadding", this.TopPadding);

      if (!this.bottomPadding.IsNull)
        serializer.WriteSimpleAttribute("BottomPadding", this.BottomPadding);

      if (!this.headingFormat.IsNull)
        serializer.WriteSimpleAttribute("HeadingFormat", this.HeadingFormat);

      if (!this.verticalAlignment.IsNull)
        serializer.WriteSimpleAttribute("VerticalAlignment", this.VerticalAlignment);

      if (!this.keepWith.IsNull)
        serializer.WriteSimpleAttribute("KeepWith", this.KeepWith);

      //Borders & Shading
      if (!this.IsNull("Borders"))
        this.borders.Serialize(serializer, null);

      if (!this.IsNull("Shading"))
        this.shading.Serialize(serializer);

      serializer.EndAttributes(pos);

      serializer.BeginContent();
      if (!IsNull("Cells"))
        this.cells.Serialize(serializer);
      serializer.EndContent();
    }
开发者ID:DavidS,项目名称:MigraDoc,代码行数:51,代码来源:Row.cs

示例7: Serialize

        /// <summary>
        /// Converts PlotArea into DDL.
        /// </summary>
        internal override void Serialize(Serializer serializer)
        {
            serializer.WriteLine("\\plotarea");
            int pos = serializer.BeginAttributes();

            if (!_topPadding.IsNull)
                serializer.WriteSimpleAttribute("TopPadding", TopPadding);
            if (!_leftPadding.IsNull)
                serializer.WriteSimpleAttribute("LeftPadding", LeftPadding);
            if (!_rightPadding.IsNull)
                serializer.WriteSimpleAttribute("RightPadding", RightPadding);
            if (!_bottomPadding.IsNull)
                serializer.WriteSimpleAttribute("BottomPadding", BottomPadding);

            if (!IsNull("LineFormat"))
                _lineFormat.Serialize(serializer);
            if (!IsNull("FillFormat"))
                _fillFormat.Serialize(serializer);

            serializer.EndAttributes(pos);

            serializer.BeginContent();
            serializer.EndContent();
        }
开发者ID:Sl0vi,项目名称:MigraDoc,代码行数:27,代码来源:PlotArea.cs

示例8: Serialize

        /// <summary>
        /// Converts Chart into DDL.
        /// </summary>
        internal override void Serialize(Serializer serializer)
        {
            serializer.WriteLine("\\chart(" + Type + ")");
            int pos = serializer.BeginAttributes();

            base.Serialize(serializer);
            if (!_displayBlanksAs.IsNull)
                serializer.WriteSimpleAttribute("DisplayBlanksAs", DisplayBlanksAs);
            if (!_pivotChart.IsNull)
                serializer.WriteSimpleAttribute("PivotChart", PivotChart);
            if (!_hasDataLabel.IsNull)
                serializer.WriteSimpleAttribute("HasDataLabel", HasDataLabel);

            if (!_style.IsNull)
                serializer.WriteSimpleAttribute("Style", Style);
            if (!IsNull("Format"))
                _format.Serialize(serializer, "Format", null);
            if (!IsNull("DataLabel"))
                _dataLabel.Serialize(serializer);
            serializer.EndAttributes(pos);

            serializer.BeginContent();

            if (!IsNull("PlotArea"))
                _plotArea.Serialize(serializer);
            if (!IsNull("HeaderArea"))
                _headerArea.Serialize(serializer);
            if (!IsNull("FooterArea"))
                _footerArea.Serialize(serializer);
            if (!IsNull("TopArea"))
                _topArea.Serialize(serializer);
            if (!IsNull("BottomArea"))
                _bottomArea.Serialize(serializer);
            if (!IsNull("LeftArea"))
                _leftArea.Serialize(serializer);
            if (!IsNull("RightArea"))
                _rightArea.Serialize(serializer);

            if (!IsNull("XAxis"))
                _xAxis.Serialize(serializer);
            if (!IsNull("YAxis"))
                _yAxis.Serialize(serializer);
            if (!IsNull("ZAxis"))
                _zAxis.Serialize(serializer);

            if (!IsNull("SeriesCollection"))
                _seriesCollection.Serialize(serializer);
            if (!IsNull("XValues"))
                _xValues.Serialize(serializer);

            serializer.EndContent();
        }
开发者ID:Sl0vi,项目名称:MigraDoc,代码行数:55,代码来源:Chart.cs

示例9: Serialize

        /// <summary>
        /// Converts Row into DDL.
        /// </summary>
        internal override void Serialize(Serializer serializer)
        {
            serializer.WriteComment(_comment.Value);
            serializer.WriteLine("\\row");

            int pos = serializer.BeginAttributes();

            if (_style.Value != String.Empty)
                serializer.WriteSimpleAttribute("Style", Style);

            if (!IsNull("Format"))
                _format.Serialize(serializer, "Format", null);

            if (!_height.IsNull)
                serializer.WriteSimpleAttribute("Height", Height);

            if (!_heightRule.IsNull)
                serializer.WriteSimpleAttribute("HeightRule", HeightRule);

            if (!_topPadding.IsNull)
                serializer.WriteSimpleAttribute("TopPadding", TopPadding);

            if (!_bottomPadding.IsNull)
                serializer.WriteSimpleAttribute("BottomPadding", BottomPadding);

            if (!_headingFormat.IsNull)
                serializer.WriteSimpleAttribute("HeadingFormat", HeadingFormat);

            if (!_verticalAlignment.IsNull)
                serializer.WriteSimpleAttribute("VerticalAlignment", VerticalAlignment);

            if (!_keepWith.IsNull)
                serializer.WriteSimpleAttribute("KeepWith", KeepWith);

            //Borders & Shading
            if (!IsNull("Borders"))
                _borders.Serialize(serializer, null);

            if (!IsNull("Shading"))
                _shading.Serialize(serializer);

            serializer.EndAttributes(pos);

            serializer.BeginContent();
            if (!IsNull("Cells"))
                _cells.Serialize(serializer);
            serializer.EndContent();
        }
开发者ID:Sl0vi,项目名称:MigraDoc,代码行数:51,代码来源:Row.cs

示例10: Serialize

    /// <summary>
    /// Converts TextArea into DDL.
    /// </summary>
    internal override void Serialize(Serializer serializer)
    {
      Chart chartObject = this.parent as Chart;

      serializer.WriteLine("\\" + chartObject.CheckTextArea(this));
      int pos = serializer.BeginAttributes();

      if (!this.style.IsNull)
        serializer.WriteSimpleAttribute("Style", this.Style);
      if (!this.IsNull("Format"))
        this.format.Serialize(serializer, "Format", null);

      if (!this.topPadding.IsNull)
        serializer.WriteSimpleAttribute("TopPadding", this.TopPadding);
      if (!this.leftPadding.IsNull)
        serializer.WriteSimpleAttribute("LeftPadding", this.LeftPadding);
      if (!this.rightPadding.IsNull)
        serializer.WriteSimpleAttribute("RightPadding", this.RightPadding);
      if (!this.bottomPadding.IsNull)
        serializer.WriteSimpleAttribute("BottomPadding", this.BottomPadding);

      if (!this.width.IsNull)
        serializer.WriteSimpleAttribute("Width", this.Width);
      if (!this.height.IsNull)
        serializer.WriteSimpleAttribute("Height", this.Height);

      if (!this.verticalAlignment.IsNull)
        serializer.WriteSimpleAttribute("VerticalAlignment", this.VerticalAlignment);

      if (!this.IsNull("LineFormat"))
        this.lineFormat.Serialize(serializer);
      if (!this.IsNull("FillFormat"))
        this.fillFormat.Serialize(serializer);

      serializer.EndAttributes(pos);

      serializer.BeginContent();
      if (this.elements != null)
        this.elements.Serialize(serializer);
      serializer.EndContent();
    }
开发者ID:GorelH,项目名称:PdfSharp,代码行数:44,代码来源:TextArea.cs

示例11: Serialize

        /// <summary>
        /// Converts Chart into DDL.
        /// </summary>
        internal override void Serialize(Serializer serializer)
        {
            serializer.WriteLine("\\chart(" + this.Type + ")");
              int pos = serializer.BeginAttributes();

              base.Serialize(serializer);
              if (!this.displayBlanksAs.IsNull)
            serializer.WriteSimpleAttribute("DisplayBlanksAs", this.DisplayBlanksAs);
              if (!this.pivotChart.IsNull)
            serializer.WriteSimpleAttribute("PivotChart", this.PivotChart);
              if (!this.hasDataLabel.IsNull)
            serializer.WriteSimpleAttribute("HasDataLabel", this.HasDataLabel);

              if (!this.style.IsNull)
            serializer.WriteSimpleAttribute("Style", this.Style);
              if (!this.IsNull("Format"))
            this.format.Serialize(serializer, "Format", null);
              if (!this.IsNull("DataLabel"))
            this.dataLabel.Serialize(serializer);
              serializer.EndAttributes(pos);

              serializer.BeginContent();

              if (!this.IsNull("PlotArea"))
            this.plotArea.Serialize(serializer);
              if (!this.IsNull("HeaderArea"))
            this.headerArea.Serialize(serializer);
              if (!this.IsNull("FooterArea"))
            this.footerArea.Serialize(serializer);
              if (!this.IsNull("TopArea"))
            this.topArea.Serialize(serializer);
              if (!this.IsNull("BottomArea"))
            this.bottomArea.Serialize(serializer);
              if (!this.IsNull("LeftArea"))
            this.leftArea.Serialize(serializer);
              if (!this.IsNull("RightArea"))
            this.rightArea.Serialize(serializer);

              if (!this.IsNull("XAxis"))
            this.xAxis.Serialize(serializer);
              if (!this.IsNull("YAxis"))
            this.yAxis.Serialize(serializer);
              if (!this.IsNull("ZAxis"))
            this.zAxis.Serialize(serializer);

              if (!this.IsNull("SeriesCollection"))
            this.seriesCollection.Serialize(serializer);
              if (!this.IsNull("XValues"))
            this.xValues.Serialize(serializer);

              serializer.EndContent();
        }
开发者ID:dankennedy,项目名称:MigraDoc,代码行数:55,代码来源:Chart.cs

示例12: Serialize

        /// <summary>
        /// Converts Series into DDL.
        /// </summary>
        internal override void Serialize(Serializer serializer)
        {
            serializer.WriteLine("\\series");

              int pos = serializer.BeginAttributes();

              if (!this.name.IsNull)
            serializer.WriteSimpleAttribute("Name", this.Name);

              if (!this.markerSize.IsNull)
            serializer.WriteSimpleAttribute("MarkerSize", this.MarkerSize);
              if (!this.markerStyle.IsNull)
            serializer.WriteSimpleAttribute("MarkerStyle", this.MarkerStyle);

              if (!this.markerBackgroundColor.IsNull)
            serializer.WriteSimpleAttribute("MarkerBackgroundColor", this.MarkerBackgroundColor);
              if (!this.markerForegroundColor.IsNull)
            serializer.WriteSimpleAttribute("MarkerForegroundColor", this.MarkerForegroundColor);

              if (!this.chartType.IsNull)
            serializer.WriteSimpleAttribute("ChartType", this.ChartType);

              if (!this.hasDataLabel.IsNull)
            serializer.WriteSimpleAttribute("HasDataLabel", this.HasDataLabel);

              if (!this.IsNull("LineFormat"))
            this.lineFormat.Serialize(serializer);
              if (!this.IsNull("FillFormat"))
            this.fillFormat.Serialize(serializer);
              if (!this.IsNull("DataLabel"))
            this.dataLabel.Serialize(serializer);

              serializer.EndAttributes(pos);

              serializer.BeginContent();
              this.seriesElements.Serialize(serializer);
              serializer.WriteLine("");
              serializer.EndContent();
        }
开发者ID:dankennedy,项目名称:MigraDoc,代码行数:42,代码来源:Series.cs

示例13: Serialize

        /// <summary>
        /// Converts TextArea into DDL.
        /// </summary>
        internal override void Serialize(Serializer serializer)
        {
            Chart chartObject = _parent as Chart;

            serializer.WriteLine("\\" + chartObject.CheckTextArea(this));
            int pos = serializer.BeginAttributes();

            if (!_style.IsNull)
                serializer.WriteSimpleAttribute("Style", Style);
            if (!IsNull("Format"))
                _format.Serialize(serializer, "Format", null);

            if (!_topPadding.IsNull)
                serializer.WriteSimpleAttribute("TopPadding", TopPadding);
            if (!_leftPadding.IsNull)
                serializer.WriteSimpleAttribute("LeftPadding", LeftPadding);
            if (!_rightPadding.IsNull)
                serializer.WriteSimpleAttribute("RightPadding", RightPadding);
            if (!_bottomPadding.IsNull)
                serializer.WriteSimpleAttribute("BottomPadding", BottomPadding);

            if (!_width.IsNull)
                serializer.WriteSimpleAttribute("Width", Width);
            if (!_height.IsNull)
                serializer.WriteSimpleAttribute("Height", Height);

            if (!_verticalAlignment.IsNull)
                serializer.WriteSimpleAttribute("VerticalAlignment", VerticalAlignment);

            if (!IsNull("LineFormat"))
                _lineFormat.Serialize(serializer);
            if (!IsNull("FillFormat"))
                _fillFormat.Serialize(serializer);

            serializer.EndAttributes(pos);

            serializer.BeginContent();
            if (_elements != null)
                _elements.Serialize(serializer);
            serializer.EndContent();
        }
开发者ID:Sl0vi,项目名称:MigraDoc,代码行数:44,代码来源:TextArea.cs

示例14: Serialize

    /// <summary>
    /// Converts Rows into DDL.
    /// </summary>
    internal override void Serialize(Serializer serializer)
    {
      serializer.WriteComment(this.comment.Value);
      serializer.WriteLine("\\rows");

      int pos = serializer.BeginAttributes();

      if (!this.alignment.IsNull)
        serializer.WriteSimpleAttribute("Alignment", this.Alignment);

      if (!this.height.IsNull)
        serializer.WriteSimpleAttribute("Height", this.Height);

      if (!this.heightRule.IsNull)
        serializer.WriteSimpleAttribute("HeightRule", this.HeightRule);

      if (!this.leftIndent.IsNull)
        serializer.WriteSimpleAttribute("LeftIndent", this.LeftIndent);

      if (!this.verticalAlignment.IsNull)
        serializer.WriteSimpleAttribute("VerticalAlignment", this.VerticalAlignment);

      serializer.EndAttributes(pos);

      serializer.BeginContent();
      int rows = Count;
      if (rows > 0)
      {
        for (int row = 0; row < rows; row++)
          this[row].Serialize(serializer);
      }
      else
        serializer.WriteComment("Invalid - no rows defined. Table will not render.");
      serializer.EndContent();
    }
开发者ID:GorelH,项目名称:PdfSharp,代码行数:38,代码来源:Rows.cs

示例15: Serialize

        /// <summary>
        /// Converts Axis into DDL.
        /// </summary>
        internal override void Serialize(Serializer serializer)
        {
            Chart chartObject = this.parent as Chart;

              serializer.WriteLine("\\" + chartObject.CheckAxis(this));
              int pos = serializer.BeginAttributes();

              if (!this.minimumScale.IsNull)
            serializer.WriteSimpleAttribute("MinimumScale", this.MinimumScale);
              if (!this.maximumScale.IsNull)
            serializer.WriteSimpleAttribute("MaximumScale", this.MaximumScale);
              if (!this.majorTick.IsNull)
            serializer.WriteSimpleAttribute("MajorTick", this.MajorTick);
              if (!this.minorTick.IsNull)
            serializer.WriteSimpleAttribute("MinorTick", this.MinorTick);
              if (!this.hasMajorGridlines.IsNull)
            serializer.WriteSimpleAttribute("HasMajorGridLines", this.HasMajorGridlines);
              if (!this.hasMinorGridlines.IsNull)
            serializer.WriteSimpleAttribute("HasMinorGridLines", this.HasMinorGridlines);
              if (!this.majorTickMark.IsNull)
            serializer.WriteSimpleAttribute("MajorTickMark", this.MajorTickMark);
              if (!this.minorTickMark.IsNull)
            serializer.WriteSimpleAttribute("MinorTickMark", this.MinorTickMark);

              if (!this.IsNull("Title"))
            this.title.Serialize(serializer);

              if (!this.IsNull("LineFormat"))
            this.lineFormat.Serialize(serializer);

              if (!this.IsNull("MajorGridlines"))
            this.majorGridlines.Serialize(serializer);

              if (!this.IsNull("MinorGridlines"))
            this.minorGridlines.Serialize(serializer);

              if (!this.IsNull("TickLabels"))
            this.tickLabels.Serialize(serializer);

              serializer.EndAttributes(pos);
        }
开发者ID:dankennedy,项目名称:MigraDoc,代码行数:44,代码来源:Axis.cs


注:本文中的Serializer.BeginAttributes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。