本文整理汇总了C#中System.Xml.XmlNodeList类的典型用法代码示例。如果您正苦于以下问题:C# XmlNodeList类的具体用法?C# XmlNodeList怎么用?C# XmlNodeList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XmlNodeList类属于System.Xml命名空间,在下文中一共展示了XmlNodeList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: WalkAddingMenuItems
private void WalkAddingMenuItems(XmlNodeList nodes, ToolStripMenuItem parent)
{
if (nodes != null) {
foreach (XmlNode n in nodes) {
ToolStripMenuItem curItem = null;
if (parent == null) {
curItem = ContextMenuStrip.Items.Add(n.Attributes["name"].Value) as ToolStripMenuItem;
} else {
curItem = parent.DropDownItems.Add(n.Attributes["name"].Value) as ToolStripMenuItem;
}
curItem.Name = n.Attributes["name"].Value;
var snippets = n.SelectNodes("snip");
foreach (XmlNode snippet in snippets) {
curItem.DropDownItems.Add(snippet.Attributes["name"].Value, null, delegate {
var sel = Environment.NewLine + SelectedText.Trim() + Environment.NewLine;
SelectedText = string.Format(snippet.InnerText.Trim(), sel) + Environment.NewLine;
});
}
WalkAddingMenuItems(n.SelectNodes("node"), curItem);
}
}
}
开发者ID:u89012,项目名称:Bootpad,代码行数:26,代码来源:Editors.cs
示例2: AreEqual
public static void AreEqual(XmlNodeList ctrNodes, List<Grower> growers, Dictionary<string, List<UniqueId>> linkList)
{
for (var i = 0; i < ctrNodes.Count; i++)
{
AreEqual(ctrNodes[i], growers[i], linkList);
}
}
开发者ID:ADAPT,项目名称:ISOv4Plugin,代码行数:7,代码来源:GrowerAssert.cs
示例3: ParseXML
public void ParseXML(XmlNodeList node)
{
foreach (XmlNode node2 in node)
{
//Debug.WriteLine("\tConnection Node >" + node2.Value + " : " + node2.Name);
//Debug.WriteLine("\tConnection Node >" + node2.FirstChild.Value + " : " + node2.FirstChild.Name);
switch (node2.Name)
{
case ("Type"):
{
type = node2.FirstChild.Value;
break;
}
case("URL"):
{
url = node2.FirstChild.Value;
break;
}
case("Metric"):
{
metric = Convert.ToInt32(node2.FirstChild.Value);
break;
}
}
}
}
开发者ID:keithloughnane,项目名称:Omnipresent,代码行数:26,代码来源:Connection.cs
示例4: IsIndexColumn
private static bool IsIndexColumn(string name, XmlNodeList indexes)
{
foreach (XmlNode index in indexes)
if (index["primary"].InnerText == name)
return true;
return false;
}
开发者ID:PalWow,项目名称:dbcviewer,代码行数:7,代码来源:DefinitionEditor.cs
示例5: getInformation
// ==================== METHODS ============================================
public bool getInformation(String sId, ref XmlNodeList ndList, ref XmlNode ndMovie)
{
try {
// Check if we currently have information on this movie
if (sId != this.idMovie) {
int iWaitTime = 1; // Number of seconds to wait
// Try get information
String sUrl = sBaseUrl + "idmovie-" + sId + "/xml";
String sContent = WebRequestGetData(sUrl);
while (!sContent.StartsWith ("<") ) {
// Try again
sContent = WebRequestGetData(sUrl);
// Check what we receive back
if (sContent == null) {
// Indicate that this is a premature end
errHandle.Status("getInformation: webrequest time-out");
return false;
}
}
// Read as XmlDocument
pdxMovie.LoadXml(sContent);
// Set the currnet idmovie
this.idMovie = sId;
}
// Set the list of nodes for this move
ndList = pdxMovie.SelectNodes("./descendant::subtitle");
ndMovie = pdxMovie.SelectSingleNode("./descendant::Movie");
return true;
} catch (Exception ex) {
errHandle.DoError("osrMoview/getInformation", ex);
return false;
}
}
开发者ID:ErwinKomen,项目名称:subtiel,代码行数:34,代码来源:osrMovie.cs
示例6: TopAlbum
public TopAlbum(XmlNodeList list)
{
foreach (XmlNode node in list)
{
switch (node.LocalName)
{
case "name":
this.name = node.InnerText;
break;
case "reach":
this.reach = node.InnerText;
break;
case "url":
this.url = node.InnerText;
break;
case "image":
foreach (XmlNode image_node in node.ChildNodes)
if (image_node.LocalName == "large")
image = image_node.InnerText;
break;
}
}
}
开发者ID:gsterjov,项目名称:fusemc,代码行数:26,代码来源:TopAlbum.cs
示例7: FillInCandidates
private static void FillInCandidates(Dictionary<string, UserInfo> candidates, XmlNodeList nodes, StreamWriter writer)
{
foreach (XmlNode userNode in nodes)
{
string userName = userNode.Attributes["name"].Value;
int edits = int.Parse(userNode.Attributes["editcount"].Value);
XmlNode editorNode = userNode.SelectSingleNode("//user[@name=" + EscapeXPathQuery(userName) + "]/groups[g='editor' or g='autoeditor' or g='sysop']/g");
if (editorNode != null)
{
writer.WriteLine(userName);
}
else if (edits > 500 && !candidates.ContainsKey(userName))
{
UserInfo userInfo = new UserInfo();
userInfo.User = userName;
userInfo.Edits = edits;
if (!string.IsNullOrEmpty(userNode.Attributes["registration"].Value))
{
userInfo.Registration = DateTime.Parse(userNode.Attributes["registration"].Value,
null,
System.Globalization.DateTimeStyles.AssumeUniversal);
}
candidates.Add(userName, userInfo);
}
}
}
开发者ID:Claymore,项目名称:WikiBots,代码行数:27,代码来源:Program.cs
示例8: LoadCustomConfiguration
/// <summary>
/// Load custom configuration from Xml
/// </summary>
/// <param name="customConfigElements">SAML token authentication requirements.</param>
/// <exception cref="ArgumentNullException">Input parameter 'customConfigElements' is null.</exception>
/// <exception cref="InvalidOperationException">Custom configuration specified was invalid.</exception>
public override void LoadCustomConfiguration(XmlNodeList customConfigElements)
{
if (customConfigElements == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("customConfigElements");
}
List<XmlElement> configNodes = XmlUtil.GetXmlElements(customConfigElements);
bool foundValidConfig = false;
foreach (XmlElement configElement in configNodes)
{
if (configElement.LocalName != ConfigurationStrings.SamlSecurityTokenRequirement)
{
continue;
}
if (foundValidConfig)
{
throw DiagnosticUtility.ThrowHelperInvalidOperation(SR.GetString(SR.ID7026, ConfigurationStrings.SamlSecurityTokenRequirement));
}
this.samlSecurityTokenRequirement = new SamlSecurityTokenRequirement(configElement);
foundValidConfig = true;
}
if (!foundValidConfig)
{
this.samlSecurityTokenRequirement = new SamlSecurityTokenRequirement();
}
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:39,代码来源:Saml2SecurityTokenHandler.cs
示例9: ParserMembers
protected override IDictionary<string, IMemberAttribute> ParserMembers(string typeFullName,
XmlNodeList memberNodes)
{
if (string.IsNullOrEmpty(typeFullName))
{
throw new ArgumentNullException("typeFullName");
}
object target = MemberCache.Get(typeFullName);
if (null == memberNodes || 0 == memberNodes.Count)
{
if (null == target)
{
return null;
}
return (IDictionary<string, IMemberAttribute>) target;
}
foreach (XmlNode node in memberNodes)
{
ParserMember(typeFullName, node);
}
if (null == target)
{
throw new Exception("Get the members attribute is error.");
}
return (IDictionary<string, IMemberAttribute>) target;
}
开发者ID:mbsky,项目名称:albian,代码行数:28,代码来源:PersistenceParser.cs
示例10: ErrorElementAdapter
public ErrorElementAdapter(XmlNodeList errorNodes, WixFiles wixFiles)
: base(wixFiles)
{
foreach (object o in errorNodes) {
this.errorNodes.Add(o);
}
}
开发者ID:xwiz,项目名称:WixEdit,代码行数:7,代码来源:ErrorElementAdapter.cs
示例11: Load
public static GuidanceShift Load(XmlNodeList inputNode, TaskDataDocument taskDataDocument)
{
var loader = new GuidanceShiftLoader(taskDataDocument);
var node = inputNode.Item(0);
return loader.Load(node);
}
开发者ID:ADAPT,项目名称:ISOv4Plugin,代码行数:7,代码来源:GuidanceShiftLoader.cs
示例12: ToString
public static string ToString(XmlNodeList nodes)
{
StringBuilder sb = new StringBuilder();
try
{
foreach (XmlNode node in nodes)
{
sb.AppendLine(node.OuterXml);
}
string s = "<Root>" + sb.ToString() + "</Root>";
s = Indent(s);
s = UStr.TrimStart(s, "<Root>");
s = UStr.TrimEnd(s, "</Root>");
return s;
}
catch
{
return "";
}
}
开发者ID:Erls-Corporation,项目名称:Singularity1.0,代码行数:26,代码来源:UXml.cs
示例13: SimpleWebTokenTrustedIssuersRegistry
public SimpleWebTokenTrustedIssuersRegistry(XmlNodeList customConfiguration)
{
this.configuredTrustedIssuers = new Dictionary<string, string>();
if (customConfiguration == null)
{
throw new ArgumentNullException("customConfiguration");
}
List<XmlElement> xmlElements = GetXmlElements(customConfiguration);
if (xmlElements.Count != 1)
{
throw new InvalidOperationException("There should be only one xml element as the configuration of this class");
}
XmlElement element = xmlElements[0];
if (!StringComparer.Ordinal.Equals(element.LocalName, "trustedIssuers"))
{
throw new InvalidOperationException("The top element of the configuration should be named 'trustedIssuers'");
}
foreach (XmlNode node in element.ChildNodes)
{
XmlElement addRemoveNode = node as XmlElement;
if (addRemoveNode != null)
{
if (StringComparer.Ordinal.Equals(addRemoveNode.LocalName, "add"))
{
XmlNode issuerIdentifierNode = addRemoveNode.Attributes.GetNamedItem("issuerIdentifier");
XmlNode nameNode = addRemoveNode.Attributes.GetNamedItem("name");
if (((addRemoveNode.Attributes.Count != 2) || (issuerIdentifierNode == null)) || ((nameNode == null) || string.IsNullOrEmpty(nameNode.Value)))
{
throw new InvalidOperationException("The <add> element is malformed. The right format is: <add issuerIdentifier=\"issuer identifier\" name=\"issuer friendly name\"");
}
string issuerIdentifier = issuerIdentifierNode.Value.ToLowerInvariant();
string name = string.Intern(nameNode.Value);
this.configuredTrustedIssuers.Add(issuerIdentifier, name);
}
else if (StringComparer.Ordinal.Equals(addRemoveNode.LocalName, "remove"))
{
if ((addRemoveNode.Attributes.Count != 1) || !StringComparer.Ordinal.Equals(addRemoveNode.Attributes[0].LocalName, "issuerIdentifier"))
{
throw new InvalidOperationException("The <remove> node should have a issuerIdentifier attribute");
}
string issuerIdentifier = addRemoveNode.Attributes.GetNamedItem("issuerIdentifier").Value;
this.configuredTrustedIssuers.Remove(issuerIdentifier);
}
else
{
if (!StringComparer.Ordinal.Equals(addRemoveNode.LocalName, "clear"))
{
throw new InvalidOperationException(string.Format("Invalid element: {0}", addRemoveNode.LocalName));
}
this.configuredTrustedIssuers.Clear();
}
}
}
}
开发者ID:junleqian,项目名称:Mobile-Restaurant,代码行数:60,代码来源:SimpleWebTokenTrustedIssuersRegistry.cs
示例14: ProgressTextElementAdapter
public ProgressTextElementAdapter(XmlNodeList progressTextNodes, WixFiles wixFiles)
: base(wixFiles)
{
foreach (object o in progressTextNodes) {
this.progressTextNodes.Add(o);
}
}
开发者ID:xwiz,项目名称:WixEdit,代码行数:7,代码来源:ProgressTextElementAdapter.cs
示例15: UnfurlNodes
public List<AvinodeMenuItem> UnfurlNodes(XmlNodeList xmlNodes)
{
var avinodeMenuItems = new List<AvinodeMenuItem>();
foreach (XmlNode node in xmlNodes)
{
var displayName = node["displayName"];
var nodePath = node["path"];
var subMenu = node.SelectNodes("subMenu/item");
if (displayName != null && nodePath != null)
{
var uriPath = new Uri(nodePath.Attributes["value"].Value, UriKind.Relative);
var subMenuItem = subMenu != null && subMenu.Count > 0 ? UnfurlNodes(subMenu) : null;
var isActive = RelativeUri == uriPath || (subMenuItem != null && subMenuItem.Any(menuItem => menuItem.Active));
avinodeMenuItems.Add(new AvinodeMenuItem
{
DisplayName = displayName.InnerText,
Path = uriPath,
Active = isActive,
SubMenuItem = subMenuItem
});
}
}
return avinodeMenuItems;
}
开发者ID:chaim1221,项目名称:ParsingXml,代码行数:26,代码来源:Helper.cs
示例16: ParseXML
public void ParseXML(XmlNodeList node)
{
foreach (XmlNode node2 in node)
{
//Debug.WriteLine("\tService Node >" + node2.Value + " : " + node2.Name);
switch (node2.Name)
{
case ("Name"):
{
name = node2.FirstChild.Value;
break;
}
case ("Port"):
{
port = Convert.ToInt32(node2.FirstChild.Value);
break;
}
case ("Status"):
{
status = node2.FirstChild.Value;
break;
}
}
}
}
开发者ID:keithloughnane,项目名称:Omnipresent,代码行数:25,代码来源:Service.cs
示例17: ParseDestinations
private static List<ExchangeItem> ParseDestinations(XmlNodeList nodelist)
{
var items = new List<ExchangeItem>();
foreach (XmlNode node in nodelist)
{
var ei = new ExchangeItem();
items.Add(ei);
foreach (XmlNode childNode in node.ChildNodes)
{
switch (childNode.Name)
{
case "enabled":
ei.Enabled = string.IsNullOrEmpty(childNode.InnerText) ? false : bool.Parse(childNode.InnerText);
break;
case "last-upload-failed":
ei.LastUploadFailed = string.IsNullOrEmpty(childNode.InnerText) ? false : bool.Parse(childNode.InnerText);
break;
case "exchange-name":
ei.ExchangeName = string.IsNullOrEmpty(childNode.InnerText) ? string.Empty : childNode.InnerText;
break;
case "last-upload-at":
ei.LastUploadAt = string.IsNullOrEmpty(childNode.InnerText) ? new DateTime?() : DateTime.Parse(childNode.InnerText);
break;
default:
break;
}
}
}
return items;
}
开发者ID:tccyp001,项目名称:ticketrevolution,代码行数:30,代码来源:ServiceHandlers.cs
示例18: AreEqual
public static void AreEqual(XmlNodeList prnNodes, List<ProductComponent> productComponents, XmlNodeList productNodes, Catalog catalog, Dictionary<string, List<UniqueId>> linkList)
{
for (int i = 0; i < prnNodes.Count; i++)
{
AreEqual(prnNodes[i], productComponents[i], productNodes, catalog, linkList);
}
}
开发者ID:ADAPT,项目名称:ISOv4Plugin,代码行数:7,代码来源:ProductComponentAssert.cs
示例19: DeserializeGroupPresets
private void DeserializeGroupPresets(PresetVoiLutCollection presets, XmlNodeList presetNodes)
{
foreach (XmlElement presetNode in presetNodes)
{
string keyStrokeAttribute = presetNode.GetAttribute("keystroke");
XKeys keyStroke = XKeys.None;
if (!String.IsNullOrEmpty(keyStrokeAttribute))
keyStroke = (XKeys)_xkeysConverter.ConvertFromInvariantString(keyStrokeAttribute);
string factoryName = presetNode.GetAttribute("factory");
IPresetVoiLutOperationFactory factory = PresetVoiLutOperationFactories.GetFactory(factoryName);
if (factory == null)
continue;
PresetVoiLutConfiguration configuration = PresetVoiLutConfiguration.FromFactory(factory);
XmlNodeList configurationItems = presetNode.SelectNodes("configuration/item");
foreach (XmlElement configurationItem in configurationItems)
configuration[configurationItem.GetAttribute("key")] = configurationItem.GetAttribute("value");
try
{
IPresetVoiLutOperation operation = factory.Create(configuration);
PresetVoiLut preset = new PresetVoiLut(operation);
preset.KeyStroke = keyStroke;
presets.Add(preset);
}
catch(Exception e)
{
Platform.Log(LogLevel.Error, e);
continue;
}
}
}
开发者ID:nhannd,项目名称:Xian,代码行数:35,代码来源:PresetVoiLutSettings.cs
示例20: LoadCustomConfiguration
/// <summary>
/// Overloads the base class method to load the custom policies from the config file
/// </summary>
/// <param name="nodelist">XmlNodeList containing the policy information read from the config file</param>
public override void LoadCustomConfiguration(XmlNodeList nodelist)
{
foreach (XmlNode node in nodelist)
{
//
// Initialize the policy cache
//
var rdr = XmlDictionaryReader.CreateDictionaryReader(new XmlTextReader(new StringReader(node.OuterXml)));
rdr.MoveToContent();
var resource = rdr.GetAttribute("resource");
var action = rdr.GetAttribute("action");
Expression<Func<ClaimsPrincipal, bool>> policyExpression = _policyReader.ReadPolicy(rdr);
//
// Compile the policy expression into a function
//
Func<ClaimsPrincipal, bool> policy = policyExpression.Compile();
//
// Insert the policy function into the policy cache
//
_policies[new ResourceAction(resource, action)] = policy;
}
}
开发者ID:andyevans2000,项目名称:Illuminate,代码行数:30,代码来源:IlluminateAuthorisationManager.cs
注:本文中的System.Xml.XmlNodeList类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论