本文整理汇总了C#中System.Xml.XPath.XPathNavigator.CreateNavigator方法的典型用法代码示例。如果您正苦于以下问题:C# XPathNavigator.CreateNavigator方法的具体用法?C# XPathNavigator.CreateNavigator怎么用?C# XPathNavigator.CreateNavigator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XPath.XPathNavigator
的用法示例。
在下文中一共展示了XPathNavigator.CreateNavigator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Package
public Package(XPathNavigator xPathNavigator)
: base(xPathNavigator)
{
this.m_Attributes = new Interface.WATFDictionary<string, string>();
XPathNavigator copyXPathNavigator = xPathNavigator.CreateNavigator();
if(copyXPathNavigator.MoveToFirstAttribute())
{
if(copyXPathNavigator.Name.Equals(GlobalDefine.Keyword.Executive.Path))
{
this.m_Attributes.Add(copyXPathNavigator.Name, Path.Value(xPathNavigator));
}
else if(copyXPathNavigator.Name.Equals(GlobalDefine.Keyword.Executive.Prefix))
{
this.m_Attributes.Add(copyXPathNavigator.Name, Prefix.Value(xPathNavigator));
}
while (copyXPathNavigator.MoveToNextAttribute())
{
if (copyXPathNavigator.Name.Equals(GlobalDefine.Keyword.Executive.Path))
{
this.m_Attributes.Add(copyXPathNavigator.Name, Path.Value(xPathNavigator));
}
else if (copyXPathNavigator.Name.Equals(GlobalDefine.Keyword.Executive.Prefix))
{
this.m_Attributes.Add(copyXPathNavigator.Name, Prefix.Value(xPathNavigator));
}
}
}
}
示例2: Load
public Load(XPathNavigator xPathNavigator)
: base(xPathNavigator)
{
this.m_Attributes = new WATF.Compiler.Interface.WATFDictionary<string, string>();
XPathNavigator copyXPathNavigator = xPathNavigator.CreateNavigator();
if (copyXPathNavigator.MoveToFirstAttribute())
{
if (copyXPathNavigator.Name.Equals(GlobalDefine.Keyword.ConfigFile.Name))
{
this.m_Attributes.Add(GlobalDefine.Keyword.ConfigFile.Name, Name.Value(xPathNavigator));
}
else if (copyXPathNavigator.Name.Equals(GlobalDefine.Keyword.ConfigFile.Path))
{
this.m_Attributes.Add(GlobalDefine.Keyword.ConfigFile.Path, Path.Value(xPathNavigator));
}
while (copyXPathNavigator.MoveToNextAttribute())
{
if (copyXPathNavigator.Name.Equals(GlobalDefine.Keyword.ConfigFile.Name))
{
this.m_Attributes.Add(GlobalDefine.Keyword.ConfigFile.Name, Name.Value(xPathNavigator));
}
else if (copyXPathNavigator.Name.Equals(GlobalDefine.Keyword.ConfigFile.Path))
{
this.m_Attributes.Add(GlobalDefine.Keyword.ConfigFile.Path, Path.Value(xPathNavigator));
}
}
}
}
示例3: Element
internal Element(XPathNavigator node)
: this(node.Name)
{
XPathNavigator navigator = node.CreateNavigator();
if (navigator.MoveToFirstAttribute())
{
do
{
AddAttribute(navigator.Name, navigator.Value);
} while (navigator.MoveToNextAttribute());
}
}
示例4: Test
public Test(XPathNavigator xPathNavigator)
: base(xPathNavigator)
{
m_TestChilds = new Interface.WATFDictionary<string, Interface.WATFPathNavigator>();
XPathNodeIterator xPathNodeIterator = xPathNavigator.CreateNavigator().SelectChildren(XPathNodeType.Element);
while (xPathNodeIterator.MoveNext())
{
if (xPathNodeIterator.Current.LocalName.Equals(GlobalDefine.Keyword.Executive.Step))
{
m_TestChilds.Add(GlobalDefine.Keyword.Executive.Step, new Step.Step(xPathNodeIterator.Current));
}
}
}
示例5: ConfigFile
private ConfigFile(XPathNavigator xPathNavigator)
: base(xPathNavigator)
{
m_ConfigFileNodes = new Interface.WATFDictionary<string, Interface.WATFPathNavigator>();
XPathNodeIterator xPathNodeIterator = xPathNavigator.CreateNavigator().SelectChildren(XPathNodeType.Element);
while (xPathNodeIterator.MoveNext())
{
if(xPathNodeIterator.Current.LocalName.Equals(GlobalDefine.Keyword.ConfigFile.Load))
{
m_ConfigFileNodes.Add(GlobalDefine.Keyword.ConfigFile.Load, new Load.Load(xPathNodeIterator.Current));
}
}
}
示例6: Import
public Import(XPathNavigator xPathNavigator)
: base(xPathNavigator)
{
this.m_ImportChilds = new Interface.WATFDictionary<String, WATF.Compiler.Interface.WATFPathNavigator>();
XPathNodeIterator xPathNodeIterator = xPathNavigator.CreateNavigator().SelectChildren(XPathNodeType.Element);
while (xPathNodeIterator.MoveNext())
{
if (xPathNodeIterator.Current.LocalName.Equals(GlobalDefine.Keyword.Executive.Package))
{
m_ImportChilds.Add(xPathNodeIterator.Current.LocalName, new Package.Package(xPathNodeIterator.Current));
}
}
}
示例7: Var
public Var(XPathNavigator xPathNavigator)
: base(xPathNavigator)
{
this.m_Attributes = new Interface.WATFDictionary<string, string>();
XPathNavigator copyXPathNavigator = xPathNavigator.CreateNavigator();
if (copyXPathNavigator.MoveToFirstAttribute())
{
this.m_Attributes.Add(copyXPathNavigator.Name, copyXPathNavigator.Value);
while (copyXPathNavigator.MoveToNextAttribute())
{
this.m_Attributes.Add(copyXPathNavigator.Name, copyXPathNavigator.Value);
}
}
}
示例8: Action
public Action(XPathNavigator xPathNavigator)
: base(xPathNavigator)
{
m_ActionChilds = new Interface.WATFDictionary<string, Interface.WATFPathNavigator>();
XPathNodeIterator xPathNodeIterator = xPathNavigator.CreateNavigator().SelectChildren(XPathNodeType.Element);
while (xPathNodeIterator.MoveNext())
{
if (xPathNodeIterator.Current.LocalName.Equals(GlobalDefine.Keyword.Executive.Action))
{
m_ActionChilds.Add(GlobalDefine.Keyword.Executive.Action, new Action(xPathNodeIterator.Current));
}
}
this.m_Attributes = new Interface.WATFDictionary<string, string>();
XPathNavigator copyXPathNavigator = xPathNavigator.CreateNavigator();
if (copyXPathNavigator.MoveToFirstAttribute())
{
this.m_Attributes.Add(copyXPathNavigator.Name, copyXPathNavigator.Value);
while (copyXPathNavigator.MoveToNextAttribute())
{
this.m_Attributes.Add(copyXPathNavigator.Name,copyXPathNavigator.Value);
}
}
}
示例9: Step
public Step(XPathNavigator xPathNavigator)
: base(xPathNavigator)
{
m_StepChilds = new Interface.WATFDictionary<string, Interface.WATFPathNavigator>();
XPathNodeIterator xPathNodeIterator = xPathNavigator.CreateNavigator().SelectChildren(XPathNodeType.Element);
while (xPathNodeIterator.MoveNext())
{
if (xPathNodeIterator.Current.LocalName.Equals(GlobalDefine.Keyword.Executive.Var))
{
m_StepChilds.Add(GlobalDefine.Keyword.Executive.Var, new Var.Var(xPathNodeIterator.Current));
}
else if (xPathNodeIterator.Current.LocalName.Equals(GlobalDefine.Keyword.Executive.Action))
{
m_StepChilds.Add(GlobalDefine.Keyword.Executive.Action, new Action.Action(xPathNodeIterator.Current));
}
}
}
示例10: Executive
public Executive(XPathNavigator xPathNavigator)
: base(xPathNavigator)
{
XPathNodeIterator xPathNodeIterator = xPathNavigator.CreateNavigator().SelectChildren(XPathNodeType.Element);
m_ExeChilds = new Interface.WATFDictionary<string, Interface.WATFPathNavigator>();
while (xPathNodeIterator.MoveNext())
{
if (xPathNodeIterator.Current.LocalName.Equals(GlobalDefine.Keyword.Executive.Import))
{
m_ExeChilds.Add(xPathNodeIterator.Current.LocalName, new Import.Import(xPathNodeIterator.Current));
}
else if (xPathNodeIterator.Current.LocalName.Equals(GlobalDefine.Keyword.Executive.Test))
{
m_ExeChilds.Add(xPathNodeIterator.Current.LocalName, new Test.Test(xPathNodeIterator.Current));
}
}
}
示例11: Read
public void Read(XPathNavigator navigator, ContentItem item, ReadingJournal journal)
{
IDictionary<string, IAttachmentHandler> attachments = _explorer.Map<IAttachmentHandler>(item.GetContentType());
foreach(XPathNavigator attachmentElement in EnumerateChildren(navigator))
{
string name = attachmentElement.GetAttribute("name", string.Empty);
if(attachments.ContainsKey(name))
{
XPathNavigator attachmentContents = navigator.CreateNavigator();
attachmentContents.MoveToFirstChild();
Attachment a = attachments[name].Read(attachmentContents, item);
if(a != null)
journal.Report(a);
}
}
}
示例12: GrabBackDropUrls
public IList<string> GrabBackDropUrls(XPathNavigator nav)
{
List<string> urls = new List<string>();
XPathNodeIterator nIter = nav.SelectChildren("backdrop", "");
if (nav.MoveToFollowing("backdrop", ""))
{
XPathNavigator localNav = nav.CreateNavigator();
nav.MoveToParent();
for (int i = 0; i < nIter.Count; i++)
{
if (localNav.GetAttribute("size", "").ToUpperInvariant().Equals("original".ToUpperInvariant()))
urls.Add(localNav.Value);
localNav.MoveToNext();
}
}
return urls;
}
示例13: ReadComponents
private void ReadComponents(XPathNavigator manifestNav)
{
foreach (XPathNavigator componentNav in manifestNav.CreateNavigator().Select("components/component"))
{
int order = ComponentInstallers.Count;
string type = componentNav.GetAttribute("type", "");
if (InstallMode == InstallMode.Install)
{
string installOrder = componentNav.GetAttribute("installOrder", "");
if (!string.IsNullOrEmpty(installOrder))
{
order = int.Parse(installOrder);
}
}
else
{
string unInstallOrder = componentNav.GetAttribute("unInstallOrder", "");
if (!string.IsNullOrEmpty(unInstallOrder))
{
order = int.Parse(unInstallOrder);
}
}
if (Package.InstallerInfo != null)
{
Log.AddInfo(Util.DNN_ReadingComponent + " - " + type);
}
ComponentInstallerBase installer = InstallerFactory.GetInstaller(componentNav, Package);
if (installer == null)
{
Log.AddFailure(Util.EXCEPTION_InstallerCreate);
}
else
{
ComponentInstallers.Add(order, installer);
this.Package.InstallerInfo.AllowableFiles += ", " + installer.AllowableFiles;
}
}
}
示例14: loadDataFromNavigatorToTitle
//.........这里部分代码省略.........
SDKUtilities.DebugLine("[MyMoviesImporter] This appears to be rated PG13");
newTitle.ParentalRating = "PG13";
break;
case 5:
SDKUtilities.DebugLine("[MyMoviesImporter] I have NO idea what rating this is");
break;
case 6:
SDKUtilities.DebugLine("[MyMoviesImporter] This appears to be rated R");
newTitle.ParentalRating = "R";
break;
}
else
SDKUtilities.DebugLine("[MyMoviesImporter] Error parsing rating: {0} not a number", ratingId);
}
string ratingReason = GetChildNodesValue(navigator, "Description");
if (!string.IsNullOrEmpty(ratingReason))
newTitle.ParentalRatingReason = ratingReason;
}
navigator.MoveToParent();
}
#endregion
newTitle.Runtime = Int32.Parse(GetChildNodesValue(navigator, "RunningTime"));
#region persons
if (navigator.MoveToChild("Persons", ""))
{
SDKUtilities.DebugLine("[MyMoviesImporter] Beginning the long, painful process of scanning people");
if (navigator.HasChildren)
{
XPathNodeIterator nIter = navigator.SelectChildren("Person", "");
if (navigator.MoveToFirstChild())
{
XPathNavigator localNav = navigator.CreateNavigator();
navigator.MoveToParent();
for (int i = 0; i < nIter.Count; i++)
{
string name = GetChildNodesValue(localNav, "Name");
string role = GetChildNodesValue(localNav, "Role");
string type = GetChildNodesValue(localNav, "Type");
if (!string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(type))
{
switch (type)
{
case "Actor":
SDKUtilities.DebugLine("[MyMoviesImporter] actor {0}, {1}", name, role);
newTitle.AddActingRole(name, role);
break;
case "Director":
SDKUtilities.DebugLine("[MyMoviesImporter] director {0}", name);
newTitle.AddDirector(new OMLSDKPerson(name));
break;
default:
break;
}
}
localNav.MoveToNext("Person", "");
}
}
}
navigator.MoveToParent();
}
示例15: WriteElement
private static void WriteElement(TextWriter writer, XPathNavigator nav, int depth, string leadIn)
{
writer.Write(leadIn);
writer.WriteLine(nav.Name);
WriteNamespaces(writer, nav, leadIn);
if (nav.HasAttributes)
WriteAttributes(writer, nav, leadIn);
if (!nav.HasChildren)
return;
var childNav = nav.CreateNavigator();
childNav.MoveToFirstChild();
Traverse(writer, childNav, depth + 1);
}