當前位置: 首頁>>代碼示例>>C#>>正文


C# XmlDictionaryWriter.WriteQualifiedName方法代碼示例

本文整理匯總了C#中System.Xml.XmlDictionaryWriter.WriteQualifiedName方法的典型用法代碼示例。如果您正苦於以下問題:C# XmlDictionaryWriter.WriteQualifiedName方法的具體用法?C# XmlDictionaryWriter.WriteQualifiedName怎麽用?C# XmlDictionaryWriter.WriteQualifiedName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Xml.XmlDictionaryWriter的用法示例。


在下文中一共展示了XmlDictionaryWriter.WriteQualifiedName方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnWriteStartHeader

 protected override void OnWriteStartHeader(XmlDictionaryWriter writer, MessageVersion messageVersion)
 {
     writer.WriteStartElement(this.Name, this.Namespace);
     writer.WriteXmlnsAttribute(null, _notUnderstoodNs);
     writer.WriteStartAttribute(Message12Strings.QName);
     writer.WriteQualifiedName(_notUnderstoodName, _notUnderstoodNs);
     writer.WriteEndAttribute();
 }
開發者ID:SoumikMukherjeeDOTNET,項目名稱:wcf,代碼行數:8,代碼來源:MustUnderstandSoapException.cs

示例2: OnWriteHeaderContents

        protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
        {
            writer.WriteStartElement(WsrmFeb2005Strings.Prefix, WsrmFeb2005Strings.FaultCode, this.Namespace);
            writer.WriteXmlnsAttribute(null, this.Namespace);
            writer.WriteQualifiedName(this.Subcode, this.Namespace);
            writer.WriteEndElement();

            bool wsrm11 = this.ReliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11;

            if (wsrm11)
            {
                writer.WriteStartElement(WsrmFeb2005Strings.Prefix, XD.Message12Dictionary.FaultDetail, this.DictionaryNamespace);
            }

            this.fault.WriteDetail(writer);

            if (wsrm11)
            {
                writer.WriteEndElement();
            }
        }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:21,代碼來源:WsrmFault.cs

示例3: OnWriteHeaderContents

 protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
 {
     writer.WriteStartElement("r", "FaultCode", this.Namespace);
     writer.WriteXmlnsAttribute(null, this.Namespace);
     writer.WriteQualifiedName(this.Subcode, this.Namespace);
     writer.WriteEndElement();
     bool flag = base.ReliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11;
     if (flag)
     {
         writer.WriteStartElement("r", XD.Message12Dictionary.FaultDetail, this.DictionaryNamespace);
     }
     this.fault.WriteDetail(writer);
     if (flag)
     {
         writer.WriteEndElement();
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:17,代碼來源:WsrmSequenceFaultHeader.cs

示例4: OnWriteDetailContents

 protected override void OnWriteDetailContents(XmlDictionaryWriter writer)
 {
     writer.WriteStartElement("ProblemHeaderQName", AddressingVersion.WSAddressing10.Namespace);
     writer.WriteQualifiedName(this.invalidHeaderName, AddressingVersion.WSAddressing10.Namespace);
     writer.WriteEndElement();
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:6,代碼來源:WSAddressing10ProblemHeaderQNameFault.cs

示例5: OnWriteHeaderContents

 protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
 {
     writer.WriteStartElement("ProblemHeaderQName", this.Namespace);
     writer.WriteQualifiedName(this.invalidHeaderName, this.Namespace);
     writer.WriteEndElement();
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:6,代碼來源:WSAddressing10ProblemHeaderQNameFault.cs

示例6: WriteStartObject

		public override void WriteStartObject (
			XmlDictionaryWriter writer, object graph)
		{
			Type rootType = type;
			
			if (root_name.Value == "")
				throw new InvalidDataContractException ("Type '" + type.ToString () +
					"' cannot have a DataContract attribute Name set to null or empty string.");


			if (graph == null) {
				if (names_filled)
					writer.WriteStartElement (root_name.Value, root_ns.Value);
				else
					writer.WriteStartElement (root_name, root_ns);
				writer.WriteAttributeString ("i", "nil", XmlSchema.InstanceNamespace, "true");
				return;
			}

			QName instName = null;
			QName root_qname = known_types.GetQName (rootType);
			QName graph_qname = known_types.GetQName (graph.GetType ());

			known_types.Add (graph.GetType ());

			if (names_filled)
				writer.WriteStartElement (root_name.Value, root_ns.Value);
			else
				writer.WriteStartElement (root_name, root_ns);
			if (root_ns.Value != root_qname.Namespace)
				if (root_qname.Namespace != KnownTypeCollection.MSSimpleNamespace)
					writer.WriteXmlnsAttribute (null, root_qname.Namespace);

			if (root_qname == graph_qname) {
				if (root_qname.Namespace != KnownTypeCollection.MSSimpleNamespace &&
					!rootType.IsEnum)
					//FIXME: Hack, when should the "i:type" be written?
					//Not used in case of enums
					writer.WriteXmlnsAttribute ("i", XmlSchema.InstanceNamespace);

				return;
			}

			/* Different names */
			known_types.Add (rootType);
			
			instName = KnownTypeCollection.GetPredefinedTypeName (graph.GetType ());
			if (instName == QName.Empty)
				/* Not a primitive type */
				instName = graph_qname;
			else
				/* FIXME: Hack, .. see test WriteObject7 () */
				instName = new QName (instName.Name, XmlSchema.Namespace);

			// output xsi:type as rootType is not equivalent to the graph's type.
			writer.WriteStartAttribute ("i", "type", XmlSchema.InstanceNamespace);
			writer.WriteQualifiedName (instName.Name, instName.Namespace);
			writer.WriteEndAttribute ();
		}
開發者ID:cthrax,項目名稱:mono,代碼行數:59,代碼來源:DataContractSerializer.cs


注:本文中的System.Xml.XmlDictionaryWriter.WriteQualifiedName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。