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


C# XmlReader.ReadContentAsString方法代码示例

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


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

示例1: Mass

  public Mass(Model model, XmlReader xml) : base(model,xml) {//throws Exception {
    //super(model, xml);
      //foreach(XmlAttribute attribute in xml.Attributes)
      //{
          //string key = attribute.Name;
      if (xml.MoveToAttribute("VX".ToLower()))
      {
        velocityX = double.Parse(xml.ReadContentAsString());
      }
      if (xml.MoveToAttribute("VY".ToLower()))
      {
          velocityY = double.Parse(xml.ReadContentAsString());
      }



      //}
    //Enumeration enum = xml.enumerateAttributeNames();
    //while (enum.hasMoreElements()) {
    //  String key = enum.nextElement().toString();
    //  if (key.equals("VX")) {
    //    velocityX = xml.getDoubleAttribute(key);
    //  }
    //  if (key.equals("VY")) {
    //    velocityY = xml.getDoubleAttribute(key);
    //  }
    //}
  }
开发者ID:OptimusLime,项目名称:MINS.js,代码行数:28,代码来源:Mass.cs

示例2: Load

		public void Load (XmlReader x)
		{
			if(x.MoveToAttribute("ShowParameters"))
				ShowFuncParams = Boolean.Parse(x.ReadContentAsString());
			if(x.MoveToAttribute("ShowVariables"))
				ShowFuncVariables = Boolean.Parse(x.ReadContentAsString());
			if(x.MoveToAttribute("ShowTypes"))
				ShowBaseTypes = Boolean.Parse(x.ReadContentAsString());
			if(x.MoveToAttribute("GrayOutNonPublic"))
				GrayOutNonPublic = Boolean.Parse(x.ReadContentAsString());
			if(x.MoveToAttribute("ExpansionBehaviour"))
				Enum.TryParse(x.ReadContentAsString(),out ExpansionBehaviour);
		}
开发者ID:DinrusGroup,项目名称:Mono-D,代码行数:13,代码来源:DCompilerService.cs

示例3: loadUserDetail

 public static UserDetail loadUserDetail(XmlReader reader)
 {
     reader.MoveToAttribute("name");
     var user = reader.ReadContentAsString();
     reader.MoveToAttribute("pass");
     var password = reader.ReadContentAsString();
     reader.MoveToAttribute("type");
     var accountType = (byte) reader.ReadContentAsInt();
     reader.MoveToAttribute("known");
     var flag = reader.ReadContentAsString().ToLower().Equals("true");
     return new UserDetail(user, password, accountType)
     {
         known = flag
     };
 }
开发者ID:strangea,项目名称:OpenHacknet,代码行数:15,代码来源:UserDetail.cs

示例4: ReadXml

        public void ReadXml(XmlReader reader)
        {
            var isEmpty = reader.IsEmptyElement;

            if (reader.HasAttributes)
            {
                for (var i = 0; i < reader.AttributeCount; i++)
                {
                    reader.MoveToNextAttribute();

                    if (reader.NamespaceURI == "")
                    {
                        if (reader.LocalName == "type")
                        {
                            Type = reader.Value;
                        }
                        else
                        {
                            AttributeExtensions.Add(new XmlQualifiedName(reader.LocalName, reader.NamespaceURI), reader.Value);
                        }
                    }
                }
            }

            reader.ReadStartElement();

            if (!isEmpty)
            {
                DescriptionText = reader.ReadContentAsString();
            }

            reader.ReadEndElement();
        }
开发者ID:amirhalatzi,项目名称:MediaRssSharp,代码行数:33,代码来源:Description.cs

示例5: while

        void IFlickrParsable.Load(XmlReader reader)
        {
            while (reader.MoveToNextAttribute())
            {
                switch (reader.LocalName)
                {
                    case "usage":
                        Usage = reader.ReadContentAsInt();
                        break;
                    case "predicate":
                        PredicateName = reader.Value;
                        break;
                    case "namespace":
                        NamespaceName = reader.Value;
                        break;
                }
            }

            reader.Read();

            if (reader.NodeType == XmlNodeType.Text)
                PairName = reader.ReadContentAsString();

            reader.Read();
        }
