/// <summary>
 /// Creates an <see cref="ResourceRangeVariableReferenceNode"/>.
 /// </summary>
 /// <param name="name"> The name of the associated range variable (null if none)</param>
 /// <param name="rangeVariable">The actual range variable on the bind stack that this refers to</param>
 /// <exception cref="System.ArgumentNullException">Throws if the input name or rangeVariable is null.</exception>
 public ResourceRangeVariableReferenceNode(string name, ResourceRangeVariable rangeVariable)
 {
     ExceptionUtils.CheckArgumentNotNull(name, "name");
     ExceptionUtils.CheckArgumentNotNull(rangeVariable, "rangeVariable");
     this.name                    = name;
     this.navigationSource        = rangeVariable.NavigationSource;
     this.structuredTypeReference = rangeVariable.StructuredTypeReference;
     this.rangeVariable           = rangeVariable;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a RangeVariableReferenceNode for a given range variable
 /// </summary>
 /// <param name="rangeVariable">Name of the rangeVariable.</param>
 /// <returns>A new SingleValueNode (either a Resource or NonResource RangeVariableReferenceNode.</returns>
 internal static SingleValueNode CreateRangeVariableReferenceNode(RangeVariable rangeVariable)
 {
     if (rangeVariable.Kind == RangeVariableKind.NonResource)
     {
         return(new NonResourceRangeVariableReferenceNode(rangeVariable.Name, (NonResourceRangeVariable)rangeVariable));
     }
     else
     {
         ResourceRangeVariable resourceRangeVariable = (ResourceRangeVariable)rangeVariable;
         return(new ResourceRangeVariableReferenceNode(resourceRangeVariable.Name, resourceRangeVariable));
     }
 }