本文整理匯總了C#中System.Xml.Schema.XmlSchemaElement.IsGlobal方法的典型用法代碼示例。如果您正苦於以下問題:C# XmlSchemaElement.IsGlobal方法的具體用法?C# XmlSchemaElement.IsGlobal怎麽用?C# XmlSchemaElement.IsGlobal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.Schema.XmlSchemaElement
的用法示例。
在下文中一共展示了XmlSchemaElement.IsGlobal方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: BuildProperty
private ClrPropertyInfo BuildProperty(XmlSchemaElement elem, bool fromBaseType)
{
string identifierName = localSymbolTable.AddLocalElement(elem);
XmlSchemaType schemaType = elem.ElementSchemaType;
XmlQualifiedName schemaTypeName = schemaType.QualifiedName;
string schemaName = elem.QualifiedName.Name;
string schemaNs = elem.QualifiedName.Namespace;
string clrNs =
elem.FormResolved() == XmlSchemaForm.Qualified ?
configSettings.GetClrNamespace(schemaNs) : string.Empty;
SchemaOrigin typeRefOrigin = SchemaOrigin.Fragment;
bool isTypeRef = false;
bool anonymousType = schemaTypeName.IsEmpty;
XmlSchemaObject schemaObject = schemaType;
ArrayList substitutionMembers = null;
if (elem.IsGlobal())
{
substitutionMembers = IsSubstitutionGroupHead(elem);
schemaTypeName = elem.QualifiedName;
isTypeRef = true;
typeRefOrigin = SchemaOrigin.Element;
// For ref, get the element decl SOM object, as nameMappings are
// keyed off the SOM object
schemaObject = schemas.GlobalElements[schemaTypeName];
anonymousType = false;
}
ClrTypeReference typeRef = BuildTypeReference(
schemaObject, schemaTypeName, anonymousType, true);
typeRef.Origin = typeRefOrigin;
typeRef.IsTypeRef = isTypeRef;
if (anonymousType && !fromBaseType)
{
//to fixup later.
localSymbolTable.AddAnonymousType(identifierName, elem, typeRef);
}
ClrPropertyInfo propertyInfo =
new ClrPropertyInfo(
identifierName, schemaNs, schemaName, GetOccurence(elem));
propertyInfo.Origin = SchemaOrigin.Element;
propertyInfo.FromBaseType = fromBaseType;
propertyInfo.TypeReference = typeRef;
//SetFixedDefaultValue(elem, propertyInfo);
if (substitutionMembers != null)
{
propertyInfo.SubstitutionMembers = substitutionMembers;
}
//BuildAnnotationInformation(propertyInfo, elem);
return propertyInfo;
//Place it in the element's namespace, maybe element's parent type's namespace?
}