本文整理汇总了C#中IElementDef.GetSQPPath方法的典型用法代码示例。如果您正苦于以下问题:C# IElementDef.GetSQPPath方法的具体用法?C# IElementDef.GetSQPPath怎么用?C# IElementDef.GetSQPPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IElementDef
的用法示例。
在下文中一共展示了IElementDef.GetSQPPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ElementRef
/// <summary>
/// Creates an ElementRef instance using the specified IElementDef as the reference path
/// </summary>
/// <param name="root"></param>
/// <param name="referencedField"></param>
/// <param name="version"></param>
public ElementRef(IElementDef root, IElementDef referencedField, SifVersion version)
{
fField = referencedField;
fXPath = referencedField.GetSQPPath(version);
}
示例2: AddCondition
/// <summary>
/// Add a condition to this query.
/// </summary>
/// <remarks>
/// This method of adding conditions is convenient for adding conditions involving
/// root attributes or elements to a query. If you need to add conditions on deeply
/// nested elements, use <see cref="AddCondition(string,ComparisonOperators,string)"/>
/// </remarks>
/// <param name="field">A constant from the package DTD class that identifies an element
/// or attribute of the data object (e.g. <c>StudentDTD.STUDENTPERSONAL_REFID</c>)</param>
/// <param name="ops">The comparison operator. Comparison operator constants are
/// defined by the ComparisionOperators enum</param>
/// <param name="value">The data that is used to compare to the element or attribute</param>
/// <exception cref="ArgumentException">if the ElementDef does not represent an immediate
/// child of the object being queried.</exception>
public void AddCondition(IElementDef field, ComparisonOperators ops, String value)
{
// Do some validation to try to prevent invalid query paths from being created
String relativePath = field.GetSQPPath(Adk.SifVersion);
IElementDef lookedUp = Adk.Dtd.LookupElementDefBySQP(fObjType, relativePath);
if (lookedUp == null)
{
throw new ArgumentException("Invalid path: " + fObjType.Name + "/" + relativePath +
" is unable to be resolved");
}
AddCondition(new Condition(fObjType, relativePath, ops, value));
}