当前位置: 首页>>代码示例>>C#>>正文


C# XmlReader.ReadEndElement方法代码示例

本文整理汇总了C#中XmlReader.ReadEndElement方法的典型用法代码示例。如果您正苦于以下问题:C# XmlReader.ReadEndElement方法的具体用法?C# XmlReader.ReadEndElement怎么用?C# XmlReader.ReadEndElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XmlReader的用法示例。


在下文中一共展示了XmlReader.ReadEndElement方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReadXml

    public void ReadXml(XmlReader reader)
    {
        reader.ReadStartElement(); //wrapping element

        this.name = reader.ReadElementContentAsString();
        this.extension = reader.ReadElementContentAsString();

        string tempFileName = Path.GetTempFileName();
        this.streamFileName = tempFileName;
        using (FileStream fs = File.Create(tempFileName))
        {
            byte[] buffer = new byte[1000];
            int bytesRead;
            reader.ReadStartElement();
            do
            {
                bytesRead = reader.ReadContentAsBase64(buffer, 0, buffer.Length);
                fs.Write(buffer, 0, bytesRead);
            } while (bytesRead > 0);

            reader.ReadEndElement();
        }

        reader.ReadEndElement(); //wrapping element
    }
开发者ID:GusLab,项目名称:WCFSamples,代码行数:25,代码来源:ContextExtra.cs

示例2:

		 void IXmlSerializable.ReadXml(XmlReader r)
		{
			r.MoveToContent();
			r.ReadStartElement("Employee");
			
			 r.ReadStartElement("Name");
			 FirstName = r.ReadElementString("First", ns);
			 LastName = r.ReadElementString("Last", ns);
			r.ReadEndElement();
			r.MoveToContent();
			 ID = Int32.Parse(r.ReadElementString("ID", ns));
			 r.ReadEndElement();
			 
		}
开发者ID:Helen1987,项目名称:edu,代码行数:14,代码来源:EmployeesServiceCompatible.cs

示例3: ReadObject

 public override object ReadObject(XmlReader reader)
 {
     ArrayOfLoanStateCompositeType ArrayOfLoanStateCompositeTypeField = null;
     if (IsParentStartElement(reader, false, true))
     {
         ArrayOfLoanStateCompositeTypeField = new ArrayOfLoanStateCompositeType();
         reader.Read();
         LoanStateCompositeTypeDataContractSerializer LoanStateCompositeTypeDCS = new LoanStateCompositeTypeDataContractSerializer("LoanStateCompositeType", "http://schemas.datacontract.org/2004/07/", "http://schemas.datacontract.org/2004/07/");
         System.Collections.ArrayList LoanStateCompositeType_List = new System.Collections.ArrayList();
         for (int i = 0; (i > -1); i = (i + 1))
         {
             if (!IsChildStartElement(reader, "LoanStateCompositeType", false, false))
             {
                 ArrayOfLoanStateCompositeTypeField.LoanStateCompositeType = new LoanStateCompositeType[LoanStateCompositeType_List.Count];
                 LoanStateCompositeType_List.CopyTo(ArrayOfLoanStateCompositeTypeField.LoanStateCompositeType);
                 break;
             }
             LoanStateCompositeType_List.Add(((LoanStateCompositeType)(LoanStateCompositeTypeDCS.ReadObject(reader))));
         }
         reader.ReadEndElement();
     }
     return ArrayOfLoanStateCompositeTypeField;
 }
开发者ID:giu-fio,项目名称:LibraryTerminal,代码行数:23,代码来源:Service.cs

示例4: ReadString

 public string ReadString(XmlReader reader)
 {
     reader.Read();
     string s = reader.ReadString();
     reader.ReadEndElement();
     return s;
 }
开发者ID:giu-fio,项目名称:LibraryTerminal,代码行数:7,代码来源:Service.cs

示例5: ReadObject

        public static void ReadObject(XmlReader reader, object obj, PropertyConversionHandler handler = null)
        {
            if (obj == null)
                throw new ArgumentNullException("obj");

            reader.MoveToContent();

            if (obj is IXmlSerializable)
            {
                ((IXmlSerializable)obj).ReadXml(reader);
            }
            else
            {
                object oVal = null;
                string oName = GetAttributeValue(obj.GetType(), typeof(XmlRootAttribute), "ElementName", true, ref oVal) ? oVal.ToString() : obj.GetType().Name;
                if (reader.LocalName != oName)
                    throw new XmlException("XML element name does not match object.");

                if (!reader.IsEmptyElement)
                {
                    reader.ReadStartElement();
                    reader.MoveToContent();
                    ReadObjectProperties(reader, obj, handler);
                    reader.ReadEndElement();
                }
                else
                    reader.Skip();
            }
        }
开发者ID:BclEx,项目名称:BclEx-Extend,代码行数:29,代码来源:XmlSerializationHelper.cs

示例6: LoadStatus

	/// <summary>
	/// Loads the status.
	/// </summary>
	/// <param name="reader">Reader.</param>
	protected override void LoadStatus (XmlReader reader)
	{
		base.LoadStatus (reader);
		reader.ReadToNextSibling ("Mana");
		mana.value = reader.ReadElementContentAsFloat ();
		Debug.Log("Found Exp field: " + reader.ReadToNextSibling ("Exp"));
		Debug.Log("Found level field: " + reader.ReadToNextSibling ("Level"));

		GetComponent<Inventory> ().LoadInventory (reader);
		reader.ReadEndElement ();
	}
开发者ID:TobiasMorell,项目名称:Game2Grow-Wizard,代码行数:15,代码来源:Wizard.cs

示例7: Load

	/// <summary>
	/// Load an instance using the specified reader.
	/// </summary>
	/// <param name="reader">Reader.</param>
	public override void Load (XmlReader reader)
	{
		reader.ReadToFollowing ("Wizard");
		base.Load (reader);
		reader.ReadEndElement ();
	}
开发者ID:TobiasMorell,项目名称:Game2Grow-Wizard,代码行数:10,代码来源:Wizard.cs

示例8: LoadPosition

	protected void LoadPosition(XmlReader reader) {
		reader.ReadToFollowing ("Position");
		reader.ReadToDescendant ("x");
		Vector3 loadedPosition = new Vector3 ();
		loadedPosition.x = reader.ReadElementContentAsFloat ();
		reader.ReadToNextSibling ("y");
		loadedPosition.y = reader.ReadElementContentAsFloat ();
		reader.ReadToNextSibling ("z");
		loadedPosition.z = reader.ReadElementContentAsFloat ();
		transform.position = loadedPosition;
		reader.ReadEndElement ();
	}
开发者ID:TobiasMorell,项目名称:Game2Grow-Wizard,代码行数:12,代码来源:Entity.cs


注:本文中的XmlReader.ReadEndElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。