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


C# DocumentObject.GetType方法代码示例

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


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

示例1: RenderElement

    void RenderElement(DocumentObject docObj)
    {
      string typeName = docObj.GetType().Name;
      switch (typeName)
      {
        case "Text":
          if (IsBlank(docObj))
            RenderBlank();
          else if (IsSoftHyphen(docObj))
            RenderSoftHyphen();
          else
            RenderText((Text)docObj);
          break;

        case "Character":
          RenderCharacter((Character)docObj);
          break;

        case "DateField":
          RenderDateField((DateField)docObj);
          break;

        case "InfoField":
          RenderInfoField((InfoField)docObj);
          break;

        case "NumPagesField":
          RenderNumPagesField((NumPagesField)docObj);
          break;

        case "PageField":
          RenderPageField((PageField)docObj);
          break;

        case "SectionField":
          RenderSectionField((SectionField)docObj);
          break;

        case "SectionPagesField":
          RenderSectionPagesField((SectionPagesField)docObj);
          break;

        case "BookmarkField":
          RenderBookmarkField();
          break;

        case "PageRefField":
          RenderPageRefField((PageRefField)docObj);
          break;

        case "Image":
          RenderImage((Image)docObj);
          break;
        //        default:
        //          throw new NotImplementedException(typeName + " is coming soon...");
      }
    }
开发者ID:DavidS,项目名称:MigraDoc,代码行数:57,代码来源:ParagraphRenderer.cs

示例2: ParentAlreadySet

 public static string ParentAlreadySet(DocumentObject value, DocumentObject docObject)
 {
     return String.Format("Value of type '{0}' must be cloned before set into '{1}'.",
     value.GetType().ToString(), docObject.GetType().ToString());
 }
开发者ID:dankennedy,项目名称:MigraDoc,代码行数:5,代码来源:DomSR.cs

示例3: FormatElement

    /// <summary>
    /// Processes the elements when formatting.
    /// </summary>
    /// <param name="docObj"></param>
    /// <returns></returns>
    FormatResult FormatElement(DocumentObject docObj)
    {
      switch (docObj.GetType().Name)
      {
        case "Text":
          if (IsBlank(docObj))
            return FormatBlank();
          else if (IsSoftHyphen(docObj))
            return FormatSoftHyphen();
          else
            return FormatText((Text)docObj);

        case "Character":
          return FormatCharacter((Character)docObj);

        case "DateField":
          return FormatDateField((DateField)docObj);

        case "InfoField":
          return FormatInfoField((InfoField)docObj);

        case "NumPagesField":
          return FormatNumPagesField((NumPagesField)docObj);

        case "PageField":
          return FormatPageField((PageField)docObj);

        case "SectionField":
          return FormatSectionField((SectionField)docObj);

        case "SectionPagesField":
          return FormatSectionPagesField((SectionPagesField)docObj);

        case "BookmarkField":
          return FormatBookmarkField((BookmarkField)docObj);

        case "PageRefField":
          return FormatPageRefField((PageRefField)docObj);

        case "Image":
          return FormatImage((Image)docObj);

        default:
          return FormatResult.Continue;
      }
    }
开发者ID:DavidS,项目名称:MigraDoc,代码行数:51,代码来源:ParagraphRenderer.cs

示例4: CreateRenderer

    /// <summary>
    /// Dynamically creates a renderer for the given document object.
    /// </summary>
    internal static RendererBase CreateRenderer(DocumentObject domObj, RtfDocumentRenderer docRenderer)
    {
      switch (domObj.GetType().Name)
      {
        case "Style":
          return new StyleRenderer(domObj, docRenderer);

        case "ParagraphFormat":
          return new ParagraphFormatRenderer(domObj, docRenderer);

        case "Font":
          return new FontRenderer(domObj, docRenderer);

        case "Borders":
          return new BordersRenderer(domObj, docRenderer);

        case "Border":
          return new BorderRenderer(domObj, docRenderer);

        case "TabStops":
          return new TabStopsRenderer(domObj, docRenderer);

        case "TabStop":
          return new TabStopRenderer(domObj, docRenderer);

        case "Section":
          return new SectionRenderer(domObj, docRenderer);

        case "PageSetup":
          return new PageSetupRenderer(domObj, docRenderer);

        case "Paragraph":
          return new ParagraphRenderer(domObj, docRenderer);

        case "Text":
          return new TextRenderer(domObj, docRenderer);

        case "FormattedText":
          return new FormattedTextRenderer(domObj, docRenderer);

        case "Character":
          return new CharacterRenderer(domObj, docRenderer);
        //Fields start
        case "BookmarkField":
          return new BookmarkFieldRenderer(domObj, docRenderer);

        case "PageField":
          return new PageFieldRenderer(domObj, docRenderer);

        case "PageRefField":
          return new PageRefFieldRenderer(domObj, docRenderer);

        case "NumPagesField":
          return new NumPagesFieldRenderer(domObj, docRenderer);

        case "SectionField":
          return new SectionFieldRenderer(domObj, docRenderer);

        case "SectionPagesField":
          return new SectionPagesFieldRenderer(domObj, docRenderer);

        case "InfoField":
          return new InfoFieldRenderer(domObj, docRenderer);

        case "DateField":
          return new DateFieldRenderer(domObj, docRenderer);
        //Fields end
        case "Hyperlink":
          return new HyperlinkRenderer(domObj, docRenderer);

        case "Footnote":
          return new FootnoteRenderer(domObj, docRenderer);

        case "ListInfo":
          return new ListInfoRenderer(domObj, docRenderer);

        case "Image":
          return new ImageRenderer(domObj, docRenderer);

        case "TextFrame":
          return new TextFrameRenderer(domObj, docRenderer);

        case "Chart":
          return new ChartRenderer(domObj, docRenderer);

        case "HeadersFooters":
          return new HeadersFootersRenderer(domObj, docRenderer);

        case "HeaderFooter":
          return new HeaderFooterRenderer(domObj, docRenderer);

        case "PageBreak":
          return new PageBreakRenderer(domObj, docRenderer);
        //Table
        case "Table":
          return new TableRenderer(domObj, docRenderer);

//.........这里部分代码省略.........
开发者ID:GorelH,项目名称:PdfSharp,代码行数:101,代码来源:RendererFactory.cs


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