當前位置: 首頁>>代碼示例>>C#>>正文


C# XPathNavigator.ToString方法代碼示例

本文整理匯總了C#中System.Xml.XPath.XPathNavigator.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# XPathNavigator.ToString方法的具體用法?C# XPathNavigator.ToString怎麽用?C# XPathNavigator.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Xml.XPath.XPathNavigator的用法示例。


在下文中一共展示了XPathNavigator.ToString方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ConceptualLinkInfo

        //=====================================================================

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="node">The XPath navigator node from which to load the link settings</param>
        /// <exception cref="ArgumentNullException">This is thrown if the node parameters is null</exception>
        public ConceptualLinkInfo(XPathNavigator node)
        {
            string target;
            int pos;

            if(node == null)
                throw new ArgumentNullException("node");

            target = node.GetAttribute("target", string.Empty);

            // EFW - Added support for an optional anchor name in the target
            pos = target.IndexOf('#');

            if(pos != -1)
            {
                this.Anchor = target.Substring(pos);
                target = target.Substring(0, pos);
            }

            this.Target = target.ToLowerInvariant();

            // EFW - Trim off unwanted whitespace
            this.Text = node.ToString().Trim();
        }
開發者ID:julianhaslinger,項目名稱:SHFB,代碼行數:31,代碼來源:ConceptualLinkInfo.cs

示例2: HiToTextEntryHeaderName

 public HiToTextEntryHeaderName(XPathNavigator path)
 {
     /*
     XPathNodeIterator ni = path.Select("Name");
     this.Value = ni.Current.Value;
     if (ni.Current.HasAttributes)
     {
         this.NumberOfBytesSpecified = true;
         this.NumberOfBytes = Convert.ToInt32(ni.Current.GetAttribute("NumberOfBytes", string.Empty));
     }
       */
       this.Value = path.ToString(); //Safe? TODO It seems we can only get to this level with a single value in path (a file extension)
 }
開發者ID:johkelly,項目名稱:HiToText_Mono,代碼行數:13,代碼來源:HiToText.XPathLoad.cs

示例3: Create

 public static ConceptualLinkInfo Create (XPathNavigator node) {
     if (node == null) throw new ArgumentNullException("node");
     
     ConceptualLinkInfo info = new ConceptualLinkInfo();
     
     info.target = node.GetAttribute("target", String.Empty);
     info.text = node.ToString();
     
     return(info);
 }
開發者ID:hnlshzx,項目名稱:DotNetOpenAuth,代碼行數:10,代碼來源:ResolveConceptualLinksComponent.cs

示例4: HiToTextEntryFieldNameSpecialUtilization

 public HiToTextEntryFieldNameSpecialUtilization(XPathNavigator path)
 {
     if (!path.GetAttribute("Function", string.Empty).Equals(string.Empty))
         this.Function = path.GetAttribute("Function", string.Empty);
     /*
     XPathNodeIterator ni = path.Select("SpecialUtilization");
     this.Value = ni.Current.Value;*/
     this.Value = path.ToString(); // Safe? TODO
 }
開發者ID:johkelly,項目名稱:HiToText_Mono,代碼行數:9,代碼來源:HiToText.XPathLoad.cs

示例5: MoveTo

		/// <summary>
		/// See <see cref="XPathNavigator.MoveTo"/>.
		/// </summary>
		public override bool MoveTo(XPathNavigator other) 
		{
			bool res = _navigator.MoveTo(other);
			System.Diagnostics.Debug.WriteLine("MoveTo(" + (other != null ? other.ToString() : "null") + ") = " + res);
			return res;
		}
開發者ID:zanyants,項目名稱:mvp.xml,代碼行數:9,代碼來源:DebuggingXPathNavigator.cs

示例6: IsSamePosition

		/// <summary>
		/// See <see cref="XPathNavigator.IsSamePosition"/>.
		/// </summary>
		public override bool IsSamePosition(XPathNavigator other) 
		{
			bool res = _navigator.IsSamePosition(other);
			System.Diagnostics.Debug.WriteLine("IsSamePosition(" + (other != null ? other.ToString() : "null") + ") = " + res);
			return res;
		}
開發者ID:zanyants,項目名稱:mvp.xml,代碼行數:9,代碼來源:DebuggingXPathNavigator.cs

示例7: NonVuoto

 public static bool NonVuoto(XPathNavigator navigator)
 {
     Boolean risultato = true;
     try
     {
         String contenuto = navigator.ToString();
         if (contenuto == "")
             risultato = false;
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
     return risultato;
 }
開發者ID:Esriitalia,項目名稱:VerA,代碼行數:15,代碼來源:ControlliSemplici.cs

示例8: Email

        public static bool Email(XPathNavigator navigator)
        {
            Boolean risultato = true;
            String email = navigator.ToString();
            String MatchEmailPattern =
            @"^(([\w-]+\.)+[\w-]+|([a-zA-Z]{1}|[\w-]{2,}))@"
             + @"((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?
                [0-9]{1,2}|25[0-5]|2[0-4][0-9])\."
             + @"([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?
                [0-9]{1,2}|25[0-5]|2[0-4][0-9])){1}|"
             + @"([a-zA-Z0-9]+[\w-]+\.)+[a-zA-Z]{1}[a-zA-Z0-9-]{1,23})$";

            Regex regex = new Regex(MatchEmailPattern);
            Match match = regex.Match(email);

            if (!match.Success)
                risultato = false;
            return risultato;
        }
開發者ID:Esriitalia,項目名稱:VerA,代碼行數:19,代碼來源:ControlliSemplici.cs

示例9: Create

        /// <summary>
        /// This is used to create a conceptual link based on the information
        /// in the supplied XPath navigator.
        /// </summary>
        /// <param name="node">The XPath navigator node from which to load the
        /// link settings.</param>
        /// <returns>A conceptual link info object</returns>
        /// <exception cref="ArgumentNullException">This is thrown if the
        /// node parameters is null.</exception>
        public static ConceptualLinkInfo Create(XPathNavigator node)
        {
            string target;
            int pos;

            if(node == null)
                throw new ArgumentNullException("node");

            ConceptualLinkInfo info = new ConceptualLinkInfo();
            target = node.GetAttribute("target", string.Empty);

            // EFW - Added support for an optional anchor name in the target
            pos = target.IndexOf('#');
            if(pos != -1)
            {
                info.anchor = target.Substring(pos);
                target = target.Substring(0, pos);
            }

            info.target = target;

            // EFW - Trim off unwanted whitespace
            info.text = node.ToString().Trim();
            return info;
        }
開發者ID:codemonster234,項目名稱:scbuilder,代碼行數:34,代碼來源:ConceptualLinkInfo.cs


注:本文中的System.Xml.XPath.XPathNavigator.ToString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。