本文整理汇总了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();
}
示例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)
}
示例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);
}
示例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
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}