本文整理汇总了C#中IExpr.IsConstant方法的典型用法代码示例。如果您正苦于以下问题:C# IExpr.IsConstant方法的具体用法?C# IExpr.IsConstant怎么用?C# IExpr.IsConstant使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IExpr
的用法示例。
在下文中一共展示了IExpr.IsConstant方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: ConstantOptimization
public IExpr ConstantOptimization()
{
_rhs = _rhs.ConstantOptimization();
if (_rhs.IsConstant())
{
double d = EvaluateDouble(null, null);
return new ConstantInteger((int) d);
}
return this;
}
示例3: ConstantOptimization
public IExpr ConstantOptimization()
{
_rhs = _rhs.ConstantOptimization();
if (_rhs.IsConstant())
{
bool b = EvaluateBoolean(null, null);
return new ConstantBoolean(b);
}
return this;
}
示例4: ConstantOptimization
public IExpr ConstantOptimization()
{
_rhs = _rhs.ConstantOptimization();
if (_rhs.IsConstant())
{
decimal d = EvaluateDecimal(null, null);
return new ConstantDecimal(d);
}
return this;
}
示例5: ConstantOptimization
public IExpr ConstantOptimization()
{
_Formatee = _Formatee.ConstantOptimization();
_Format = _Format.ConstantOptimization();
if (_Formatee.IsConstant() && _Format.IsConstant())
{
string s = EvaluateString(null, null);
return new ConstantString(s);
}
return this;
}
示例6: ConstantOptimization
public IExpr ConstantOptimization()
{
_If = _If.ConstantOptimization();
_IfTrue = _IfTrue.ConstantOptimization();
_IfFalse = _IfFalse.ConstantOptimization();
if (_If.IsConstant())
{
bool result = _If.EvaluateBoolean(null, null);
return result? _IfTrue: _IfFalse;
}
return this;
}
示例7: ConstantOptimization
public virtual IExpr ConstantOptimization()
{
_ArgExpr = _ArgExpr.ConstantOptimization();
if (_ArgExpr.IsConstant())
{
string o = _ArgExpr.EvaluateString(null, null);
if (o == null)
throw new Exception("Parameter collection argument is null");
ReportParameter rp = _Parameters[o] as ReportParameter;
if (rp == null)
throw new Exception(string.Format("Parameter collection argument {0} is invalid", o));
return new FunctionReportParameter(rp);
}
return this;
}
示例8: ConstantOptimization
public virtual IExpr ConstantOptimization()
{
_ArgExpr = _ArgExpr.ConstantOptimization();
if (_ArgExpr.IsConstant())
{
string o = _ArgExpr.EvaluateString(null, null);
if (o == null)
throw new Exception(Strings.FunctionParameterCollection_Error_ParameterCollectionNull);
ReportParameter rp = _Parameters[o] as ReportParameter;
if (rp == null)
throw new Exception(string.Format(Strings.FunctionParameterCollection_Error_ParameterCollectionInvalid, o));
return new FunctionReportParameter(rp);
}
return this;
}
示例9: ConstantOptimization
public virtual IExpr ConstantOptimization()
{
_ArgExpr = _ArgExpr.ConstantOptimization();
if (_ArgExpr.IsConstant())
{
string o = _ArgExpr.EvaluateString(null, null);
if (o == null)
throw new Exception("Field collection argument is null");
Field f = _Fields[o] as Field;
if (f == null)
throw new Exception(string.Format("Field collection argument {0} is invalid", o));
return new FunctionField(f);
}
return this;
}
示例10: ConstantOptimization
public virtual IExpr ConstantOptimization()
{
_ArgExpr = _ArgExpr.ConstantOptimization();
if (_ArgExpr.IsConstant())
{
string o = _ArgExpr.EvaluateString(null, null);
if (o == null)
throw new Exception("ReportItem collection argument is null");
Textbox ri = _ReportItems[o] as Textbox;
if (ri == null)
throw new Exception(string.Format("ReportItem collection argument {0} is invalid", o));
return new FunctionTextbox(ri, null); // no access to unique name
}
return this;
}
示例11: ConstantOptimization
public virtual IExpr ConstantOptimization()
{
_ArgExpr = _ArgExpr.ConstantOptimization();
if (_ArgExpr.IsConstant())
{
string o = _ArgExpr.EvaluateString(null, null);
if (o == null)
throw new Exception(Strings.FunctionFieldCollection_Error_FieldCollectionNull);
Field f = _Fields[o] as Field;
if (f == null)
throw new Exception(string.Format(Strings.FunctionFieldCollection_Error_FieldCollectionInvalid, o));
return new FunctionField(f);
}
return this;
}
示例12: ConstantOptimization
public virtual IExpr ConstantOptimization()
{
_ArgExpr = _ArgExpr.ConstantOptimization();
if (_ArgExpr.IsConstant())
{
string o = _ArgExpr.EvaluateString(null, null);
if (o == null)
throw new Exception(Strings.FunctionReportItemCollection_Error_ReportItemCollectionNull);
Textbox ri = _ReportItems[o] as Textbox;
if (ri == null)
throw new Exception(string.Format(Strings.FunctionReportItemCollection_Error_ReportItemCollectionInvalid, o));
return new FunctionTextbox(ri, null); // no access to unique name
}
return this;
}
示例13: ConstantOptimization
public virtual IExpr ConstantOptimization()
{
_ArgExpr = _ArgExpr.ConstantOptimization();
if (_ArgExpr.IsConstant())
{
string o = _ArgExpr.EvaluateString(null, null);
if (o == null)
throw new Exception(Strings.FunctionUserCollection_Error_UserCollectionNull);
string lo = o.ToLower();
if (lo == "userid")
return new FunctionUserID();
if (lo == "language")
return new FunctionUserLanguage();
throw new Exception(string.Format(Strings.FunctionUserCollection_Error_UserCollectionInvalid, o));
}
return this;
}
示例14: ConstantOptimization
public virtual IExpr ConstantOptimization()
{
_ArgExpr = _ArgExpr.ConstantOptimization();
if (_ArgExpr.IsConstant())
{
string o = _ArgExpr.EvaluateString(null, null);
if (o == null)
throw new Exception("User collection argument is null");
string lo = o.ToLower();
if (lo == "userid")
return new FunctionUserID();
if (lo == "language")
return new FunctionUserLanguage();
throw new Exception(string.Format("User collection argument {0} is invalid.", o));
}
return this;
}
示例15: Subtitute
public static IExpr Subtitute(IExpr expr, string variable, IExpr subt)
{
if (expr.IsSymbol())
{
if (expr.SymbolValue() == variable)
return subt;
else
return expr;
}
else if (expr.IsConstant())
{
return expr;
}
else
{
var func = expr as Function;
if (!func.IsBinary)
{
return new Function(func.Name, Subtitute(func.FirstArgument, variable, subt));
}
else
{
return new Function(func.Name, Subtitute(func.FirstArgument, variable, subt), Subtitute(func.SecondArgument, variable, subt));
}
}
}