本文整理汇总了C#中IExpr类的典型用法代码示例。如果您正苦于以下问题:C# IExpr类的具体用法?C# IExpr怎么用?C# IExpr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IExpr类属于命名空间,在下文中一共展示了IExpr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetParameterMethod
internal void SetParameterMethod(string pm, IExpr[] args)
{
if (!this.p.MultiValue)
throw new ArgumentException(string.Format("{0} must be a MultiValue parameter to accept methods", this.p.Name.Nm));
if (pm == null)
{
_type = ReportParameterMethodEnum.Index;
}
else switch (pm)
{
case "Contains": _type = ReportParameterMethodEnum.Contains; break;
case "BinarySearch": _type = ReportParameterMethodEnum.BinarySearch; break;
case "Count":
_type = ReportParameterMethodEnum.Count;
if (args != null)
throw new ArgumentException("Count does not have any arguments.");
break;
case "IndexOf": _type = ReportParameterMethodEnum.IndexOf; break;
case "LastIndexOf": _type = ReportParameterMethodEnum.LastIndexOf; break;
case "Value": _type = ReportParameterMethodEnum.Value; break;
default:
throw new ArgumentException(string.Format("{0} is an unknown array method.", pm));
}
if (_type != ReportParameterMethodEnum.Count)
{
if (args == null || args.Length != 1)
throw new ArgumentException(string.Format("{0} must have exactly one argument.", pm));
_arg = args[0];
}
return;
}
示例2: Function
public Function(string name, IExpr fst, IExpr snd)
{
this.IsBinary = true;
this.Name = name;
this.FirstArgument = fst;
this.SecondArgument = snd;
}
示例3: FunctionAggrStdevp
string _key; // key for cache when scope is dataset we can cache the result
/// <summary>
/// Aggregate function: Stdevp = (sqrt(n sum(square(x)) - square((sum(x))) / n*n)
/// Stdev assumes values are a sample of the population of data. If the data
/// is the entire representation then use Stdevp.
///
/// Return type is decimal for decimal expressions and double for all
/// other expressions.
/// </summary>
public FunctionAggrStdevp(List<ICacheData> dataCache, IExpr e, object scp)
: base(e, scp)
{
_key = "aggrstdevp" + Interlocked.Increment(ref Parser.Counter).ToString();
dataCache.Add(this);
}
示例4: ConstantOptimization
public virtual IExpr ConstantOptimization()
{
_ArgExpr = _ArgExpr.ConstantOptimization();
if (_ArgExpr.IsConstant())
{
string o = _ArgExpr.EvaluateString(null, null);
if (o == null)
throw new Exception("Globals collection argument is null");
switch (o.ToLower())
{
case "pagenumber":
return new FunctionPageNumber();
case "totalpages":
return new FunctionTotalPages();
case "executiontime":
return new FunctionExecutionTime();
case "reportfolder":
return new FunctionReportFolder();
case "reportname":
return new FunctionReportName();
default:
throw new Exception(string.Format("Globals collection argument '{0}' is unknown.", o));
}
}
return this;
}
示例5: FunctionAggrCountDistinct
string _key; // key used for caching value
#endregion Fields
#region Constructors
/// <summary>
/// Aggregate function: CountDistinct
///
/// Return type is double
/// </summary>
public FunctionAggrCountDistinct(List<ICacheData> dataCache, IExpr e, object scp)
: base(e, scp)
{
_key = "countdistinct" + Interlocked.Increment(ref Parser.Counter).ToString();
dataCache.Add(this);
}
示例6: FunctionSystem
TypeCode _ReturnTypeCode; // the return type
/// <summary>
/// passed class name, function name, and args for evaluation
/// </summary>
public FunctionSystem(string c, string f, IExpr[] a, TypeCode type)
{
_Cls = c;
_Func = f;
_Args = a;
_ReturnTypeCode = type;
}
示例7: Elt
public Elt(What what, IExpr ty) {
Contract.Requires(what != What.Bottom || ty == null);
Contract.Requires(what != What.Exact || ty != null);
this.what = what;
this.ty = ty;
this.manyBounds = null;
}
示例8: FunctionAggrMax
string _key; // key for caching
/// <summary>
/// Aggregate function: Max returns the highest value
/// Return type is same as input expression
/// </summary>
public FunctionAggrMax(List<ICacheData> dataCache, IExpr e, object scp)
: base(e, scp)
{
_key = "aggrmax" + Interlocked.Increment(ref Parser.Counter).ToString();
// Determine the result
_tc = e.GetTypeCode();
dataCache.Add(this);
}
示例9: ExprGetMethod
public ExprGetMethod(
IExpr klassExpr,
ValueSymbol selector,
SourceInfo info
)
{
KlassExpr = klassExpr;
Selector = selector;
mInfo = info;
}
示例10: ConstantOptimization
public IExpr ConstantOptimization()
{
_rhs = _rhs.ConstantOptimization();
if (_rhs.IsConstant())
{
decimal d = EvaluateDecimal(null, null);
return new ConstantDecimal(d);
}
return this;
}
示例11: FunctionAggrRvSum
private TypeCode _tc; // type of result: decimal or double
#endregion Fields
#region Constructors
/// <summary>
/// Aggregate function: RunningValue Sum returns the sum of all values of the
/// expression within the scope up to that row
/// Return type is decimal for decimal expressions and double for all
/// other expressions.
/// </summary>
public FunctionAggrRvSum(List<ICacheData> dataCache, IExpr e, object scp)
: base(e, scp)
{
_key = "aggrrvsum" + Interlocked.Increment(ref Parser.Counter).ToString();
// Determine the result
_tc = e.GetTypeCode();
if (_tc != TypeCode.Decimal) // if not decimal
_tc = TypeCode.Double; // force result to double
dataCache.Add(this);
}
示例12: ConstantOptimization
public IExpr ConstantOptimization()
{
_rhs = _rhs.ConstantOptimization();
if (_rhs.IsConstant())
{
bool b = EvaluateBoolean(null, null);
return new ConstantBoolean(b);
}
return this;
}
示例13: ConstantOptimization
public IExpr ConstantOptimization()
{
_rhs = _rhs.ConstantOptimization();
if (_rhs.IsConstant())
{
double d = EvaluateDouble(null, null);
return new ConstantInteger((int) d);
}
return this;
}
示例14: ExprSetMethod
public ExprSetMethod(
IExpr klassExpr,
ValueSymbol selector,
IExpr valueExpr,
SourceInfo info
)
{
mKlassExpr = klassExpr;
mSelector = selector;
mValueExpr = valueExpr;
mInfo = info;
}
示例15: ExprSend
public ExprSend(
IExpr recvExpr,
ValueSymbol selector,
IList<IExpr> argExprs,
SourceInfo info
)
{
RecvExpr = recvExpr;
Selector = selector;
ArgExprs = argExprs;
mInfo = info;
}