• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ExpressionList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ExpressionList的典型用法代码示例。如果您正苦于以下问题:C# ExpressionList类的具体用法?C# ExpressionList怎么用?C# ExpressionList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ExpressionList类属于命名空间,在下文中一共展示了ExpressionList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: VisitExpressionList

 public virtual ExpressionList VisitExpressionList(ExpressionList list)
 {
     if (list == null) return null;
     for (int i = 0, n = list.Count; i < n; i++)
         list[i] = (Expression)this.Visit(list[i]);
     return list;
 }
开发者ID:julianhaslinger,项目名称:SHFB,代码行数:7,代码来源:StandardVisitor.cs


示例2: VisitCall

        /// <summary>
        /// Visits the call.
        /// </summary>
        /// <param name="destination">The destination.</param>
        /// <param name="receiver">The receiver.</param>
        /// <param name="callee">The callee.</param>
        /// <param name="arguments">The arguments.</param>
        /// <param name="isVirtualCall">if set to <c>true</c> [is virtual call].</param>
        /// <param name="programContext">The program context.</param>
        /// <param name="stateBeforeInstruction">The state before instruction.</param>
        /// <param name="stateAfterInstruction">The state after instruction.</param>
        public override void VisitCall(
            Variable destination, 
            Variable receiver, 
            Method callee, 
            ExpressionList arguments, 
            bool isVirtualCall, 
            Microsoft.Fugue.IProgramContext programContext, 
            Microsoft.Fugue.IExecutionState stateBeforeInstruction, 
            Microsoft.Fugue.IExecutionState stateAfterInstruction)
        {
            if ((callee.DeclaringType.GetRuntimeType() == typeof(X509ServiceCertificateAuthentication) ||
                 callee.DeclaringType.GetRuntimeType() == typeof(X509ClientCertificateAuthentication)) &&
                 (callee.Name.Name.Equals("set_CertificateValidationMode", StringComparison.InvariantCultureIgnoreCase)))
            {
                IAbstractValue value = stateBeforeInstruction.Lookup((Variable)arguments[0]);
                IIntValue intValue = value.IntValue(stateBeforeInstruction);

                if (intValue != null)
                {
                    X509CertificateValidationMode mode = (X509CertificateValidationMode)intValue.Value;
                    if (mode != X509CertificateValidationMode.ChainTrust)
                    {
                        Resolution resolution = base.GetResolution(mode.ToString(), 
                            X509CertificateValidationMode.ChainTrust.ToString());
                        Problem problem = new Problem(resolution, programContext);
                        base.Problems.Add(problem);
                    }
                }
            }

            base.VisitCall(destination, receiver, callee, arguments, isVirtualCall, programContext, stateBeforeInstruction, stateAfterInstruction);
        }
开发者ID:Phidiax,项目名称:open-wssf-2015,代码行数:43,代码来源:CertificateValidationMode.cs


示例3: LiteralElement

 public LiteralElement()
   : base((NodeType)SpecSharpNodeType.None){
   this.AttributeNames = new IdentifierList();
   this.AttributeValues = new ExpressionList();
   this.Contents = new ExpressionList();
   this.ContentsType = new Int32List();
 }
开发者ID:hesam,项目名称:SketchSharp,代码行数:7,代码来源:Nodes.cs


示例4: InterProcMapping

 InterProcMapping(PTGraph caller, PTGraph callee, Variable thisRef, ExpressionList arguments)
 {
   this.calleePTG = callee;
   this.callerPTG = caller;
   this.callerThisRef = thisRef;
   this.arguments = arguments;
 }
开发者ID:hesam,项目名称:SketchSharp,代码行数:7,代码来源:PointsToAnalysis.cs


示例5: AddTest

 public void AddTest()
 {
     var list = new ExpressionList<ConstantTypes.Integer>();
     var one = new ConstantTypes.Integer(1);
     list.Add(one);
     Assert.IsTrue(list.Contains(one));
 }
开发者ID:jgshort,项目名称:SqlDom,代码行数:7,代码来源:ExpressionListTest.cs


示例6: Clone

 private static ExpressionList Clone(ExpressionList expression)
 {
     var parameters = new Expression[expression.Count];
     for (int i = 0; i < expression.Count; ++i)
         parameters[i] = Clone(expression[i]);
     return new ExpressionList(parameters);
 }
开发者ID:Powerino73,项目名称:paradox,代码行数:7,代码来源:ParadoxAssignmentCloner.cs


