本文整理汇总了C#中System.Xml.Schema.XmlSchema.DeepClone方法的典型用法代码示例。如果您正苦于以下问题:C# XmlSchema.DeepClone方法的具体用法?C# XmlSchema.DeepClone怎么用?C# XmlSchema.DeepClone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Schema.XmlSchema
的用法示例。
在下文中一共展示了XmlSchema.DeepClone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetChameleonSchema
private XmlSchema GetChameleonSchema(string targetNamespace, XmlSchema schema)
{
ChameleonKey key = new ChameleonKey(targetNamespace, schema);
XmlSchema schema2 = (XmlSchema) this.chameleonSchemas[key];
if (schema2 == null)
{
schema2 = schema.DeepClone();
schema2.IsChameleon = true;
schema2.TargetNamespace = targetNamespace;
this.chameleonSchemas.Add(key, schema2);
schema2.SourceUri = schema.SourceUri;
schema.IsProcessing = false;
}
return schema2;
}
示例2: GetChameleonSchema
private XmlSchema GetChameleonSchema(string targetNamespace, XmlSchema schema) {
ChameleonKey cKey = new ChameleonKey(targetNamespace, schema);
XmlSchema chameleonSchema = (XmlSchema)chameleonSchemas[cKey]; //Need not clone if a schema for that namespace already exists
if (chameleonSchema == null) {
chameleonSchema = schema.DeepClone(); //It is ok that we dont lock the clone since no one else has access to it yet
chameleonSchema.IsChameleon = true;
chameleonSchema.TargetNamespace = targetNamespace;
chameleonSchemas.Add(cKey, chameleonSchema);
chameleonSchema.SourceUri = schema.SourceUri;
//Handle the original schema that was added to lockList before cloning occurred
schema.IsProcessing = false; //Since we cloned it for the chameleon
}
return chameleonSchema;
}