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


C# XmlReader.ReadString方法代码示例

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


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

示例1: getFunctionDocAndExample

        protected string getFunctionDocAndExample(XmlReader reader)
        {
            //assumes doc is before example. Otherwise, could miss an example.
            string strRes = "";
            bool bFound = reader.ReadToDescendant("doc");
            if (bFound) strRes += (unencodeXml(reader.ReadString()));
            bFound = reader.ReadToNextSibling("example");
            if (bFound) strRes += ("\r\n\r\nExample:\r\n" + unencodeXml(reader.ReadString()));

            reader.Close();
            return strRes;
        }
开发者ID:downpoured,项目名称:lnzscript,代码行数:12,代码来源:DocumentationFromXmlBase.cs

示例2: ReadXml

        public void ReadXml(XmlReader reader)
        {
            if (reader.LocalName != "icon" && !reader.ReadToDescendant("icon"))
                throw new InvalidDataException();

            XmlHelper.ParseXml(reader, new XmlParseSet
            {
                {"url", () => this.RelativeUrl = reader.ReadString()},
                {"mimetype", () => this.MimeType = reader.ReadString()},
                {"width", () => this.Width = reader.ReadElementContentAsInt()},
                {"height", () => this.Height = reader.ReadElementContentAsInt()},
                {"depth", () => this.Depth = reader.ReadElementContentAsInt()}
            });
        }
开发者ID:kthompson,项目名称:Upnp,代码行数:14,代码来源:UpnpIcon.cs

示例3: Deserialize

        /// <summary>
        /// Obtains the type and value of a parameter from an XML Error file.
        /// </summary>
        /// <param name="reader">XML Error file.</param>
        /// <param name="parameter">Parameter to obtain.</param>
        /// <returns>Parameter.</returns>
        public static Parameter Deserialize(XmlReader reader, Parameter parameter)
        {
            if (reader.IsStartElement(DTD.Error.ErrorParams.TagErrorParam))
            {
                if (parameter == null)
                {
                    parameter = new Parameter();
                }

                // Read Attributes of Node.
                parameter.Key = reader.GetAttribute(DTD.Error.ErrorParams.TagKey);
                switch (reader.GetAttribute(DTD.Error.ErrorParams.TagType))
                {
                    case ResponseException.ErrorKey:
                        parameter.Type = ErrorParamType.Key;
                        break;
                    case ResponseException.ErrorLiteral:
                        parameter.Type = ErrorParamType.Literal;
                        break;
                }

                if (!reader.IsEmptyElement)
                {
                    parameter.Text = reader.ReadString();
                }
                else
                {
                    reader.Skip();
                }
            }
            return parameter;
        }
开发者ID:sgon1853,项目名称:UPM_MDD_Thesis,代码行数:38,代码来源:Error.Serializer.cs

示例4: ReadXml

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

            var packagePathHash = new FoxHash("packagePathHash");
            packagePathHash.ReadXml(reader);
            var archivePathHash = new FoxHash("archivePathHash");
            archivePathHash.ReadXml(reader);
            var nameInArchiveHash = new FoxHash("nameInArchiveHash");
            nameInArchiveHash.ReadXml(reader);

            var packagePath = reader.GetAttribute("packagePath");
            var archivePath = reader.GetAttribute("archivePath");
            var nameInArchive = reader.GetAttribute("nameInArchive");

            PackagePathLiteral = new FoxStringLiteral(packagePath, packagePathHash);
            ArchivePathLiteral = new FoxStringLiteral(archivePath, archivePathHash);
            NameInArchiveLiteral = new FoxStringLiteral(nameInArchive, nameInArchiveHash);

            reader.ReadStartElement("value");
            if (isEmptyElement == false)
            {
                string value = reader.ReadString();
                EntityHandle = value.StartsWith("0x")
                    ? ulong.Parse(value.Substring(2, value.Length - 2), NumberStyles.AllowHexSpecifier)
                    : ulong.Parse(value);
                reader.ReadEndElement();
            }
        }
开发者ID:kkkkyue,项目名称:FoxTool,代码行数:29,代码来源:FoxEntityLink.cs