示例7: GroupByClause

 public GroupByClause(ExpressionList exprList)
 {
     foreach (Expression e in exprList) {
         e.Parent = this;
         _exprs.Add(e);
     }
     this.ExpressionType = ExpressionType.QL_SELECT_GROUP_BY;
 }
开发者ID:sekcheong,项目名称:parser,代码行数:8,代码来源:GroupByClause.cs


示例8: SearchedCase

 public SearchedCase(params KeyValuePair<Predicate, Expression>[] cases)
 {
     SearchCases = new ExpressionList<SearchedCaseExpression>();
     foreach (var kvp in cases)
     {
         SearchCases.Add(new SearchedCaseExpression(kvp.Key, kvp.Value));
     }
 }
开发者ID:jgshort,项目名称:SqlDom,代码行数:8,代码来源:SearchedCase.cs


示例9: WhereClause

 public WhereClause(ExpressionList exprList)
 {
     foreach (Expression e in exprList) {
         e.Parent = this;
         _exprs.Add(e);
     }
     this.ExpressionType = ExpressionType.QL_SELECT_WHERE_CLAUSE;
 }
开发者ID:sekcheong,项目名称:parser,代码行数:8,代码来源:WhereClause.cs


示例10: ClearTest

 public void ClearTest()
 {
     var list = new ExpressionList<ConstantTypes.Integer>();
     var one = new ConstantTypes.Integer(1);
     list.Add(one);
     Assert.IsTrue(list.Count == 1);
     list.Clear();
     Assert.IsTrue(list.Count == 0);
 }
开发者ID:jgshort,项目名称:SqlDom,代码行数:9,代码来源:ExpressionListTest.cs


示例11: VisitRefTypeExpression

 public override Expression VisitRefTypeExpression(RefTypeExpression reftypexp) {
   if (reftypexp == null) return null;
   Expression result = base.VisitRefTypeExpression (reftypexp);
   if (result != reftypexp) return result;
   UnaryExpression refanytype = new UnaryExpression(reftypexp.Operand, NodeType.Refanytype, SystemTypes.RuntimeTypeHandle, reftypexp.SourceContext);
   ExpressionList arguments = new ExpressionList(1);
   arguments.Add(refanytype);
   MemberBinding mb = new MemberBinding(null, Runtime.GetTypeFromHandle);
   return new MethodCall(mb, arguments, NodeType.Call, SystemTypes.Type);
 }
开发者ID:dbremner,项目名称:specsharp,代码行数:10,代码来源:Normalizer.cs


示例12: ParenthesizedExpression

 /// <summary>
 /// Initializes a new instance of the <see cref="ParenthesizedExpression"/> class.
 /// </summary>
 /// <param name="content">The content.</param>
 public ParenthesizedExpression(params Expression[] content)
 {
     if (content != null)
     {
         if (content.Length == 1)
             Content = content[0];
         else
             Content = new ExpressionList(content);
     }
 }
开发者ID:h78hy78yhoi8j,项目名称:xenko,代码行数:14,代码来源:ParenthesizedExpression.cs


示例13: VisitExpressionList

    public override ExpressionList VisitExpressionList(ExpressionList expressions)
    {
      if (expressions == null) return null;

      for(int i = expressions.Count-1; i >= 0; i--) 
      {
        Expression elem = this.VisitExpression(expressions[i]);
        System.Diagnostics.Debug.Assert(elem != null, "VisitExpression must return non null if passed non null");
        expressions[i] = elem;
      }
      return expressions;
    }
开发者ID:tapicer,项目名称:resource-contracts-.net,代码行数:12,代码来源:EmptyVisitor.cs


示例14: AbbreviationDuplicator

        public AbbreviationDuplicator(Method sourceMethod, Method targetMethod, ContractNodes contractNodes,
            Method abbreviation, Expression targetObject, ExpressionList actuals)
            : base(targetMethod.DeclaringType.DeclaringModule, sourceMethod, targetMethod, contractNodes, false)
        {
            this.targetObject = targetObject;
            this.abbreviation = abbreviation;
            this.actuals = actuals;

            this.localsInActuals = new TrivialHashtable();

            PopulateLocalsInActuals();
        }
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:12,代码来源:AbbreviationDuplicator.cs


示例15: CopyToTest

 public void CopyToTest()
 {
     ExpressionList<ConstantTypes.Integer> list = new ExpressionList<ConstantTypes.Integer>();
     var zero = new ConstantTypes.Integer(0);
     var one = new ConstantTypes.Integer(1);
     list.Add(zero);
     list.Add(one);
     ConstantTypes.Integer[] array = new ConstantTypes.Integer[2];
     list.CopyTo(array, 0);
     Assert.IsTrue(array.Length == 2);
     Assert.IsTrue(array[0] == zero);
     Assert.IsTrue(array[1] == one);
 }
