本文整理匯總了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;
}