示例5: ReadValidCertificates

		Dictionary<string, List<CallerInfo>> ReadValidCertificates(XmlReader parser) {
			var validCertificates = new Dictionary<string, List<CallerInfo>>();
			try {
				while (parser.Read()) {
					if (parser.IsStartElement() && parser.Name == "signing_certificate") {
						var name = parser[0];
						var packageName = parser[2];
						var isRelease = Convert.ToBoolean(parser[1]);
						var certificate = parser.ReadString();
						if (certificate != null)
							certificate = certificate.Replace("\\s|\\n", "");

						var info = new CallerInfo(name, packageName, isRelease, certificate);

						List<CallerInfo> infos; 
						validCertificates.TryGetValue(certificate, out infos);
						if (infos == null) {
							infos = new List<CallerInfo>();
							validCertificates.Add(certificate, infos);
						}
						LogHelper.Verbose(Tag, "Adding allowed caller: ", info.Name,
							" package=", info.PackageName, " release=", info.Release,
							" certificate=", certificate);
						infos.Add(info);
					}
				}
			} catch (XmlException e) {
				LogHelper.Error(Tag, e, "Could not read allowed callers from XML.");
			} catch (IOException e) {
				LogHelper.Error(Tag, e, "Could not read allowed callers from XML.");
			}
			return validCertificates;
		}
开发者ID:simpleverso,项目名称:monodroid-samples,代码行数:33,代码来源:PackageValidator.cs

示例6: LoadLanguageSpecificSettings

		protected override void LoadLanguageSpecificSettings(XmlReader xr)
		{
			while(xr.Read())
				switch (xr.LocalName)
				{
					case "type":
						try
						{
							OutputType = (OutputTypes)Convert.ToInt32(xr.ReadString());
						}
						catch { }
						break;
					case "isrelease":
						IsRelease = xr.ReadString()=="true";
						break;
					case "dversion":
						DMDVersion = (DVersion)Convert.ToInt32(xr.ReadString());
						break;
					case "libs":
						var xr2 = xr.ReadSubtree();
						while (xr2.Read())
						{
							if (xr2.LocalName == "lib")
								LinkedLibraries.Add(xr2.ReadString());
						}
						break;
					default: break;
				}
		}
开发者ID:DinrusGroup,项目名称:D-IDE,代码行数:29,代码来源:DProject.cs

示例7: Deserialize

        //public static Oids.Oid Deserialize(XmlReader reader, Oids.Oid oid)
        /// <summary>
        /// Deserializes Oid from an XML stream.
        /// </summary>
        /// <param name="reader">XML stream.</param>
        /// <returns>Oid.</returns>
        public static Oids.Oid Deserialize(XmlReader reader)
        {
            Oids.Oid lResult = null;
            if (reader.IsStartElement(DTD.TagOID))
            {
                string lClassName = reader.GetAttribute(DTD.OID.TagClass);
                List<KeyValuePair<ModelType,object>> lFields = new List<KeyValuePair<ModelType,object>>();

                if (!reader.IsEmptyElement)
                {
                    reader.ReadStartElement();
                    do
                    {
                    #region Process tag <OID.Field>.
                    if (reader.IsStartElement(DTD.OID.TagOIDField))
                    {
                        if (!reader.IsEmptyElement)
                        {
                            ModelType lType = Convert.StringTypeToMODELType(reader.GetAttribute(DTD.OID.TagType));
                            lFields.Add(new KeyValuePair<ModelType, object>(lType, Convert.XmlToType(lType, reader.ReadString())));
                        }
                        else
                        {
                            throw new ArgumentException("Xml Reader have one OID.Field with empty Element.", "XmlReader reader");
                        }
                    }
                    #endregion Process tag <OID.Field>.
                    else
                    {
                        #region Process tag <?>
                        reader.Skip();
                        if (reader.NodeType == XmlNodeType.None)
                        {
                            break;
                        }
                        else
                        {
                            continue;
                        }
                        #endregion Process tag <?>
                    }
                    } while (reader.Read());
                }
                else
                {
                    reader.Skip();
                }

                if(lClassName.Length > 0)
                {
                    lResult = ServerConnection.CreateOid(lClassName,lFields);
                }
            }
            else
            {
                throw new ArgumentException("Xml Reader don't have the OID in Start Element.", "XmlReader reader");
            }
            return lResult;
        }
