本文整理汇总了C#中System.Xml.XmlQualifiedName类的典型用法代码示例。如果您正苦于以下问题:C# XmlQualifiedName类的具体用法?C# XmlQualifiedName怎么用?C# XmlQualifiedName使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
XmlQualifiedName类属于System.Xml命名空间,在下文中一共展示了XmlQualifiedName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SamlAuthorityBinding
public SamlAuthorityBinding(XmlQualifiedName authorityKind, string binding, string location)
{
this.AuthorityKind = authorityKind;
this.Binding = binding;
this.Location = location;
this.CheckObjectValidity();
}
示例2: IsSpecialXmlType
internal static bool IsSpecialXmlType(Type type, out XmlQualifiedName typeName, out XmlSchemaType xsdType, out bool hasRoot)
{
xsdType = null;
hasRoot = true;
if (type == Globals.TypeOfXmlElement || type == Globals.TypeOfXmlNodeArray)
{
string name = null;
if (type == Globals.TypeOfXmlElement)
{
xsdType = CreateAnyElementType();
name = "XmlElement";
hasRoot = false;
}
else
{
xsdType = CreateAnyType();
name = "ArrayOfXmlNode";
hasRoot = true;
}
typeName = new XmlQualifiedName(name, DataContract.GetDefaultStableNamespace(type));
return true;
}
typeName = null;
return false;
}
示例3: FaultException
public FaultException(string action, string reason, XmlQualifiedName code, IEnumerable<XmlQualifiedName> subcodes)
{
_action = action;
_reason = reason;
_code = code;
_subcodes = subcodes.ToList();
}
示例4: AddElementToSchema
void AddElementToSchema(XmlSchemaElement element, string elementNs, XmlSchemaSet schemaSet)
{
OperationDescription parentOperation = this.operation;
if (parentOperation.OperationMethod != null)
{
XmlQualifiedName qname = new XmlQualifiedName(element.Name, elementNs);
OperationElement existingElement;
if (ExportedMessages.ElementTypes.TryGetValue(qname, out existingElement))
{
if (existingElement.Operation.OperationMethod == parentOperation.OperationMethod)
return;
if (!SchemaHelper.IsMatch(element, existingElement.Element))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.CannotHaveTwoOperationsWithTheSameElement5, parentOperation.OperationMethod.DeclaringType, parentOperation.OperationMethod.Name, qname, existingElement.Operation.OperationMethod.DeclaringType, existingElement.Operation.Name)));
}
return;
}
else
{
ExportedMessages.ElementTypes.Add(qname, new OperationElement(element, parentOperation));
}
}
SchemaHelper.AddElementToSchema(element, SchemaHelper.GetSchema(elementNs, schemaSet), schemaSet);
}
示例5: ValidateElement
public override object ValidateElement(XmlQualifiedName name, ValidationState context, out int errorCode)
{
object obj2 = this.elements[name];
errorCode = 0;
if (obj2 == null)
{
context.NeedValidateChildren = false;
return null;
}
int index = (int) obj2;
if (context.AllElementsSet[index])
{
errorCode = -2;
return null;
}
if (context.CurrentState.AllElementsRequired == -1)
{
context.CurrentState.AllElementsRequired = 0;
}
context.AllElementsSet.Set(index);
if (this.isRequired[index])
{
context.CurrentState.AllElementsRequired++;
}
return this.particles[index];
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:26,代码来源:AllElementsContentValidator.cs
示例6: AddSymbol
protected SymbolEntry AddSymbol(
XmlQualifiedName qname, XmlSchemaObject schemaObject, string suffix)
{
SymbolEntry symbol = new SymbolEntry();
symbol.xsdNamespace = qname.Namespace;
symbol.clrNamespace = configSettings.GetClrNamespace(qname.Namespace);
symbol.symbolName = qname.Name;
string identifierName = NameGenerator.MakeValidIdentifier(
symbol.symbolName, this.configSettings.NameMangler2);
symbol.identifierName = identifierName;
int id = 0;
if(symbols.ContainsKey(symbol))
{
identifierName = identifierName + suffix;
symbol.identifierName = identifierName;
while (symbols.ContainsKey(symbol))
{
id++;
symbol.identifierName = identifierName + id.ToString(CultureInfo.InvariantCulture.NumberFormat);
}
}
if(symbol.isNameFixed())
nFixedNames++;
symbols.Add(symbol, symbol);
schemaNameToIdentifiers.Add(schemaObject, symbol.identifierName); //Type vs typeName
return symbol;
}
示例7: XmlFragmentReader
/// <summary>
/// Instantiates the reader using the given <paramref name="rootName"/> for the virtual root node.
/// </summary>
/// <param name="baseReader">XML fragment reader.</param>
/// <param name="rootName">Qualified name of the virtual root element.</param>
public XmlFragmentReader(XmlQualifiedName rootName, XmlReader baseReader)
: base(baseReader)
{
Guard.ArgumentNotNull(rootName, "rootName");
Initialize(rootName);
}
示例8: QueryOutputWriterV1
public QueryOutputWriterV1(XmlWriter writer, XmlWriterSettings settings)
{
_wrapped = writer;
_systemId = settings.DocTypeSystem;
_publicId = settings.DocTypePublic;
if (settings.OutputMethod == XmlOutputMethod.Xml)
{
bool documentConformance = false;
// Xml output method shouldn't output doc-type-decl if system ID is not defined (even if public ID is)
// Only check for well-formed document if output method is xml
if (_systemId != null)
{
documentConformance = true;
_outputDocType = true;
}
// Check for well-formed document if standalone="yes" in an auto-generated xml declaration
if (settings.Standalone == XmlStandalone.Yes)
{
documentConformance = true;
_standalone = settings.Standalone;
}
if (documentConformance)
{
if (settings.Standalone == XmlStandalone.Yes)
{
_wrapped.WriteStartDocument(true);
}
else
{
_wrapped.WriteStartDocument();
}
}
if (settings.CDataSectionElements != null && settings.CDataSectionElements.Count > 0)
{
_bitsCData = new BitStack();
_lookupCDataElems = new Dictionary<XmlQualifiedName, XmlQualifiedName>();
_qnameCData = new XmlQualifiedName();
// Add each element name to the lookup table
foreach (XmlQualifiedName name in settings.CDataSectionElements)
{
_lookupCDataElems[name] = null;
}
_bitsCData.PushBit(false);
}
}
else if (settings.OutputMethod == XmlOutputMethod.Html)
{
// Html output method should output doc-type-decl if system ID or public ID is defined
if (_systemId != null || _publicId != null)
_outputDocType = true;
}
}
示例9: CheckValueFacets
internal override Exception CheckValueFacets(XmlQualifiedName value, XmlSchemaDatatype datatype)
{
RestrictionFacets restriction = datatype.Restriction;
RestrictionFlags flags = (restriction != null) ? restriction.Flags : ((RestrictionFlags) 0);
if (flags != 0)
{
int length = value.ToString().Length;
if (((flags & RestrictionFlags.Length) != 0) && (restriction.Length != length))
{
return new XmlSchemaException("Sch_LengthConstraintFailed", string.Empty);
}
if (((flags & RestrictionFlags.MinLength) != 0) && (length < restriction.MinLength))
{
return new XmlSchemaException("Sch_MinLengthConstraintFailed", string.Empty);
}
if (((flags & RestrictionFlags.MaxLength) != 0) && (restriction.MaxLength < length))
{
return new XmlSchemaException("Sch_MaxLengthConstraintFailed", string.Empty);
}
if (((flags & RestrictionFlags.Enumeration) != 0) && !this.MatchEnumeration(value, restriction.Enumeration))
{
return new XmlSchemaException("Sch_EnumerationConstraintFailed", string.Empty);
}
}
return null;
}
示例10: AddItem
internal XmlSchemaObject AddItem(XmlSchemaObject item, XmlQualifiedName qname, XmlSchemas schemas)
{
if (item == null)
{
return null;
}
if ((qname == null) || qname.IsEmpty)
{
return null;
}
string str = item.GetType().Name + ":" + qname.ToString();
ArrayList list = (ArrayList) this.ObjectCache[str];
if (list == null)
{
list = new ArrayList();
this.ObjectCache[str] = list;
}
for (int i = 0; i < list.Count; i++)
{
XmlSchemaObject obj2 = (XmlSchemaObject) list[i];
if (obj2 == item)
{
return obj2;
}
if (this.Match(obj2, item, true))
{
return obj2;
}
this.Warnings.Add(Res.GetString("XmlMismatchSchemaObjects", new object[] { item.GetType().Name, qname.Name, qname.Namespace }));
this.Warnings.Add("DEBUG:Cached item key:\r\n" + ((string) this.looks[obj2]) + "\r\nnew item key:\r\n" + ((string) this.looks[item]));
}
list.Add(item);
return item;
}
示例11: SoapException
public SoapException (string message, XmlQualifiedName code, string actor, XmlNode detail)
: base (message)
{
this.code = code;
this.actor = actor;
this.detail = detail;
}
示例12: AddBindingParameters
/**
* The execution of this behavior comes rather late.
* Anyone that inspects the service description in the meantime,
* such as for metadata generation, won't see the protection level that we want to use.
*
* One way of doing it is at when create HostFactory
*
* ServiceEndpoint endpoint = host.Description.Endpoints.Find(typeof(IService));
* OperationDescription operation = endpoint.Contract.Operations.Find("Action");
* MessageDescription message = operation.Messages.Find("http://tempuri.org/IService/ActionResponse");
* MessageHeaderDescription header = message.Headers[new XmlQualifiedName("aheader", "http://tempuri.org/")];
* header.ProtectionLevel = ProtectionLevel.Sign;
*
* **/
public void AddBindingParameters(ContractDescription contractDescription, ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
{
ChannelProtectionRequirements requirements = bindingParameters.Find<ChannelProtectionRequirements>();
XmlQualifiedName qName = new XmlQualifiedName(header, ns);
MessagePartSpecification part = new MessagePartSpecification(qName);
requirements.OutgoingSignatureParts.AddParts(part, action);
}
示例13: Compile
// 1. name and public must be present
// public and system must be anyURI
internal override int Compile(ValidationEventHandler h, XmlSchema schema)
{
// If this is already compiled this time, simply skip.
if (CompilationId == schema.CompilationId)
return 0;
if(Name == null)
error(h,"Required attribute name must be present");
else if(!XmlSchemaUtil.CheckNCName(this.name))
error(h,"attribute name must be NCName");
else
qualifiedName = new XmlQualifiedName(Name, AncestorSchema.TargetNamespace);
if(Public==null)
error(h,"public must be present");
else if(!XmlSchemaUtil.CheckAnyUri(Public))
error(h,"public must be anyURI");
if(system != null && !XmlSchemaUtil.CheckAnyUri(system))
error(h,"system must be present and of Type anyURI");
XmlSchemaUtil.CompileID(Id,this,schema.IDCollection,h);
return errorCount;
}
示例14: Binding
public Binding ()
{
extensions = new ServiceDescriptionFormatExtensionCollection (this);
operations = new OperationBindingCollection (this);
serviceDescription = null;
type = XmlQualifiedName.Empty;
}
示例15: RemoveParam
public object RemoveParam(string name, string namespaceUri)
{
XmlQualifiedName key = new XmlQualifiedName(name, namespaceUri);
object obj2 = this.parameters[key];
this.parameters.Remove(key);
return obj2;
}