开发者ID:JamieKitson,项目名称:flickrnet-experimental,代码行数:25,代码来源:Pair.cs

示例6: ReadXml

        public void ReadXml(XmlReader reader)
        {
            Boolean isEmpty = reader.IsEmptyElement;

            AddAttributeExtensions(reader);

            reader.ReadStartElement();
            if (!isEmpty)
            {
                //Read the text content of the element
                String rawValue = reader.ReadContentAsString();
                if (!String.IsNullOrEmpty(rawValue))
                {
                    //Split the raw string on commas to get the individual items
                    String[] unSplitItems = rawValue.Split(',');
                    foreach (var unSplitItem in unSplitItems)
                    {
                        //Split the items on the colon to seperate the tag from the weight
                        String[] splitItem = unSplitItem.Split(':');
                        TagCollection.Add(splitItem[0].Trim(), Int32.Parse(splitItem[1].Trim()));
                    }
                }
            }
            reader.ReadEndElement();
        }
开发者ID:amirhalatzi,项目名称:MediaRssSharp,代码行数:25,代码来源:Tags.cs

示例7: ReadXml

        public override void ReadXml(XmlReader reader)
        {
            Keyword.Clear();

            var subReader = reader.ReadSubtree();

            if (CheckEmptyNode(subReader, "KeywordList", string.Empty, true))
                return;

            while (!subReader.EOF)
            {
                subReader.MoveToContent();
                if (subReader.LocalName == "Keyword")
                {
                    var att = subReader.GetAttribute("vocabulary");
                    reader.ReadStartElement("Keyword");
                    var val = reader.ReadContentAsString();
                    reader.ReadEndElement();
                    Keyword.Add(new Keyword { Vocabulary = att, Value = val });
                }
                else
                {
                    subReader.ReadEndElement();
                }
            }

            reader.Skip();
        }
开发者ID:galchen,项目名称:brutile,代码行数:28,代码来源:KeywordList.cs

示例8: readString

 public static string readString(XmlReader reader, string nodeName)
 {
     reader.ReadStartElement(nodeName);
     string s = reader.ReadContentAsString();
     reader.ReadEndElement();
     return s;
 }
开发者ID:wico-,项目名称:Code,代码行数:7,代码来源:Level.cs