开发者ID:sgon1853,项目名称:UPM_MDD_Thesis,代码行数:65,代码来源:AdaptorOID.Serializer.cs

示例8: ReadXml

 public void ReadXml(XmlReader reader)
 {
     if (reader.IsEmptyElement) {
         reader.Read();
         return;
     }
     reader.ReadStartElement("File");
     FilePath = reader.ReadString();
     reader.ReadEndElement();
 }
开发者ID:felipecsl,项目名称:dover,代码行数:10,代码来源:File.cs

示例9: ReadXml

 public void ReadXml(XmlReader reader)
 {
     var isEmptyElement = reader.IsEmptyElement;
     reader.ReadStartElement("value");
     if (isEmptyElement == false)
     {
         Value = double.Parse(reader.ReadString(), CultureInfo.InvariantCulture);
         reader.ReadEndElement();
     }
 }
开发者ID:kkkkyue,项目名称:FoxTool,代码行数:10,代码来源:FoxDouble.cs

示例10: ReadXml

 public void ReadXml(XmlReader reader)
 {
     var isEmptyElement = reader.IsEmptyElement;
     reader.ReadStartElement("value");
     if (isEmptyElement == false)
     {
         Value = bool.Parse(reader.ReadString());
         reader.ReadEndElement();
     }
 }
开发者ID:kkkkyue,项目名称:FoxTool,代码行数:10,代码来源:FoxBool.cs

示例11: ReadXml

 public void ReadXml(XmlReader reader)
 {
     var isEmptyElement = reader.IsEmptyElement;
     reader.ReadStartElement("value");
     if (isEmptyElement == false)
     {
         Value = ExtensionMethods.ParseFloatRoundtrip(reader.ReadString());
         reader.ReadEndElement();
     }
 }
开发者ID:kkkkyue,项目名称:FoxTool,代码行数:10,代码来源:FoxFloat.cs

示例12: ReadContent

		public static string ReadContent(XmlReader xr)
		{
			string rlt;
			if (xr.NodeType != XmlNodeType.Element)
			{
				xr.MoveToElement();
			}
			rlt = xr.ReadString();
			xr.MoveToElement();
			return rlt;
		}
开发者ID:mind0n,项目名称:hive,代码行数:11,代码来源:CodgenCore.cs

示例13: XmlDocument

	void IXmlSerializable.ReadXml (XmlReader reader)
	{
		XmlDocument doc = new XmlDocument ();
		string str = reader.ReadString ();
		try {
			doc.LoadXml (str);
		} catch {
			doc.LoadXml (reader.ReadOuterXml ());
		}
		mFuncXmlNode = (XmlNode) (doc.DocumentElement);
	}
开发者ID:mono,项目名称:gert,代码行数:11,代码来源:test.cs

示例14: ProcessChildNode

 private static bool ProcessChildNode(XmlReader xmlTextReader, LogEntry entry)
 {
     switch (xmlTextReader.Name)
     {
         case "log4j:event":
             return true;
         case ("log4j:message"):
             entry.Message = xmlTextReader.ReadString();
             break;
         case ("log4j:data"):
             ProcessDataTag(xmlTextReader, entry);
             break;
         case ("log4j:throwable"):
             entry.Throwable = xmlTextReader.ReadString();
             break;
         case ("log4j:locationInfo"):
             SetLocationInfo(entry, xmlTextReader);
             break;
     }
     return false;
 }
开发者ID:BerserkerDotNet,项目名称:LINQPadLog4jDriver,代码行数:21,代码来源:Log4jDataContext.cs

示例15: Load

 public void Load(XmlReader reader)
 {
     while (reader.Read()) {
         if (reader.IsStartElement()) {
             switch (reader.Name) {
                 case "ActionType": {
                         ActionType = reader.ReadString().ToEnum<Logic.Display.CharSprite.ActionType>();
                         break;
                     }
             }
         }
     }
 }
开发者ID:blastboy,项目名称:PMD-Toolkit,代码行数:13,代码来源:CharAnimation.cs


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