Example #1
0
 /// <summary>
 /// Gets the value as a generic object for the specified element.
 /// </summary>
 /// <param name="element">The element to get the value from.</param>
 /// <returns></returns>
 protected object GetTypedValue(inf.IFunctionParameter element)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     return(element.GetTypedValue(DataType, 0));
 }
Example #2
0
 /// <summary>
 /// Evaluates the function.
 /// </summary>
 /// <param name="context">The evaluation context instance.</param>
 /// <param name="args">The function arguments.</param>
 /// <returns>The result value of the function evaluation.</returns>
 public override EvaluationValue Evaluate(EvaluationContext context, params inf.IFunctionParameter[] args)
 {
     if (context == null)
     {
         throw new ArgumentNullException("context");
     }
     if (args == null)
     {
         throw new ArgumentNullException("args");
     }
     if (args[0].IsBag && args[0].BagSize == 1)
     {
         inf.IFunctionParameter attrib = (inf.IFunctionParameter)args[0].Elements[0];
         return(new EvaluationValue(GetTypedValue(attrib), DataType));
     }
     else
     {
         return(EvaluationValue.Indeterminate);
     }
 }
 /// <summary>
 /// Adds an object to the end of the CollectionBase.
 /// </summary>
 /// <param name="value">The Object to be added to the end of the CollectionBase. </param>
 /// <returns>The CollectionBase index at which the value has been added.</returns>
 public int Add(inf.IFunctionParameter value)
 {
     return(List.Add(value));
 }
 /// <summary>
 /// Returns a IFunctionParameter[] of the Collection contents.
 /// </summary>
 /// <returns></returns>
 public inf.IFunctionParameter[] ToArray()
 {
     inf.IFunctionParameter[] retArr = new inf.IFunctionParameter[Count];
     List.CopyTo(retArr, 0);
     return(retArr);
 }
		/// <summary>
		/// Returns a IFunctionParameter[] of the Collection contents.
		/// </summary>
		/// <returns></returns>
		public inf.IFunctionParameter[] ToArray()
		{
			inf.IFunctionParameter[] retArr = new inf.IFunctionParameter[ Count ];
			List.CopyTo( retArr, 0 );
			return retArr;
		}