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


C# MemberReferenceExpression.Annotation方法代码示例

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


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

示例1: VisitMemberReferenceExpression

        public override StringBuilder VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression, int data)
        {
            var result = new StringBuilder();

            if (!(memberReferenceExpression.Target is ThisReferenceExpression))
                result.Append(memberReferenceExpression.Target.AcceptVisitor(this, data)).Append(".");

            var def = memberReferenceExpression.Annotation<IMemberDefinition>();
            if (def != null)
                return result.Append(Shader.ResolveName(def));

            var fref = memberReferenceExpression.Annotation<FieldReference>();
            if (fref != null)
                return result.Append(Shader.ResolveName(fref.Resolve()));

            throw new NotImplementedException();
        }
开发者ID:mono-soc-2011,项目名称:SLSharp,代码行数:17,代码来源:GlslVisitor.cs

示例2: VisitMemberReferenceExpression

		public virtual void VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression)
		{
			DebugExpression(memberReferenceExpression);
			StartNode(memberReferenceExpression);
			memberReferenceExpression.Target.AcceptVisitor(this);
			WriteToken(Roles.Dot, BoxedTextColor.Operator);
			WriteIdentifier(memberReferenceExpression.MemberNameToken, CSharpMetadataTextColorProvider.Instance.GetColor(memberReferenceExpression.MemberNameToken.Annotation<object>() ?? memberReferenceExpression.Annotation<object>()));
			WriteTypeArguments(memberReferenceExpression.TypeArguments, CodeBracesRangeFlags.AngleBrackets);
			EndNode(memberReferenceExpression);
		}
开发者ID:0xd4d,项目名称:NRefactory,代码行数:10,代码来源:CSharpOutputVisitor.cs

示例3: VisitMemberReferenceExpression

		public virtual void VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression)
		{
			DebugExpression(memberReferenceExpression);
			StartNode(memberReferenceExpression);
			memberReferenceExpression.Target.AcceptVisitor(this);
			WriteToken(Roles.Dot);
			WriteIdentifier(memberReferenceExpression.MemberNameToken, TextTokenHelper.GetTextTokenType(memberReferenceExpression.MemberNameToken.Annotation<object>() ?? memberReferenceExpression.Annotation<object>()));
			WriteTypeArguments(memberReferenceExpression.TypeArguments);
			EndNode(memberReferenceExpression);
		}
开发者ID:JackWangCUMT,项目名称:NRefactory,代码行数:10,代码来源:CSharpOutputVisitor.cs

示例4: GetTargetTypeRef

			TypeReference GetTargetTypeRef (MemberReferenceExpression memberReferenceExpression)
			{
				var pd = memberReferenceExpression.Annotation<PropertyDefinition> ();
				if (pd != null) {
					return pd.DeclaringType;
				}

				var fd = memberReferenceExpression.Annotation<FieldDefinition> ();
				if (fd == null)
					fd = memberReferenceExpression.Annotation<FieldReference> () as FieldDefinition;
				if (fd != null) {
					return fd.DeclaringType;
				}

				return GetTypeRef (memberReferenceExpression.Target);
			}
开发者ID:RReverser,项目名称:Netjs,代码行数:16,代码来源:CsToTs.cs

示例5: VisitMemberReferenceExpression

			public override void VisitMemberReferenceExpression (MemberReferenceExpression memberReferenceExpression)
			{
				base.VisitMemberReferenceExpression (memberReferenceExpression);

				var s = memberReferenceExpression.Target as BaseReferenceExpression;
				if (s != null) {

					if (memberReferenceExpression.Annotation<PropertyDefinition>() != null ||
						memberReferenceExpression.Annotation<PropertyReference>() != null) {

						memberReferenceExpression.Target = new ThisReferenceExpression ();
					}

				}
			}
开发者ID:RReverser,项目名称:Netjs,代码行数:15,代码来源:CsToTs.cs

示例6: VisitMemberReferenceExpression

        public override void VisitMemberReferenceExpression(MemberReferenceExpression e)
        {
            var md = e.Annotation<MethodDefinition>();
            if (md != null && md.IsPrivate && md.IsCompilerGenerated())
            {
                //public override void OnMasterMouseLeave(ModifierMouseArgs e)
                //{
                //    this.TB(ModifierGroup.YB, e);
                //}
                //
                //[CompilerGenerated]
                //private static void YB(IChartModifier x, ModifierEventArgsBase y)
                //{
                //    x.OnMasterMouseLeave((ModifierMouseArgs)y);
                //}
                //
                //====>
                //public override void OnMasterMouseLeave(ModifierMouseArgs e)
                //{
                //    this.TB((x, y) => x.OnMasterMouseLeave((ModifierMouseArgs)y), e);
                //}
                var td = e.Ancestors.OfType<TypeDeclaration>().FirstOrDefault();
                if (td != null)
                {
                    var method = td.Members.OfType<MethodDeclaration>().FirstOrDefault(x => x.Annotation<MethodDefinition>() == md);
                    if (method != null)
                    {
                        LambdaExpression le = new LambdaExpression();
                        var body = method.Body;
                        if (body.Statements.Count == 1)
                        {
                            le.Body = TryReduceLambdaBody(body.Statements.First()).Detach();
                        }
                        else
                        {
                            le.Body = body.Detach();
                        }

                        // 设置 Lambda 函数参数
                        if (method.Parameters.Count > 0)
                        {
                            var prmNames = new[] { "x", "y", "z", "u", "v", "w", "m", "n", "p", "q", "r", "s", "t" };
                            var usedNames = new HashSet<string>(body.Descendants.OfType<IdentifierExpression>().Select(x => x.Identifier).Distinct());
                            var index = 0;
                            foreach (var x in method.Parameters)
                            {
                                var pn = index < prmNames.Length ? prmNames[index] : "e" + index.ToString();
                                index++;
                                while (usedNames.Contains(pn))
                                {
                                    pn = index < prmNames.Length ? prmNames[index] : "e" + index.ToString();
                                    index++;
                                }
                                foreach (var r in le.Body.Descendants.OfType<IdentifierExpression>().Where(r => r.Identifier == x.Name))
                                {
                                    r.Identifier = pn;
                                }
                                le.Parameters.Add(new ParameterDeclaration(pn));
                            }
                        }

                        DelayRemove(method);
                        e.ReplaceWith(le);
                    }
                }
            }
            base.VisitMemberReferenceExpression(e);
        }
开发者ID:DKeeper1523,项目名称:ilspy_yh,代码行数:68,代码来源:YuehanTransform.cs


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