本文整理匯總了C#中System.Xml.Schema.XmlSchemaObject.GetLocalPath方法的典型用法代碼示例。如果您正苦於以下問題:C# XmlSchemaObject.GetLocalPath方法的具體用法?C# XmlSchemaObject.GetLocalPath怎麽用?C# XmlSchemaObject.GetLocalPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.Schema.XmlSchemaObject
的用法示例。
在下文中一共展示了XmlSchemaObject.GetLocalPath方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AddEmbeddedDocumenation
private void AddEmbeddedDocumenation(XmlNamespaceManager namespaceManager, XmlSchemaObject documentatbleObject)
{
var sourceCode = Context.SourceCodeManager.GetSourceCode(documentatbleObject);
if (string.IsNullOrEmpty(sourceCode))
return;
using (var stringReader = new StringReader(sourceCode))
using (var xmlReader = new XmlTextReader(stringReader))
using (var stringWriter = new StringWriter())
using (var xmlTextWriter = new XmlTextWriter(stringWriter))
{
var argumentList = GetXsltArgumentList(documentatbleObject);
try
{
_compiledTransform.Transform(xmlReader, argumentList, xmlTextWriter);
}
catch (Exception ex)
{
var fileName = documentatbleObject.GetLocalPath();
throw ExceptionBuilder.ErrorTransformingInlineDocumentation(fileName, ex);
}
var doc = new XmlDocument();
try
{
doc.LoadXml(stringWriter.ToString());
}
catch (Exception)
{
return;
}
var documentationInfo = GetOrCreateDocumentationInfo(documentatbleObject);
var schemaDocElement = doc.SelectSingleNode("xsd:schemaDoc", namespaceManager);
InitializeDocumentationInfo(documentatbleObject, documentationInfo, schemaDocElement, namespaceManager);
}
}