当前位置: 首页>>代码示例>>C#>>正文


C# IExpr.IsConstant方法代码示例

本文整理汇总了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;
        }
开发者ID:NelsonSantos,项目名称:fyiReporting-Android,代码行数:28,代码来源:FunctionGlobalCollection.cs

示例2: ConstantOptimization

        public IExpr ConstantOptimization()
        {
            _rhs = _rhs.ConstantOptimization();
            if (_rhs.IsConstant())
            {
                double d = EvaluateDouble(null, null);
                return new ConstantInteger((int) d);
            }

            return this;
        }
开发者ID:bittercoder,项目名称:reportingcloud,代码行数:11,代码来源:FunctionUnaryMinusInteger.cs

示例3: ConstantOptimization

        public IExpr ConstantOptimization()
        {
            _rhs = _rhs.ConstantOptimization();
            if (_rhs.IsConstant())
            {
                bool b = EvaluateBoolean(null, null);
                return new ConstantBoolean(b);
            }

            return this;
        }
开发者ID:bittercoder,项目名称:odd-reports,代码行数:11,代码来源:FunctionNot.cs

示例4: ConstantOptimization

        public IExpr ConstantOptimization()
        {
            _rhs = _rhs.ConstantOptimization();
            if (_rhs.IsConstant())
            {
                decimal d = EvaluateDecimal(null, null);
                return new ConstantDecimal(d);
            }

            return this;
        }
开发者ID:bittercoder,项目名称:odd-reports,代码行数:11,代码来源:FunctionUnaryMinusDecimal.cs

示例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;
		}
开发者ID:mnisl,项目名称:OD,代码行数:12,代码来源:FunctionFormat.cs

示例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;
		}
开发者ID:romeroyonatan,项目名称:opendental,代码行数:14,代码来源:FunctionIif.cs

示例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;
		}
开发者ID:mnisl,项目名称:OD,代码行数:17,代码来源:FunctionParameterCollection.cs

示例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;
		}
开发者ID:Elboodo,项目名称:My-FyiReporting,代码行数:17,代码来源:FunctionParameterCollection.cs

示例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;
		}
开发者ID:romeroyonatan,项目名称:opendental,代码行数:17,代码来源:FunctionFieldCollection.cs

示例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;
        }
开发者ID:bittercoder,项目名称:reportingcloud,代码行数:17,代码来源:FunctionReportItemCollection.cs

示例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;
		}
开发者ID:Elboodo,项目名称:My-FyiReporting,代码行数:17,代码来源:FunctionFieldCollection.cs

示例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;
		}
开发者ID:Elboodo,项目名称:My-FyiReporting,代码行数:17,代码来源:FunctionReportItemCollection.cs

示例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;
		}
开发者ID:Elboodo,项目名称:My-FyiReporting,代码行数:19,代码来源:FunctionUserCollection.cs

示例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;
        }
开发者ID:NelsonSantos,项目名称:fyiReporting-Android,代码行数:19,代码来源:FunctionUserCollection.cs

示例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));
         }
     }
 }
开发者ID:Zaid-Ajaj,项目名称:Demos,代码行数:26,代码来源:Expression.cs


注:本文中的IExpr.IsConstant方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。