public void AddParam(String name, String namespaceUri, Object parameter) { XmlQualifiedName qName; if(namespaceUri == null) { throw new ArgumentException("namespaceUri"); } if(namespaceUri == "http://www.w3.org/1999/XSL/Transform") { throw new ArgumentException("namespaceUri"); } if(name == null) { throw new ArgumentException("name"); } qName = new XmlQualifiedName(name, namespaceUri); if(parameters.Contains(qName)) { throw new ArgumentException("namespaceUri"); } parameter = ValidateParam(parameter); parameters[qName] = parameter; }
public object RemoveParam(string name, string namespaceUri) { XmlQualifiedName qname = new XmlQualifiedName(name, namespaceUri); object parameter = _parameters[qname]; _parameters.Remove(qname); return parameter; }
/// <include file='doc\XsltArgumentList.uex' path='docs/doc[@for="XsltArgumentList.AddParam"]/*' /> /// <devdoc> /// <para>[To be supplied.]</para> /// </devdoc> public void AddParam(string name, string namespaceUri, object parameter) { CheckArgumentNull(name , "name" ); CheckArgumentNull(namespaceUri, "namespaceUri"); CheckArgumentNull(parameter , "parameter" ); ValidateParamNamespace(namespaceUri); if ( parameter is XPathNodeIterator || parameter is XPathNavigator || parameter is Boolean || parameter is Double || parameter is String ) { // doing nothing } else if ( parameter is Int16 || parameter is UInt16 || parameter is Int32 || parameter is UInt32 || parameter is Int64 || parameter is UInt64 || parameter is Single || parameter is Decimal ) { parameter = XmlConvert.ToXPathDouble(parameter); } else { parameter = parameter.ToString(); } XmlQualifiedName qname = new XmlQualifiedName(name, namespaceUri); qname.Verify(); this.parameters.Add(qname, parameter); }
internal void StartParsing(XmlReader reader, string targetNamespace, SchemaInfo schemaInfo) { this.reader = reader; positionInfo = PositionInfo.GetPositionInfo(reader); this.namespaceManager = reader.NamespaceManager; if (this.namespaceManager == null) { this.namespaceManager = new XmlNamespaceManager(this.nameTable); this.isProcessNamespaces = true; } else { this.isProcessNamespaces = false; } while (this.reader.NodeType != XmlNodeType.Element && this.reader.Read()) {} this.markupDepth = int.MaxValue; this.schemaXmlDepth = reader.Depth; XmlQualifiedName qname = new XmlQualifiedName(this.reader.LocalName, XmlSchemaDatatype.XdrCanonizeUri(this.reader.NamespaceURI, this.nameTable, this.schemaNames)); if (this.schemaNames.IsXDRRoot(qname)) { Debug.Assert(schemaInfo != null); schemaInfo.SchemaType = SchemaType.XDR; this.schema = null; this.builder = new XdrBuilder(reader, this.namespaceManager, schemaInfo, targetNamespace, this.nameTable, this.schemaNames, this.validationEventHandler); } else if (this.schemaNames.IsXSDRoot(qname)) { if (schemaInfo != null) { schemaInfo.SchemaType = SchemaType.XSD; } this.schema = new XmlSchema(); this.schema.BaseUri = reader.BaseURI; this.builder = new XsdBuilder(reader, this.namespaceManager, this.schema, this.nameTable, this.schemaNames, this.validationEventHandler); } else { throw new XmlSchemaException(Res.Sch_SchemaRootExpected, reader.BaseURI, positionInfo.LineNumber, positionInfo.LinePosition); } }
public CompiledIdentityConstraint(XmlSchemaIdentityConstraint constraint, XmlNamespaceManager nsmgr) { this.name = constraint.QualifiedName; //public Asttree (string xPath, bool isField, XmlNamespaceManager nsmgr) try { this.selector = new Asttree(constraint.Selector.XPath, false, nsmgr); } catch (XmlSchemaException e) { e.SetSource(constraint.Selector); throw e; } XmlSchemaObjectCollection fields = constraint.Fields; Debug.Assert(fields.Count > 0); this.fields = new Asttree[fields.Count]; for(int idxField = 0; idxField < fields.Count; idxField ++) { try { this.fields[idxField] = new Asttree(((XmlSchemaXPath)fields[idxField]).XPath, true, nsmgr); } catch (XmlSchemaException e) { e.SetSource(constraint.Fields[idxField]); throw e; } } if (constraint is XmlSchemaUnique) { this.role = ConstraintRole.Unique; } else if (constraint is XmlSchemaKey) { this.role = ConstraintRole.Key; } else { // XmlSchemaKeyref this.role = ConstraintRole.Keyref; this.refer = ((XmlSchemaKeyref)constraint).Refer; } }
IDtdAttributeInfo IDtdAttributeListInfo.LookupAttribute(string prefix, string localName) { XmlQualifiedName qname = new XmlQualifiedName(localName, prefix); SchemaAttDef attDef; if (attdefs.TryGetValue(qname, out attDef)) { return attDef; } return null; }
/// <devdoc> /// <para>[To be supplied.]</para> /// </devdoc> public static XmlSchemaSimpleType GetBuiltInSimpleType(XmlQualifiedName qualifiedName) { if (qualifiedName == null) { throw new ArgumentNullException(nameof(qualifiedName)); } return DatatypeImplementation.GetSimpleTypeFromXsdType(qualifiedName); }
internal object this[XmlQualifiedName qname] { get { return table[new NameKey(qname.Name, qname.Namespace)]; } set { table[new NameKey(qname.Name, qname.Namespace)] = value; } }
protected List<string> values; // array of values for enumerated and notation types #endif protected SchemaDeclBase(XmlQualifiedName name, string prefix) { this.name = name; this.prefix = prefix; #if !SILVERLIGHT maxLength = -1; minLength = -1; #endif }
/// <include file='doc\XmlSerializerNamespaces.uex' path='docs/doc[@for="XmlSerializerNamespaces.XmlSerializerNamespaces2"]/*' /> /// <devdoc> /// <para>[To be supplied.]</para> /// </devdoc> public XmlSerializerNamespaces(XmlQualifiedName[] namespaces) { for (int i = 0; i < namespaces.Length; i++) { XmlQualifiedName qname = namespaces[i]; Add(qname.Name, qname.Namespace); } }
public XmlSerializerNamespaces(XmlQualifiedName[] namespaces) : this() { foreach(XmlQualifiedName qname in namespaces) { this.namespaces.Add (qname.Name, qname); } }
public void AddParam(string name, string namespaceUri, object parameter) { CheckArgumentNull(name , "name" ); CheckArgumentNull(namespaceUri, "namespaceUri"); CheckArgumentNull(parameter , "parameter" ); XmlQualifiedName qname = new XmlQualifiedName(name, namespaceUri); qname.Verify(); this.parameters.Add(qname, parameter); }
public BaseValidator(XmlValidatingReaderImpl reader, XmlSchemaCollection schemaCollection, ValidationEventHandler eventHandler) { Debug.Assert(schemaCollection == null || schemaCollection.NameTable == reader.NameTable); this.reader = reader; this.schemaCollection = schemaCollection; this.eventHandler = eventHandler; nameTable = reader.NameTable; positionInfo = PositionInfo.GetPositionInfo(reader); elementName = new XmlQualifiedName(); }
// --------------------------- XsltContext ------------------- // Resolving variables and functions public override IXsltContextVariable ResolveVariable(string prefix, string name) { string namespaceURI = this.LookupNamespace(prefix); XmlQualifiedName qname = new XmlQualifiedName(name, namespaceURI); IXsltContextVariable variable = this.manager.VariableScope.ResolveVariable(qname); if (variable == null) { throw XsltException.Create(Res.Xslt_InvalidVariable, qname.ToString()); } return variable; }
private void Init() { Debug.Assert(reader != null); validationStack = new HWStack(STACK_INCREMENT); textValue = new StringBuilder(); name = XmlQualifiedName.Empty; attPresence = new Hashtable(); schemaInfo = new SchemaInfo(); checkDatatype = false; Push(name); }
internal void Remove(XmlQualifiedName name) { XmlSchemaObject value; if (table.TryGetValue(name, out value)) { table.Remove(name); int matchedIndex = FindIndexByValue(value); Debug.Assert(matchedIndex >= 0); Debug.Assert(entries[matchedIndex].qname == name); entries.RemoveAt(matchedIndex); } }
public void AddParam(string name, string namespaceUri, object parameter) { CheckArgumentNull(name, nameof(name)); CheckArgumentNull(namespaceUri, nameof(namespaceUri)); CheckArgumentNull(parameter, nameof(parameter)); XmlQualifiedName qname = new XmlQualifiedName(name, namespaceUri); qname.Verify(); _parameters.Add(qname, parameter); }
internal void Replace(XmlQualifiedName name, XmlSchemaObject value) { XmlSchemaObject oldValue; if (table.TryGetValue(name, out oldValue)) { table[name] = value; //set new value Debug.Assert(oldValue != null); int matchedIndex = FindIndexByValue(oldValue); Debug.Assert(entries[matchedIndex].qname == name); entries[matchedIndex] = new XmlSchemaObjectEntry(name, value); } }
public BaseValidator(BaseValidator other) { reader = other.reader; schemaCollection = other.schemaCollection; eventHandler = other.eventHandler; nameTable = other.nameTable; schemaNames = other.schemaNames; positionInfo = other.positionInfo; xmlResolver = other.xmlResolver; baseUri = other.baseUri; elementName = other.elementName; }
/// <include file='doc\XmlSchemaImporter.uex' path='docs/doc[@for="XmlSchemaImporter.ImportDerivedTypeMapping1"]/*' /> /// <devdoc> /// <para>[To be supplied.]</para> /// </devdoc> public XmlTypeMapping ImportDerivedTypeMapping(XmlQualifiedName name, Type baseType, bool baseTypeCanBeIndirect) { ElementAccessor element = ImportElement(EncodeQName(name), typeof(TypeMapping), baseType); if (element.Mapping is StructMapping) { MakeDerived((StructMapping)element.Mapping, baseType, baseTypeCanBeIndirect); } else if (baseType != null) { // Element '{0}' from namespace '{1}' is not a complex type and cannot be used as a {2}. throw new InvalidOperationException(Res.GetString(Res.XmlBadBaseType, name.Name, name.Namespace, baseType.FullName)); } return new XmlTypeMapping(scope, element); }
/// <include file='doc\XmlSchemaType.uex' path='docs/doc[@for="XmlSchemaType.GetXsdComplexType"]/*' /> /// <devdoc> /// <para>[To be supplied.]</para> /// </devdoc> public static XmlSchemaComplexType GetBuiltInComplexType(XmlQualifiedName qualifiedName) { if (qualifiedName == null) { throw new ArgumentNullException("qualifiedName"); } if (qualifiedName.Equals(XmlSchemaComplexType.AnyType.QualifiedName)) { return XmlSchemaComplexType.AnyType; } if (qualifiedName.Equals(XmlSchemaComplexType.UntypedAnyType.QualifiedName)) { return XmlSchemaComplexType.UntypedAnyType; } return null; }
internal object this[XmlQualifiedName qname] { get { object obj; return _table.TryGetValue(new NameKey(qname.Name, qname.Namespace), out obj) ? obj : null; } set { _table[new NameKey(qname.Name, qname.Namespace)] = value; } }
internal override XmlSchemaObject Clone() { if (memberTypes != null && memberTypes.Length > 0) { //Only if the union has MemberTypes defined XmlSchemaSimpleTypeUnion newUnion = (XmlSchemaSimpleTypeUnion)MemberwiseClone(); XmlQualifiedName[] newQNames = new XmlQualifiedName[memberTypes.Length]; for (int i = 0; i < memberTypes.Length; i++) { newQNames[i] = memberTypes[i].Clone(); } newUnion.MemberTypes = newQNames; return newUnion; } return this; }
internal void Reset() { _Name = XmlQualifiedName.Empty; _Prefix = null; _TypeName = XmlQualifiedName.Empty; _TypePrefix = null; _Default = null; _Revises = null; _MaxOccurs = 1; _MinOccurs = 1; _Checking = false; _ElementDecl = null; _Next = null; _Attdef = null; }
private void Init() { nsManager = reader.NamespaceManager; if (nsManager == null) { nsManager = new XmlNamespaceManager(NameTable); isProcessContents = true; } validationStack = new HWStack(STACK_INCREMENT); textValue = new StringBuilder(); name = XmlQualifiedName.Empty; attPresence = new Hashtable(); Push(XmlQualifiedName.Empty); schemaInfo = new SchemaInfo(); checkDatatype = false; }
/// <summary> /// Add name and return it's number /// </summary> public int AddName(XmlQualifiedName name, object particle) { object lookup = names[name]; if (lookup != null) { int symbol = (int)lookup; if (particles[symbol] != particle) { isUpaEnforced = false; } return symbol; } else { names.Add(name, last); particles.Add(particle); Debug.Assert(particles.Count == last + 1); return last ++; } }
internal void Insert(XmlQualifiedName name, XmlSchemaObject value) { XmlSchemaObject oldValue = null; if (_table.TryGetValue(name, out oldValue)) { _table[name] = value; //set new value Debug.Assert(oldValue != null); int matchedIndex = FindIndexByValue(oldValue); Debug.Assert(matchedIndex >= 0); //set new entry Debug.Assert(_entries[matchedIndex].qname == name); _entries[matchedIndex] = new XmlSchemaObjectEntry(name, value); } else { Add(name, value); } }
internal Validator(XmlNameTable nameTable, SchemaNames schemaNames, XmlValidatingReader reader) { this.nameTable = nameTable; this.schemaNames = schemaNames; this.reader = reader; positionInfo = PositionInfo.GetPositionInfo(reader); nsManager = reader.NamespaceManager; if (nsManager == null) { nsManager = new XmlNamespaceManager(nameTable); isProcessContents = true; } SchemaInfo = new SchemaInfo(schemaNames); validationStack = new HWStack(STACK_INCREMENT); textValue = new StringBuilder(); this.name = XmlQualifiedName.Empty; attPresence = new Hashtable(); context = null; attnDef = null; }
internal static string GetMessageAction(XmlQualifiedName contractName, string opname, string action, bool isResponse) { if (action != null) { return action; } StringBuilder builder = new StringBuilder(0x40); if (string.IsNullOrEmpty(contractName.Namespace)) { builder.Append("urn:"); } else { builder.Append(contractName.Namespace); if (!contractName.Namespace.EndsWith("/", StringComparison.Ordinal)) { builder.Append('/'); } } builder.Append(contractName.Name); builder.Append('/'); action = isResponse ? (opname + "Response") : opname; return CombineUriStrings(builder.ToString(), action); }
/// <include file='doc\XmlSchemaImporter.uex' path='docs/doc[@for="XmlSchemaImporter.ImportDerivedTypeMapping1"]/*' /> /// <devdoc> /// <para>[To be supplied.]</para> /// </devdoc> public XmlTypeMapping ImportDerivedTypeMapping(XmlQualifiedName name, Type baseType, bool baseTypeCanBeIndirect) { ElementAccessor element = ImportElement(name, typeof(TypeMapping), baseType); if (element.Mapping is StructMapping) { MakeDerived((StructMapping)element.Mapping, baseType, baseTypeCanBeIndirect); } else if (baseType != null) { if (element.Mapping is ArrayMapping) { // in the case of the ArrayMapping we can use the top-level StructMapping, because it does not have base base type element.Mapping = ((ArrayMapping)element.Mapping).TopLevelMapping; MakeDerived((StructMapping)element.Mapping, baseType, baseTypeCanBeIndirect); } else { // Element '{0}' from namespace '{1}' is not a complex type and cannot be used as a {2}. throw new InvalidOperationException(SR.Format(SR.XmlBadBaseElement, name.Name, name.Namespace, baseType.FullName)); } } return new XmlTypeMapping(Scope, element); }
private Emitter Read14_Emitter(bool isNullable, bool checkType) { XmlQualifiedName xmlQualifiedName = checkType ? base.GetXsiType() : null; bool flag = false; if (isNullable) { flag = base.ReadNull(); } if (checkType && !(xmlQualifiedName == null) && (xmlQualifiedName.Name != this.id8_Emitter || xmlQualifiedName.Namespace != this.id2_Item)) { throw base.CreateUnknownTypeException(xmlQualifiedName); } if (flag) { return(null); } Emitter emitter = new Emitter(); if (emitter.PhoneNumbers == null) { emitter.PhoneNumbers = new List <E164Number>(); } List <E164Number> phoneNumbers = emitter.PhoneNumbers; bool[] array = new bool[4]; while (base.Reader.MoveToNextAttribute()) { if (!base.IsXmlnsAttribute(base.Reader.Name)) { base.UnknownNode(emitter); } } base.Reader.MoveToElement(); if (base.Reader.IsEmptyElement) { base.Reader.Skip(); return(emitter); } base.Reader.ReadStartElement(); base.Reader.MoveToContent(); int num = 0; int readerCount = base.ReaderCount; while (base.Reader.NodeType != XmlNodeType.EndElement && base.Reader.NodeType != XmlNodeType.None) { if (base.Reader.NodeType == XmlNodeType.Element) { if (!array[0] && base.Reader.LocalName == this.id9_Type && base.Reader.NamespaceURI == this.id2_Item) { emitter.Type = this.Read13_EmitterType(base.Reader.ReadElementString()); array[0] = true; } else if (!array[1] && base.Reader.LocalName == this.id10_Priority && base.Reader.NamespaceURI == this.id2_Item) { emitter.Priority = XmlConvert.ToInt32(base.Reader.ReadElementString()); array[1] = true; } else if (!array[2] && base.Reader.LocalName == this.id11_Exclusive && base.Reader.NamespaceURI == this.id2_Item) { emitter.Exclusive = XmlConvert.ToBoolean(base.Reader.ReadElementString()); array[2] = true; } else if (base.Reader.LocalName == this.id12_PhoneNumber && base.Reader.NamespaceURI == this.id2_Item) { phoneNumbers.Add((E164Number)base.ReadSerializable(new E164Number())); } else { base.UnknownNode(emitter, ":Type, :Priority, :Exclusive, :PhoneNumber"); } } else { base.UnknownNode(emitter, ":Type, :Priority, :Exclusive, :PhoneNumber"); } base.Reader.MoveToContent(); base.CheckReaderCount(ref num, ref readerCount); } base.ReadEndElement(); return(emitter); }
private CalendarNotificationSettingsVersion1Point0 Read15_Item(bool isNullable, bool checkType) { XmlQualifiedName xmlQualifiedName = checkType ? base.GetXsiType() : null; bool flag = false; if (isNullable) { flag = base.ReadNull(); } if (checkType && !(xmlQualifiedName == null) && (xmlQualifiedName.Name != this.id3_Item || xmlQualifiedName.Namespace != this.id2_Item)) { throw base.CreateUnknownTypeException(xmlQualifiedName); } if (flag) { return(null); } CalendarNotificationSettingsVersion1Point0 calendarNotificationSettingsVersion1Point = new CalendarNotificationSettingsVersion1Point0(); if (calendarNotificationSettingsVersion1Point.Emitters == null) { calendarNotificationSettingsVersion1Point.Emitters = new List <Emitter>(); } List <Emitter> emitters = calendarNotificationSettingsVersion1Point.Emitters; bool[] array = new bool[5]; while (base.Reader.MoveToNextAttribute()) { if (!array[0] && base.Reader.LocalName == this.id4_Version && base.Reader.NamespaceURI == this.id2_Item) { calendarNotificationSettingsVersion1Point.Version = base.Reader.Value; array[0] = true; } else if (!base.IsXmlnsAttribute(base.Reader.Name)) { base.UnknownNode(calendarNotificationSettingsVersion1Point, ":Version"); } } base.Reader.MoveToElement(); if (base.Reader.IsEmptyElement) { base.Reader.Skip(); return(calendarNotificationSettingsVersion1Point); } base.Reader.ReadStartElement(); base.Reader.MoveToContent(); int num = 0; int readerCount = base.ReaderCount; while (base.Reader.NodeType != XmlNodeType.EndElement && base.Reader.NodeType != XmlNodeType.None) { if (base.Reader.NodeType == XmlNodeType.Element) { if (!array[1] && base.Reader.LocalName == this.id5_UpdateSettings && base.Reader.NamespaceURI == this.id2_Item) { calendarNotificationSettingsVersion1Point.UpdateSettings = this.Read7_TimeSlotMonitoringSettings(false, true); array[1] = true; } else if (!array[2] && base.Reader.LocalName == this.id6_ReminderSettings && base.Reader.NamespaceURI == this.id2_Item) { calendarNotificationSettingsVersion1Point.ReminderSettings = this.Read7_TimeSlotMonitoringSettings(false, true); array[2] = true; } else if (!array[3] && base.Reader.LocalName == this.id7_SummarySettings && base.Reader.NamespaceURI == this.id2_Item) { calendarNotificationSettingsVersion1Point.SummarySettings = this.Read12_TimePointScaningSettings(false, true); array[3] = true; } else if (base.Reader.LocalName == this.id8_Emitter && base.Reader.NamespaceURI == this.id2_Item) { if (emitters == null) { base.Reader.Skip(); } else { emitters.Add(this.Read14_Emitter(false, true)); } } else { base.UnknownNode(calendarNotificationSettingsVersion1Point, ":UpdateSettings, :ReminderSettings, :SummarySettings, :Emitter"); } } else { base.UnknownNode(calendarNotificationSettingsVersion1Point, ":UpdateSettings, :ReminderSettings, :SummarySettings, :Emitter"); } base.Reader.MoveToContent(); base.CheckReaderCount(ref num, ref readerCount); } base.ReadEndElement(); return(calendarNotificationSettingsVersion1Point); }
private Recurrence Read11_Recurrence(bool isNullable, bool checkType) { XmlQualifiedName xmlQualifiedName = checkType ? base.GetXsiType() : null; bool flag = false; if (isNullable) { flag = base.ReadNull(); } if (checkType && !(xmlQualifiedName == null) && (xmlQualifiedName.Name != this.id17_Recurrence || xmlQualifiedName.Namespace != this.id2_Item)) { throw base.CreateUnknownTypeException(xmlQualifiedName); } if (flag) { return(null); } Recurrence recurrence = new Recurrence(); bool[] array = new bool[6]; while (base.Reader.MoveToNextAttribute()) { if (!base.IsXmlnsAttribute(base.Reader.Name)) { base.UnknownNode(recurrence); } } base.Reader.MoveToElement(); if (base.Reader.IsEmptyElement) { base.Reader.Skip(); return(recurrence); } base.Reader.ReadStartElement(); base.Reader.MoveToContent(); int num = 0; int readerCount = base.ReaderCount; while (base.Reader.NodeType != XmlNodeType.EndElement && base.Reader.NodeType != XmlNodeType.None) { if (base.Reader.NodeType == XmlNodeType.Element) { if (!array[0] && base.Reader.LocalName == this.id9_Type && base.Reader.NamespaceURI == this.id2_Item) { recurrence.Type = this.Read8_RecurrenceType(base.Reader.ReadElementString()); array[0] = true; } else if (!array[1] && base.Reader.LocalName == this.id18_Interval && base.Reader.NamespaceURI == this.id2_Item) { recurrence.Interval = XmlConvert.ToUInt32(base.Reader.ReadElementString()); array[1] = true; } else if (!array[2] && base.Reader.LocalName == this.id19_NthDayInMonth && base.Reader.NamespaceURI == this.id2_Item) { recurrence.NthDayInMonth = XmlConvert.ToUInt32(base.Reader.ReadElementString()); array[2] = true; } else if (!array[3] && base.Reader.LocalName == this.id20_DaysOfWeek && base.Reader.NamespaceURI == this.id2_Item) { recurrence.DaysOfWeek = this.Read9_DaysOfWeek(base.Reader.ReadElementString()); array[3] = true; } else if (!array[4] && base.Reader.LocalName == this.id21_WeekOrderInMonth && base.Reader.NamespaceURI == this.id2_Item) { recurrence.WeekOrderInMonth = this.Read10_WeekOrderInMonth(base.Reader.ReadElementString()); array[4] = true; } else if (!array[5] && base.Reader.LocalName == this.id22_MonthOrder && base.Reader.NamespaceURI == this.id2_Item) { recurrence.MonthOrder = XmlConvert.ToUInt32(base.Reader.ReadElementString()); array[5] = true; } else { base.UnknownNode(recurrence, ":Type, :Interval, :NthDayInMonth, :DaysOfWeek, :WeekOrderInMonth, :MonthOrder"); } } else { base.UnknownNode(recurrence, ":Type, :Interval, :NthDayInMonth, :DaysOfWeek, :WeekOrderInMonth, :MonthOrder"); } base.Reader.MoveToContent(); base.CheckReaderCount(ref num, ref readerCount); } base.ReadEndElement(); return(recurrence); }
public virtual void WriteQName(XmlWriterDelegator xmlWriter, XmlQualifiedName value)
/// <summary> /// /// </summary> /// <param name="prefix"></param> /// <param name="qname"></param> /// <param name="doc"></param> public PubSub(string prefix, XmlQualifiedName qname, XmlDocument doc) : base(prefix, qname, doc) { }
/// <inheritdoc/> public IApplicationConfigurationBuilderExtension AddExtension <T>(XmlQualifiedName elementName, object value) { ApplicationConfiguration.UpdateExtension <T>(elementName, value); return(this); }
private string?_pubid; // pubid literal internal SchemaNotation(XmlQualifiedName name) { _name = name; }
protected object ReadTypedPrimitive(XmlQualifiedName type) { return(ReadTypedPrimitive(type, false)); }
protected void ExportGlobalElement(string elementName, string elementNs, bool isNillable, XmlQualifiedName typeName, XmlSchemaType xsdType, XmlSchemaSet schemaSet) { XmlSchemaElement element = new XmlSchemaElement { Name = elementName }; if (xsdType != null) { element.SchemaType = xsdType; } else { element.SchemaTypeName = typeName; } element.IsNillable = isNillable; this.AddElementToSchema(element, elementNs, schemaSet); }
public void Reset() { currentIndex = -1; currentValue = null; currentKey = null; }
/// <summary> /// /// </summary> /// <param name="prefix"></param> /// <param name="qname"></param> /// <param name="doc"></param> public Subscriptions(string prefix, XmlQualifiedName qname, XmlDocument doc) : base(prefix, qname, doc) { }
/// <summary> /// /// </summary> /// <param name="prefix"></param> /// <param name="qname"></param> /// <param name="doc"></param> public AgentsQuery(string prefix, XmlQualifiedName qname, XmlDocument doc) : base(prefix, qname, doc) { }
/// <summary> /// /// </summary> /// <param name="prefix"></param> /// <param name="qname"></param> /// <param name="doc"></param> public Affiliations(string prefix, XmlQualifiedName qname, XmlDocument doc) : base(prefix, qname, doc) { }
/// <summary> /// Create a pubsub command. Should not be called directly. /// </summary> /// <param name="prefix"></param> /// <param name="qname"></param> /// <param name="doc"></param> protected PubSubCommand(string prefix, XmlQualifiedName qname, XmlDocument doc) : base(prefix, qname, doc) { }
public void GetXsdTypeTest() { XmlQualifiedName qualifiedName = SqlDecimal.GetXsdType(null); Assert.Equal("decimal", qualifiedName.Name); }
internal TemplateManager(Stylesheet stylesheet, XmlQualifiedName mode) { this.mode = mode; this.stylesheet = stylesheet; }
protected static MessagePart AddMessagePart(Message message, string partName, XmlQualifiedName elementName, XmlQualifiedName typeName) { if (message.Parts[partName] != null) { if (IsNullOrEmpty(elementName)) { throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(System.ServiceModel.SR.GetString("SFxPartNameMustBeUniqueInRpc", new object[] { partName }))); } int num = 1; while (message.Parts[partName + num] != null) { if (num == 0x7fffffff) { throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(System.ServiceModel.SR.GetString("SFxTooManyPartsWithSameName", new object[] { partName }))); } num++; } partName = partName + num.ToString(CultureInfo.InvariantCulture); } MessagePart messagePart = new MessagePart { Name = partName, Element = elementName, Type = typeName }; message.Parts.Add(messagePart); EnsureXsdImport(IsNullOrEmpty(elementName) ? typeName.Namespace : elementName.Namespace, message.ServiceDescription); return(messagePart); }
public void GetXsdTypeTest() { XmlQualifiedName qualifiedName = SqlBoolean.GetXsdType(null); Assert.Equal("boolean", qualifiedName.Name); }
public virtual void WriteQName(XmlWriterDelegator xmlWriter, XmlQualifiedName value, XmlDictionaryString name, XmlDictionaryString ns)
protected void ExportMessagePart(Message message, MessagePartDescription part, XmlQualifiedName typeName, XmlSchemaType xsdType, bool isOptional, bool isNillable, bool skipSchemaExport, bool generateElement, string wrapperNs, XmlSchemaSequence wrapperSequence, XmlSchemaSet schemaSet) { if (!IsNullOrEmpty(typeName) || (xsdType != null)) { string name = part.Name; string elementName = string.IsNullOrEmpty(part.UniquePartName) ? name : part.UniquePartName; MessagePart part2 = null; if (generateElement) { if (wrapperSequence != null) { if (!skipSchemaExport) { this.ExportLocalElement(wrapperNs, elementName, part.Namespace, typeName, xsdType, part.Multiple, isOptional, isNillable, wrapperSequence, schemaSet); } } else { if (!skipSchemaExport) { this.ExportGlobalElement(name, part.Namespace, isNillable, typeName, xsdType, schemaSet); } part2 = AddMessagePart(message, elementName, new XmlQualifiedName(name, part.Namespace), XmlQualifiedName.Empty); } } else { if (string.IsNullOrEmpty(typeName.Name)) { throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("SFxAnonymousTypeNotSupported", new object[] { message.Name, elementName }))); } part2 = AddMessagePart(message, elementName, XmlQualifiedName.Empty, typeName); } if (part2 != null) { part.UniquePartName = part2.Name; } } }
internal virtual void WriteQName(XmlWriterDelegator xmlWriter, XmlQualifiedName value) #endif { xmlWriter.WriteQName(value); }
private Duration Read6_Duration(bool isNullable, bool checkType) { XmlQualifiedName xmlQualifiedName = checkType ? base.GetXsiType() : null; bool flag = false; if (isNullable) { flag = base.ReadNull(); } if (checkType && !(xmlQualifiedName == null) && (xmlQualifiedName.Name != this.id16_Duration || xmlQualifiedName.Namespace != this.id2_Item)) { throw base.CreateUnknownTypeException(xmlQualifiedName); } if (flag) { return(null); } Duration duration = new Duration(); bool[] array = new bool[6]; while (base.Reader.MoveToNextAttribute()) { if (!base.IsXmlnsAttribute(base.Reader.Name)) { base.UnknownNode(duration); } } base.Reader.MoveToElement(); if (base.Reader.IsEmptyElement) { base.Reader.Skip(); return(duration); } base.Reader.ReadStartElement(); base.Reader.MoveToContent(); int num = 0; int readerCount = base.ReaderCount; while (base.Reader.NodeType != XmlNodeType.EndElement && base.Reader.NodeType != XmlNodeType.None) { if (base.Reader.NodeType == XmlNodeType.Element) { if (!array[0] && base.Reader.LocalName == this.id9_Type && base.Reader.NamespaceURI == this.id2_Item) { duration.Type = this.Read5_DurationType(base.Reader.ReadElementString()); array[0] = true; } else if (!array[1] && base.Reader.LocalName == this.id18_Interval && base.Reader.NamespaceURI == this.id2_Item) { duration.Interval = XmlConvert.ToUInt32(base.Reader.ReadElementString()); array[1] = true; } else if (!array[2] && base.Reader.LocalName == this.id23_UseWorkHoursTimeSlot && base.Reader.NamespaceURI == this.id2_Item) { duration.UseWorkHoursTimeSlot = XmlConvert.ToBoolean(base.Reader.ReadElementString()); array[2] = true; } else if (!array[3] && base.Reader.LocalName == this.id24_StartTimeInDay && base.Reader.NamespaceURI == this.id2_Item) { duration.StartTimeInDay = XmlSerializationReader.ToDateTime(base.Reader.ReadElementString()); array[3] = true; } else if (!array[4] && base.Reader.LocalName == this.id25_EndTimeInDay && base.Reader.NamespaceURI == this.id2_Item) { duration.EndTimeInDay = XmlSerializationReader.ToDateTime(base.Reader.ReadElementString()); array[4] = true; } else if (!array[5] && base.Reader.LocalName == this.id26_NonWorkHoursExcluded && base.Reader.NamespaceURI == this.id2_Item) { duration.NonWorkHoursExcluded = XmlConvert.ToBoolean(base.Reader.ReadElementString()); array[5] = true; } else { base.UnknownNode(duration, ":Type, :Interval, :UseWorkHoursTimeSlot, :StartTimeInDay, :EndTimeInDay, :NonWorkHoursExcluded"); } } else { base.UnknownNode(duration, ":Type, :Interval, :UseWorkHoursTimeSlot, :StartTimeInDay, :EndTimeInDay, :NonWorkHoursExcluded"); } base.Reader.MoveToContent(); base.CheckReaderCount(ref num, ref readerCount); } base.ReadEndElement(); return(duration); }
public bool Contains(XmlQualifiedName name) { return(_table.ContainsKey(name)); }
protected override DataContract?ResolveDataContractFromRootDataContract(XmlQualifiedName typeQName) { return(XmlObjectSerializerWriteContextComplexJson.ResolveJsonDataContractFromRootDataContract(this, typeQName, rootTypeDataContract !)); }
private TimeSlotMonitoringSettings Read7_TimeSlotMonitoringSettings(bool isNullable, bool checkType) { XmlQualifiedName xmlQualifiedName = checkType ? base.GetXsiType() : null; bool flag = false; if (isNullable) { flag = base.ReadNull(); } if (checkType && !(xmlQualifiedName == null) && (xmlQualifiedName.Name != this.id27_TimeSlotMonitoringSettings || xmlQualifiedName.Namespace != this.id2_Item)) { throw base.CreateUnknownTypeException(xmlQualifiedName); } if (flag) { return(null); } TimeSlotMonitoringSettings timeSlotMonitoringSettings = new TimeSlotMonitoringSettings(); bool[] array = new bool[5]; while (base.Reader.MoveToNextAttribute()) { if (!base.IsXmlnsAttribute(base.Reader.Name)) { base.UnknownNode(timeSlotMonitoringSettings); } } base.Reader.MoveToElement(); if (base.Reader.IsEmptyElement) { base.Reader.Skip(); return(timeSlotMonitoringSettings); } base.Reader.ReadStartElement(); base.Reader.MoveToContent(); int num = 0; int readerCount = base.ReaderCount; while (base.Reader.NodeType != XmlNodeType.EndElement && base.Reader.NodeType != XmlNodeType.None) { if (base.Reader.NodeType == XmlNodeType.Element) { if (!array[0] && base.Reader.LocalName == this.id14_Enabled && base.Reader.NamespaceURI == this.id2_Item) { timeSlotMonitoringSettings.Enabled = XmlConvert.ToBoolean(base.Reader.ReadElementString()); array[0] = true; } else if (!array[1] && base.Reader.LocalName == this.id28_NotifyInWorkHoursTimeSlot && base.Reader.NamespaceURI == this.id2_Item) { timeSlotMonitoringSettings.NotifyInWorkHoursTimeSlot = XmlConvert.ToBoolean(base.Reader.ReadElementString()); array[1] = true; } else if (!array[2] && base.Reader.LocalName == this.id29_NotifyingStartTimeInDay && base.Reader.NamespaceURI == this.id2_Item) { timeSlotMonitoringSettings.NotifyingStartTimeInDay = XmlSerializationReader.ToDateTime(base.Reader.ReadElementString()); array[2] = true; } else if (!array[3] && base.Reader.LocalName == this.id30_NotifyingEndTimeInDay && base.Reader.NamespaceURI == this.id2_Item) { timeSlotMonitoringSettings.NotifyingEndTimeInDay = XmlSerializationReader.ToDateTime(base.Reader.ReadElementString()); array[3] = true; } else if (!array[4] && base.Reader.LocalName == this.id16_Duration && base.Reader.NamespaceURI == this.id2_Item) { timeSlotMonitoringSettings.Duration = this.Read6_Duration(false, true); array[4] = true; } else { base.UnknownNode(timeSlotMonitoringSettings, ":Enabled, :NotifyInWorkHoursTimeSlot, :NotifyingStartTimeInDay, :NotifyingEndTimeInDay, :Duration"); } } else { base.UnknownNode(timeSlotMonitoringSettings, ":Enabled, :NotifyInWorkHoursTimeSlot, :NotifyingStartTimeInDay, :NotifyingEndTimeInDay, :Duration"); } base.Reader.MoveToContent(); base.CheckReaderCount(ref num, ref readerCount); } base.ReadEndElement(); return(timeSlotMonitoringSettings); }
private void ExportLocalElement(string wrapperNs, string elementName, string elementNs, XmlQualifiedName typeName, XmlSchemaType xsdType, bool multiple, bool isOptional, bool isNillable, XmlSchemaSequence sequence, XmlSchemaSet schemaSet) { System.Xml.Schema.XmlSchema schema = System.ServiceModel.Description.SchemaHelper.GetSchema(wrapperNs, schemaSet); XmlSchemaElement element = new XmlSchemaElement(); if (elementNs == wrapperNs) { element.Name = elementName; if (xsdType != null) { element.SchemaType = xsdType; } else { element.SchemaTypeName = typeName; System.ServiceModel.Description.SchemaHelper.AddImportToSchema(element.SchemaTypeName.Namespace, schema); } System.ServiceModel.Description.SchemaHelper.AddElementForm(element, schema); element.IsNillable = isNillable; } else { element.RefName = new XmlQualifiedName(elementName, elementNs); System.ServiceModel.Description.SchemaHelper.AddImportToSchema(elementNs, schema); this.ExportGlobalElement(elementName, elementNs, isNillable, typeName, xsdType, schemaSet); } if (multiple) { element.MaxOccurs = 79228162514264337593543950335M; } if (isOptional) { element.MinOccurs = 0M; } sequence.Items.Add(element); }
internal void Add(XmlQualifiedName name, XmlSchemaObject value) { Debug.Assert(!_table.ContainsKey(name), "XmlSchemaObjectTable.Add: entry already exists"); _table.Add(name, value); _entries.Add(new XmlSchemaObjectEntry(name, value)); }
public XmlSchemaObjectEntry(XmlQualifiedName name, XmlSchemaObject value) { qname = name; xso = value; }
/// <summary> /// /// </summary> /// <param name="prefix"></param> /// <param name="qname"></param> /// <param name="doc"></param> public Unsubscribe(string prefix, XmlQualifiedName qname, XmlDocument doc) : base(prefix, qname, doc) { }
internal static DataContract?ResolveJsonDataContractFromRootDataContract(XmlObjectSerializerContext context, XmlQualifiedName typeQName, DataContract rootTypeDataContract) { if (rootTypeDataContract.XmlName == typeQName) { return(rootTypeDataContract); } CollectionDataContract?collectionContract = rootTypeDataContract as CollectionDataContract; while (collectionContract != null) { DataContract itemContract; if (collectionContract.ItemType.IsGenericType && collectionContract.ItemType.GetGenericTypeDefinition() == typeof(KeyValue <,>)) { itemContract = context.GetDataContract(Globals.TypeOfKeyValuePair.MakeGenericType(collectionContract.ItemType.GetGenericArguments())); } else { itemContract = context.GetDataContract(context.GetSurrogatedType(collectionContract.ItemType)); } if (itemContract.XmlName == typeQName) { return(itemContract); } collectionContract = itemContract as CollectionDataContract; } return(null); }