ToString() public method

public ToString ( ) : string
return string
        //=====================================================================

        /// <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();
        }
 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)
 }
 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);
 }
 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
 }
		/// <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;
		}
		/// <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;
		}
Example #7
0
 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;
 }
Example #8
0
        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;
        }
        /// <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;
        }