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


C# InvocationExpression.Annotation方法代码示例

本文整理汇总了C#中InvocationExpression.Annotation方法的典型用法代码示例。如果您正苦于以下问题:C# InvocationExpression.Annotation方法的具体用法?C# InvocationExpression.Annotation怎么用?C# InvocationExpression.Annotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在InvocationExpression的用法示例。


在下文中一共展示了InvocationExpression.Annotation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CouldBeExpressionTree

		public static bool CouldBeExpressionTree(InvocationExpression expr)
		{
			if (expr != null && expr.Arguments.Count == 2) {
				IMethod mr = expr.Annotation<IMethod>();
				return mr != null && mr.Name == "Lambda" && mr.DeclaringType.FullName == "System.Linq.Expressions.Expression";
			}
			return false;
		}
开发者ID:modulexcite,项目名称:ICSharpCode.Decompiler-retired,代码行数:8,代码来源:ExpressionTreeConverter.cs

示例2: VisitInvocationExpression

        public override StringBuilder VisitInvocationExpression(InvocationExpression invocationExpression, int data)
        {
            var result = new StringBuilder();

            var mref = invocationExpression.Annotation<MethodReference>();
            var m = mref != null ? mref.Resolve() : invocationExpression.Annotation<MethodDefinition>();

            if (m.DeclaringType.MetadataToken.ToInt32() == typeof(ShaderDefinition).MetadataToken)
                return VisitShaderDefCall(m, invocationExpression);

            RegisterMethod(m);
            result.Append(Shader.GetMethodName(m));
            result.Append("(").Append(ArgsToString(invocationExpression.Arguments)).Append(")");

            return result;
        }
开发者ID:mono-soc-2011,项目名称:SLSharp,代码行数:16,代码来源:GlslVisitor.cs

示例3: VisitInvocationExpression

			public override void VisitInvocationExpression (InvocationExpression invocationExpression)
			{
				base.VisitInvocationExpression (invocationExpression);

				var mr = invocationExpression.Target as MemberReferenceExpression;
				if (mr == null)
					return;

				if (mr.MemberName != "Equals")
					return;

				var m = invocationExpression.Annotation<MemberReference> ();
				if (m.DeclaringType.FullName != "System.Object")
					return;

				var i = new InvocationExpression (
					        new MemberReferenceExpression (new TypeReferenceExpression (new SimpleType ("NObject")), "GenericEquals"),
					mr.Target.Clone (), invocationExpression.Arguments.First ().Clone ());

				invocationExpression.ReplaceWith (i);
			}
开发者ID:RReverser,项目名称:Netjs,代码行数:21,代码来源:CsToTs.cs

示例4: VisitInvocationExpression

        public override void VisitInvocationExpression(InvocationExpression e)
        {
            var md = e.Annotation<MethodDefinition>();
            if (md != null && (md.IsGetter || md.IsSetter))
            {
                var p = md.DeclaringType.Properties.FirstOrDefault(x => x.GetMethod == md || x.SetMethod == md);
                if (p != null)
                {
                    // 转换为属性访问
                    var target = (e.Target as MemberReferenceExpression).Target;
                    if (p.IsIndexer())
                    {
                        IndexerExpression ie = new IndexerExpression(target.Detach()).WithAnnotation(p);
                        e.Arguments.MoveTo(ie.Arguments);
                        e.ReplaceWith(ie);
                    }
                    else
                    {
                        //MemberReferenceExpression mre = new MemberReferenceExpression(target.Detach(), p.Name).WithAnnotation(p);

                    }
                }
            }

            //[CompilerGenerated]
            //private sealed class C_e_5
            //{
            //    public Action f_1_E2DC5B04;
            //    public void M_1_void(object x)
            //    {
            //        this.f_1_E2DC5B04();
            //    }
            //}
            //
            //public ActionCommand(Action execute)
            //{
            //    Action<object> action = null;
            //    ActionCommand.C_e_5 c_e_ = new ActionCommand.C_e_5();
            //    c_e_.f_1_E2DC5B04 = execute;
            //    if (action == null)
            //    {
            //        action = new Action<object>(c_e_.M_1_void);
            //    }
            //    base..ctor(action);
            //}
            //
            //====>
            //public ActionCommand(Action execute) : base(x=>execute())
            //{
            //}



            base.VisitInvocationExpression(e);
        }
开发者ID:DKeeper1523,项目名称:ilspy_yh,代码行数:55,代码来源:YuehanTransform.cs


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