本文整理匯總了C#中System.Xml.Serialization.XmlTypeMapping.CheckShallow方法的典型用法代碼示例。如果您正苦於以下問題:C# XmlTypeMapping.CheckShallow方法的具體用法?C# XmlTypeMapping.CheckShallow怎麽用?C# XmlTypeMapping.CheckShallow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.Serialization.XmlTypeMapping
的用法示例。
在下文中一共展示了XmlTypeMapping.CheckShallow方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ExportTypeMapping
/// <include file='doc\XmlCodeExporter.uex' path='docs/doc[@for="XmlCodeExporter.ExportTypeMapping"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public void ExportTypeMapping(XmlTypeMapping xmlTypeMapping) {
xmlTypeMapping.CheckShallow();
CheckScope(xmlTypeMapping.Scope);
if (xmlTypeMapping.Accessor.Any) throw new InvalidOperationException(Res.GetString(Res.XmlIllegalWildcard));
ExportElement(xmlTypeMapping.Accessor);
}
示例2: ExportTypeMapping
/// <include file='doc\XmlSchemaExporter.uex' path='docs/doc[@for="XmlSchemaExporter.ExportTypeMapping"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public void ExportTypeMapping(XmlTypeMapping xmlTypeMapping)
{
xmlTypeMapping.CheckShallow();
CheckScope(xmlTypeMapping.Scope);
ExportElement(xmlTypeMapping.Accessor);
ExportRootIfNecessary(xmlTypeMapping.Scope);
}
示例3: AddMappingMetadata
/// <include file='doc\XmlCodeExporter.uex' path='docs/doc[@for="XmlCodeExporter.AddMappingMetadata"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public void AddMappingMetadata(CodeAttributeDeclarationCollection metadata, XmlTypeMapping mapping, string ns) {
mapping.CheckShallow();
CheckScope(mapping.Scope);
// For struct or enum mappings, we generate the XmlRoot on the struct/class/enum. For primitives
// or arrays, there is nowhere to generate the XmlRoot, so we generate it elsewhere (on the
// method for web services get/post).
if (mapping.Mapping is StructMapping || mapping.Mapping is EnumMapping) return;
AddRootMetadata(metadata, mapping.Mapping, Accessor.UnescapeName(mapping.Accessor.Name), mapping.Accessor.Namespace, mapping.Accessor);
}
示例4: ExportTypeMapping
public void ExportTypeMapping(XmlTypeMapping xmlTypeMapping)
{
xmlTypeMapping.CheckShallow();
base.CheckScope(xmlTypeMapping.Scope);
this.ExportElement(xmlTypeMapping.Accessor);
}
示例5: AddMappingMetadata
public void AddMappingMetadata(CodeAttributeDeclarationCollection metadata, XmlTypeMapping mapping, string ns)
{
mapping.CheckShallow();
base.CheckScope(mapping.Scope);
if (!(mapping.Mapping is StructMapping) && !(mapping.Mapping is EnumMapping))
{
this.AddRootMetadata(metadata, mapping.Mapping, Accessor.UnescapeName(mapping.Accessor.Name), mapping.Accessor.Namespace, mapping.Accessor);
}
}