开发者ID:jgshort,项目名称:SqlDom,代码行数:13,代码来源:ExpressionListTest.cs


示例16: Parse

		ExpressionList Parse (int start, int end)
		{
			if (string.IsNullOrWhiteSpace (source))
				return new ExpressionList ();

			var ret = new ExpressionList ();
			while (start < end) {
				int bak = start;
				ret.Add (ParseSingle (ref start, end));
				if (bak == start)
					throw new Exception ("Parser failed to progress token position: " + source);
			}
			return ret;
		}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:14,代码来源:ExpressionParserManual.cs


示例17: ShouldGetOneProblemWithClientCertificateValidationModePeerOrChainTrustRuleViolation

        public void ShouldGetOneProblemWithClientCertificateValidationModePeerOrChainTrustRuleViolation()
        {
            CertificateValidationMode rule = new CertificateValidationMode();
            Method callee = Method.GetMethod(typeof(X509ClientCertificateAuthentication).GetMethod("set_CertificateValidationMode"));
            ExpressionList arguments = new ExpressionList(new Variable(NodeType.VariableDeclaration));
            rule.VisitCall(
                null, null,
                callee,
                arguments,
                false, new MockProgramContext(),
                new MockStateBeforeInstruction((int)X509CertificateValidationMode.PeerOrChainTrust), null);

            Assert.IsNotNull(rule.Problems);
            Assert.AreEqual(1, rule.Problems.Count);
        }
开发者ID:Phidiax,项目名称:open-wssf-2015,代码行数:15,代码来源:CertificateValidationRevocationModeFixture.cs


示例18: Alternatives

 public Alternatives()
 {
     this.Expressions = new ExpressionList();
     //this.Image = ImageType.Alternative;
     this.Literal = "";
 }
开发者ID:dibley1973,项目名称:RegularExpressionToText,代码行数:6,代码来源:Alternatives.cs


示例19: AddInterfaceImplementationWrapper

        private static void AddInterfaceImplementationWrapper(Class Class, Method intfMethod, Method baseMethod)
        {
            var d = new Duplicator(Class.DeclaringModule, Class);
            
            d.SkipBodies = true;

            var copy = d.VisitMethod(baseMethod);
            
            copy.Flags = MethodFlags.Private | MethodFlags.HideBySig | MethodFlags.Virtual | MethodFlags.NewSlot |
                         MethodFlags.Final;
            
            copy.ImplementedInterfaceMethods = new MethodList(intfMethod);
            copy.Name = Identifier.For("InheritedInterfaceImplementationContractWrapper$" + intfMethod.Name.Name);
            copy.ClearBody();
            copy.ThisParameter.Type = Class;
            
            var bodyBlock = new Block(new StatementList());
            copy.Body = new Block(new StatementList(bodyBlock));

            // add call to baseMethod
            var calledMethod = (baseMethod.TemplateParameters != null && baseMethod.TemplateParameters.Count > 0)
                ? baseMethod.GetTemplateInstance(Class, copy.TemplateParameters)
                : baseMethod;

            var argList = new ExpressionList();
            for (int i = 0; i < copy.Parameters.Count; i++)
            {
                argList.Add(copy.Parameters[i]);
            }

            var callExpression = new MethodCall(new MemberBinding(copy.ThisParameter, calledMethod), argList);
            if (HelperMethods.IsVoidType(intfMethod.ReturnType))
            {
                bodyBlock.Statements.Add(new ExpressionStatement(callExpression));
            }
            else
            {
                bodyBlock.Statements.Add(new Return(callExpression));
            }
            
            Class.Members.Add(copy);
        }
开发者ID:Yatajga,项目名称:CodeContracts,代码行数:42,代码来源:PostExtractorChecker.cs


示例20: Evaluate

		string Evaluate (string source, ExpressionList exprList)
		{
			if (exprList == null)
				throw new ArgumentNullException ("exprList");
			return string.Concat (exprList.Select (e => e.EvaluateAsString (CreateContext (source))));
		}
开发者ID:GirlD,项目名称:mono,代码行数:6,代码来源:ExpressionEvaluator.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ExpressionObserver类代码示例发布时间:2022-05-24
下一篇:
C# ExpressionKind类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap