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


C# XPathNavigator.CreateNavigator方法代码示例

本文整理汇总了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));
             }
         }
     }
 }
开发者ID:huangchaosuper,项目名称:watf,代码行数:28,代码来源:Package.cs

示例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));
             }
         }
     }
 }
开发者ID:huangchaosuper,项目名称:watf,代码行数:28,代码来源:Load.cs

示例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());
     }
 }
开发者ID:0anion0,项目名称:IBN,代码行数:12,代码来源:Element.cs

示例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));
         }
     }
 }
开发者ID:huangchaosuper,项目名称:watf,代码行数:13,代码来源:Test.cs

示例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));
         }
     }
 }
开发者ID:huangchaosuper,项目名称:watf,代码行数:13,代码来源:ConfigFile.cs

示例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));
         }
     }
 }
开发者ID:huangchaosuper,项目名称:watf,代码行数:13,代码来源:Import.cs

示例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);
         }
     }
 }
开发者ID:huangchaosuper,项目名称:watf,代码行数:14,代码来源:Var.cs

示例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);
         }
     }
 }
开发者ID:huangchaosuper,项目名称:watf,代码行数:23,代码来源:Action.cs

示例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));
         }
     }
 }
开发者ID:huangchaosuper,项目名称:watf,代码行数:17,代码来源:Step.cs

示例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));
         }
     }
 }
开发者ID:huangchaosuper,项目名称:watf,代码行数:17,代码来源:Executive.cs

示例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);
				}
			}
		}
开发者ID:nagarjunachallapalli,项目名称:n2cms,代码行数:17,代码来源:AttachmentXmlReader.cs

示例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;
        }
开发者ID:peeboo,项目名称:open-media-library,代码行数:18,代码来源:TheMovieDbBackDropDownloader.cs

示例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;
         }
     }
 }
开发者ID:jackiechou,项目名称:thegioicuaban.com,代码行数:38,代码来源:PackageInstaller.cs

示例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();
            }
开发者ID:peeboo,项目名称:open-media-library,代码行数:67,代码来源:MyMoviesImporter.cs

示例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);
        }
开发者ID:nick-randal,项目名称:UsefulCSharp,代码行数:17,代码来源:QuickXmlGenerator.cs


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