本文整理汇总了C#中Genetibase.NuGenHL7.model.Message.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Genetibase.NuGenHL7.model.Message.GetType方法的具体用法?C# Genetibase.NuGenHL7.model.Message.GetType怎么用?C# Genetibase.NuGenHL7.model.Message.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Genetibase.NuGenHL7.model.Message
的用法示例。
在下文中一共展示了Genetibase.NuGenHL7.model.Message.GetType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: encodeDocument
/// <summary> <p>Creates an XML Document that corresponds to the given Message object. </p>
/// <p>If you are implementing this method, you should create an XML Document, and insert XML Elements
/// into it that correspond to the groups and segments that belong to the message type that your subclass
/// of XMLParser supports. Then, for each segment in the message, call the method
/// <code>encode(Segment segmentObject, Element segmentElement)</code> using the Element for
/// that segment and the corresponding Segment object from the given Message.</p>
/// </summary>
public override System.Xml.XmlDocument encodeDocument(Message source)
{
System.String messageClassName = source.GetType().FullName;
System.String messageName = messageClassName.Substring(messageClassName.LastIndexOf('.') + 1);
System.Xml.XmlDocument doc = null;
try
{
doc = new System.Xml.XmlDocument();
System.Xml.XmlElement root = doc.CreateElement(messageName);
doc.AppendChild(root);
}
catch (System.Exception e)
{
throw new NuGenHL7Exception("Can't create XML document - " + e.GetType().FullName, NuGenHL7Exception.APPLICATION_INTERNAL_ERROR, e);
}
encode(source, (System.Xml.XmlElement) doc.DocumentElement);
return doc;
}