本文整理汇总了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...");
}
}
示例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());
}
示例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;
}
}
示例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);
//.........这里部分代码省略.........