public override void WriteQualifiedName(XmlDictionaryString local, XmlDictionaryString ns) { string prefix = namespaces.LastOrDefault(i => i.Value.ToString() == ns.ToString()).Key; bool use_dic = prefix != null; if (prefix == null) { prefix = LookupPrefix(ns.Value); } if (prefix == null) { throw new ArgumentException(String.Format("Namespace URI '{0}' is not bound to any of the prefixes", ns)); } ProcessTypedValue(); if (use_dic && prefix.Length == 1) { writer.Write(BF.QNameIndex); writer.Write((byte)(prefix [0] - 'a')); WriteDictionaryIndex(local); } else { // QNameIndex is not applicable. WriteString(prefix); WriteString(":"); WriteString(local); } }
public override void WriteQualifiedName (XmlDictionaryString local, XmlDictionaryString ns) { string prefix = namespaces.LastOrDefault (i => i.Value.ToString () == ns.ToString ()).Key; bool use_dic = prefix != null; if (prefix == null) prefix = LookupPrefix (ns.Value); if (prefix == null) throw new ArgumentException (String.Format ("Namespace URI '{0}' is not bound to any of the prefixes", ns)); ProcessTypedValue (); if (use_dic && prefix.Length == 1) { writer.Write (BF.QNameIndex); writer.Write ((byte) (prefix [0] - 'a')); WriteDictionaryIndex (local); } else { // QNameIndex is not applicable. WriteString (prefix); WriteString (":"); WriteString (local); } }