本文整理匯總了C#中System.Xml.XmlTextReader.ReadToFollowing方法的典型用法代碼示例。如果您正苦於以下問題:C# XmlTextReader.ReadToFollowing方法的具體用法?C# XmlTextReader.ReadToFollowing怎麽用?C# XmlTextReader.ReadToFollowing使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.XmlTextReader
的用法示例。
在下文中一共展示了XmlTextReader.ReadToFollowing方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: loadXML
public static void loadXML()
{
if (pointers.Count <= 0) {
reader = new XmlTextReader("RocketLeague.CT");
while (reader.ReadToFollowing("CheatEntry"))
{
reader.ReadToFollowing("Description");
string name = reader.ReadElementContentAsString().Trim('"');
reader.ReadToFollowing("Address");
string adress = reader.ReadElementContentAsString();
string offsets = "";
reader.ReadToFollowing("Offsets");
reader.Read();
while (reader.Read() && reader.NodeType != XmlNodeType.EndElement)
{
offsets = "+" + reader.ReadElementContentAsString() + offsets;
}
pointers.Add(name, adress + offsets);
}
reader.Close();
}
}
示例2: readXml
public void readXml()
{
using (XmlTextReader reader = new XmlTextReader("dump.xml"))
{
reader.ReadToFollowing("range");
while (reader.EOF == false)
{
reader.MoveToFirstAttribute();
rangeNameList.Add(reader.Value);
reader.MoveToNextAttribute();
string temp = (reader.Value);
rangeNameList.Add(temp);
rangeStartList.Add(Int32.Parse(reader.Value, System.Globalization.NumberStyles.HexNumber));
reader.MoveToNextAttribute();
temp = (reader.Value);
rangeNameList.Add(temp);
int temp1 = (Int32.Parse(reader.Value, System.Globalization.NumberStyles.HexNumber));
int temp2 = rangeStartList[rangeStartList.Count-1];
rangeLengthList.Add(temp1-temp2);
reader.ReadToFollowing("range");
}
}
}
示例3: LoadRules
protected override void LoadRules (Category c)
{
// load xml file from smokey resources
using (Stream ruleInfo = SmokeyRunner.Smokey.GetManifestResourceStream (c.Id + ".xml")) {
using (XmlTextReader reader = new XmlTextReader (ruleInfo)) {
reader.WhitespaceHandling = WhitespaceHandling.None;
// we need to know all rule ids, names and descriptions
while (reader.Read ()) {
reader.ReadToFollowing ("Violation");
string ruleId = reader.GetAttribute ("checkID"); // id
do {
if (reader.EOF)
break;
reader.ReadToFollowing ("Translation");
} while (reader.GetAttribute ("lang") != "en");
if (reader.EOF)
break;
string ruleName = reader.GetAttribute ("typeName"); // name
reader.ReadToFollowing ("Description");
string ruleDescription = reader.ReadElementContentAsString (); // description
SmokeyRule rule = new SmokeyRule (ruleId, ruleName, ruleDescription);
SmokeyRuleCache.Add (rule);
base.AddRule (c, rule);
}
}
}
}
示例4: loadState
private void loadState(XmlFile stateXml)
{
XmlTextReader textReader = new XmlTextReader(stateXml.fileName);
textReader.ReadToFollowing("lightsAndSoundOn");
lightsAndSoundOn = textReader.ReadElementContentAsBoolean();
textReader.ReadToFollowing("safeToDisableChoreo");
safeToDisableChoreo = textReader.ReadElementContentAsBoolean();
textReader.Close();
}
示例5: parseXML
private void parseXML(string filename)
{
using (XmlTextReader reader = new XmlTextReader(filename))
{
reader.ReadToFollowing("title");
Title = reader.ReadElementContentAsString();
reader.ReadToFollowing("path");
Path = reader.ReadElementContentAsString();
reader.ReadToFollowing("description");
Description = reader.ReadElementContentAsString();
reader.ReadToFollowing("img_path");
ImagePath = reader.ReadElementContentAsString();
}
}
示例6: OpenXML_Zefania_XML_Bible_Markup_Language
public OpenXML_Zefania_XML_Bible_Markup_Language(string fileLocation, bible_data.BookManipulator manipulator)
{
_fileLocation = fileLocation;
_reader = new XmlTextReader(_fileLocation);
_bible = manipulator;
// Create an XmlReader for <format>Zefania XML Bible Markup Language</format>
using (_reader)
{
_reader.ReadToFollowing("title");
String title = _reader.ReadElementContentAsString();
_bible.SetVersion(title);
String book;
int verseNumber;
int chapterNumber;
string verseString;
while (_reader.ReadToFollowing("BIBLEBOOK")) // read each book name
{
_reader.MoveToAttribute(1);
book = _reader.Value;
_reader.ReadToFollowing("CHAPTER");
while (_reader.Name == "CHAPTER") // read each chapter
{
_reader.MoveToFirstAttribute();
chapterNumber = Convert.ToInt32(_reader.Value);
_reader.ReadToFollowing("VERS");
while (_reader.Name == "VERS") // read each verse
{
_reader.MoveToFirstAttribute();
verseNumber = Convert.ToInt32(_reader.Value);
_reader.Read();
verseString = _reader.Value;
sendToDataTree(book, verseNumber, chapterNumber, verseString);
_reader.Read();
_reader.Read();
_reader.Read();
}//end verse while
_reader.Read();
_reader.Read();
} //end chapter while
} // end book while
} //end using statement
}
示例7: EnableLegacyRendering
// Replicates the functionality of the internal Page.EnableLegacyRendering property
public static bool EnableLegacyRendering()
{
// 2007-10-02: The following commented out code will NOT work in Medium Trust environments
//Configuration cfg = WebConfigurationManager.OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath);
//XhtmlConformanceSection xhtmlSection = (XhtmlConformanceSection) cfg.GetSection("system.web/xhtmlConformance");
//return xhtmlSection.Mode == XhtmlConformanceMode.Legacy;
// 2007-10-02: The following work around, provided by Michael Tobisch, works in
// Medium Trust by directly reading the Web.config file as XML.
bool result;
try
{
string webConfigFile = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, "web.config");
XmlTextReader webConfigReader = new XmlTextReader(new StreamReader(webConfigFile));
result = ((webConfigReader.ReadToFollowing("xhtmlConformance")) && (webConfigReader.GetAttribute("mode") == "Legacy"));
webConfigReader.Close();
}
catch
{
result = false;
}
return result;
}
示例8: getFormatName
private string getFormatName(string fileLocation)
{
XmlTextReader XMLreader;
XMLreader = new XmlTextReader(fileLocation);
XMLreader.ReadToFollowing("format");
return XMLreader.ReadElementContentAsString();
}
示例9: loadPreferences
// be careful - have to read nodes in the order they are written!
private void loadPreferences(XmlFile prefsXml)
{
XmlTextReader textReader = new XmlTextReader(prefsXml.fileName);
textReader.ReadToFollowing("minimizeToSystemTray");
minimizePref.Checked = textReader.ReadElementContentAsBoolean();
textReader.Close();
}
示例10: ParseCML
public static Molecule ParseCML(FileStream file)
{
Dictionary<int, BondingAtom> atoms = new Dictionary<int, BondingAtom>();
XmlTextReader reader = new XmlTextReader(file);
reader.ReadToFollowing("molecule");
reader.ReadToDescendant("atomArray");
reader.ReadToDescendant("atom");
do
{
atoms.Add(int.Parse(reader.GetAttribute("id").Substring(1)) - 1, new BondingAtom(Elements.FromSymbol(reader.GetAttribute("elementType"))));
} while (reader.ReadToNextSibling("atom"));
reader.ReadToNextSibling("bondArray");
reader.ReadToDescendant("bond");
do
{
string[] atomRefs = reader.GetAttribute("atomRefs2").Split(' ');
int order = 0;
switch (reader.GetAttribute("order"))
{
case "S":
order = 1;
break;
case "D":
order = 2;
break;
case "T":
order = 3;
break;
}
atoms[int.Parse(atomRefs[0].Substring(1)) - 1].Bond(atoms[int.Parse(atomRefs[1].Substring(1)) - 1], order);
} while (reader.ReadToNextSibling("bond"));
return new Molecule(new List<BondingAtom>(atoms.Values));
}
示例11: Settings_Load
private void Settings_Load(object sender, EventArgs e)
{
XmlTextReader xreader = new XmlTextReader("settings.xml");
xreader.ReadToFollowing("twitch_server");
Server = xreader.GetAttribute("value");
xreader.ReadToFollowing("twitch_name");
Username = xreader.GetAttribute("value");
xreader.ReadToFollowing("twitch_auth");
AuthCode = xreader.GetAttribute("value");
xreader.Close();
tbServer.Text = Server;
tbUsername.Text = Username;
tbAuth.Text = AuthCode;
}
示例12: GetSetting
//This function is to pull a specific item from the settings.xml
public string GetSetting(string setting, string xmlFile)
{
string foundString ="";
XmlTextReader xml = new XmlTextReader(xmlFile);
xml.ReadToFollowing(setting);
foundString = xml.ReadElementContentAsString(setting, "");
return foundString;
}
示例13: FromXml
public static HaarCascade FromXml(TextReader stringReader)
{
XmlTextReader xmlReader = new XmlTextReader(stringReader);
xmlReader.ReadToFollowing("size");
string size = xmlReader.ReadElementContentAsString();
xmlReader.ReadToFollowing("stages");
XmlSerializer serializer = new XmlSerializer(typeof(HaarCascadeSerializationObject));
var stages = (HaarCascadeSerializationObject)serializer.Deserialize(xmlReader);
string[] s = size.Trim().Split(' ');
int baseWidth = int.Parse(s[0], CultureInfo.InvariantCulture);
int baseHeight = int.Parse(s[1], CultureInfo.InvariantCulture);
return new HaarCascade(baseWidth, baseHeight, stages.Stages);
}
示例14: ParsedFeed
public ParsedFeed(string userID)
{
String URLString = String.Format("https://www.amazon.com/rss/people/{0}/reviews/ref=cm_rss_member_rev_manlink", userID);
XmlTextReader reader = new XmlTextReader(URLString);
this.FeedReviews = new List<ParsedReview> { };
reader.ReadToFollowing("link");
this.PublishDate = reader.ReadElementContentAsString();
while (reader.ReadToFollowing("item"))
{
ParsedReview review = new ParsedReview();
reader.ReadToFollowing("title");
review.Title = reader.ReadElementContentAsString().Trim();
reader.ReadToFollowing("guid");
string tempguid = reader.ReadElementContentAsString();
review.ASIN = tempguid.Substring(tempguid.Length - 10);
reader.ReadToFollowing("link");
review.Link = reader.ReadElementContentAsString();
reader.ReadToFollowing("pubDate");
review.ReviewDate = DateTime.Parse(reader.ReadElementContentAsString());
reader.ReadToFollowing("description");
review.RawText = reader.ReadElementContentAsString();
this.FeedReviews.Add(review);
}
}
示例15: ConstructBody
public string ConstructBody()
{
using (var reader = new XmlTextReader(new StringReader(page)))
{
reader.DtdProcessing = DtdProcessing.Ignore;
reader.ReadToFollowing("body");
return reader.ReadOuterXml();
}
}