示例9: ClientData

        private ClientData(XmlReader reader)
        {
            reader.ReadStartElement("ClientData");

            for (int iter = 0; iter < _NumStoredValues; iter++) {

                reader.ReadStartElement(_StoredValueNames[iter]);

                if (_StoredValues[iter] is string)
                    _StoredValues[iter] = reader.ReadContentAsString();
                else if (_StoredValues[iter] is DateTime) {
                    string s = reader.ReadContentAsString();
                    long l = long.Parse(s, NumberStyles.HexNumber, CultureInfo.InvariantCulture);
                    _StoredValues[iter] = DateTime.FromFileTimeUtc(l);
                } else if (_StoredValues[iter] is bool) {
                    string s = reader.ReadContentAsString();
                    _StoredValues[iter] = !(string.IsNullOrEmpty(s) || s != "1");
                } else {
                    _StoredValues[iter] = ReadStringArray(reader);
                }
                reader.ReadEndElement();
            }

            reader.ReadEndElement();
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:25,代码来源:ClientData.cs

示例10: ReadXml

		public void ReadXml(XmlReader reader)
		{
			m_name = reader.Name;
			while (reader.Read())
			{
				reader.SkipEmptyNodes();

				if (reader.NodeType == XmlNodeType.EndElement)
				{
					// the end
					break;
				}
				else if (reader.NodeType == XmlNodeType.Element)
				{
					reader.Read();	// go into ValueNode
					reader.SkipEmptyNodes();
				}

				if (reader.NodeType != XmlNodeType.Text)
				{
					throw new Exception("Required NodeType: Text - Found: " + reader.NodeType);
				}

				var value = reader.ReadContentAsString();
				Pairs.Add(new KeyValuePair<string, string>(reader.Name, value));

				if (reader.NodeType == XmlNodeType.EndElement)
				{
					// the end
					reader.ReadInnerXml();
				}
			}
		}
开发者ID:remixod,项目名称:netServer,代码行数:33,代码来源:SerializablePairCollection.cs

示例11: while

        void IFlickrParsable.Load(XmlReader reader)
        {
            if (reader.LocalName != "place_type")
                UtilityMethods.CheckParsingException(reader);

            while (reader.MoveToNextAttribute())
            {
                switch (reader.LocalName)
                {
                    case "place_type_id":
                    case "id":
                        Id = reader.ReadContentAsInt();
                        break;
                    default:
                        UtilityMethods.CheckParsingException(reader);
                        break;
                }
            }

            reader.Read();

            Name = reader.ReadContentAsString();

            reader.Skip();
        }
开发者ID:JamieKitson,项目名称:flickrnet-experimental,代码行数:25,代码来源:PlaceTypeInfo.cs

示例12: while

 void IFlickrParsable.Load(XmlReader reader)
 {
     if (!(reader.LocalName != "tag"))
     ;
       while (reader.MoveToNextAttribute())
       {
     switch (reader.LocalName)
     {
       case "id":
     this.TagId = reader.Value;
     continue;
       case "author":
     this.AuthorId = reader.Value;
     continue;
       case "authorname":
     this.AuthorName = reader.Value;
     continue;
       case "raw":
     this.Raw = reader.Value;
     continue;
       case "machine_tag":
     this.IsMachineTag = reader.Value == "1";
     continue;
       default:
     continue;
     }
       }
       reader.Read();
       this.TagText = reader.ReadContentAsString();
       reader.Skip();
 }
开发者ID:rmck,项目名称:FlickrNet,代码行数:31,代码来源:PhotoInfoTag.cs

示例13: ReadXml

        public virtual void ReadXml(XmlReader reader)
        {
            reader.MoveToContent();
            if (reader.HasAttributes)
                while (reader.MoveToNextAttribute())
                    AttributeWasRead(reader.Name, reader.Value);

            AllAttributesRead();

            var isEmpty = reader.IsEmptyElement;
            if (!isEmpty)
            {
                while (reader.Read())
                {
                    var nodeType = reader.NodeType;
                    switch (nodeType)
                    {
                        case XmlNodeType.Text:
                            var content = reader.ReadContentAsString();
                            ContentWasRead(string.Empty, content);
                            break;
                        case XmlNodeType.Element:
                            var name = reader.Name;
                            ProcessElement(name, reader);
                            break;
                    }
                }
            }
        }
开发者ID:paulomouat,项目名称:spikes,代码行数:29,代码来源:XmlSerializable.cs

示例14: ReadMedia

 private static IEnumerable<string> ReadMedia(XmlReader media)
 {
     while (media.ReadToFollowing("local"))
     {
         media.MoveToFirstAttribute();
         yield return media.ReadContentAsString();
     }
 }
开发者ID:stufkan,项目名称:SimpleAudio,代码行数:8,代码来源:Settings.cs

示例15: ReadKeyNameClause

        private static KeyNameIdentifierClause ReadKeyNameClause(XmlReader reader)
        {
            reader.ReadStartElement("KeyName", SignedXml.XmlDsigNamespaceUrl);
            var keyIdentifier = new KeyNameIdentifierClause(reader.ReadContentAsString());
            reader.ReadEndElement();

            return keyIdentifier;
        }
开发者ID:CDHDeveloper,项目名称:authservices,代码行数:8,代码来源:KeyInfoSerializer.cs


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