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

C# NamedExpression类代码示例

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

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



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

示例1: AddConvertCollectionOrObjectInitializers

			void AddConvertCollectionOrObjectInitializers (Expression init, CollectionOrObjectInitializers minit)
			{
				var initLoc = LocationsBag.GetLocations (minit);
				var commaLoc = LocationsBag.GetLocations (minit.Initializers);
				int curComma = 0;
				if (initLoc != null)
					init.AddChild (new CSharpTokenNode (Convert (initLoc [0]), 1), ArrayInitializerExpression.Roles.LBrace);
				foreach (var expr in minit.Initializers) {
					var collectionInit = expr as CollectionElementInitializer;
					if (collectionInit != null) {
						var parent = new ArrayInitializerExpression ();
						
						var braceLocs = LocationsBag.GetLocations (expr);
						if (braceLocs != null)
							parent.AddChild (new CSharpTokenNode (Convert (braceLocs [0]), 1), ArrayInitializerExpression.Roles.LBrace);
						
						for (int i = 0; i < collectionInit.Arguments.Count; i++) {
							var arg = collectionInit.Arguments [i] as CollectionElementInitializer.ElementInitializerArgument;
							if (arg == null)
								continue;
							parent.AddChild ((ICSharpCode.NRefactory.CSharp.Expression)arg.Expr.Accept (this), ArrayInitializerExpression.Roles.Expression);
						}
						
						if (braceLocs != null)
							parent.AddChild (new CSharpTokenNode (Convert (braceLocs [1]), 1), ArrayInitializerExpression.Roles.RBrace);
							
						init.AddChild (parent, ArrayInitializerExpression.Roles.Expression);
					} else {
						var eleInit = expr as ElementInitializer;
						if (eleInit != null) {
							var nexpr = new NamedExpression ();
							nexpr.AddChild (Identifier.Create (eleInit.Name, Convert (eleInit.Location)), NamedArgumentExpression.Roles.Identifier);
							var assignLoc = LocationsBag.GetLocations (eleInit);
							if (assignLoc != null)
								nexpr.AddChild (new CSharpTokenNode (Convert (assignLoc [0]), 1), NamedArgumentExpression.Roles.Assign);
							if (eleInit.Source != null) {
								if (eleInit.Source is CollectionOrObjectInitializers) {
									var arrInit = new ArrayInitializerExpression ();
									AddConvertCollectionOrObjectInitializers (arrInit, eleInit.Source as CollectionOrObjectInitializers);
									nexpr.AddChild (arrInit, NamedArgumentExpression.Roles.Expression);
								} else {
									nexpr.AddChild ((Expression)eleInit.Source.Accept (this), NamedArgumentExpression.Roles.Expression);
								}
							}
							
							init.AddChild (nexpr, ArrayInitializerExpression.Roles.Expression);
						}
					}
					if (commaLoc != null && curComma < commaLoc.Count)
						init.AddChild (new CSharpTokenNode (Convert (commaLoc [curComma++]), 1), ArrayInitializerExpression.Roles.Comma);
					
				}
				if (initLoc != null) {
					if (initLoc.Count == 3) // optional comma
						init.AddChild (new CSharpTokenNode (Convert (initLoc [1]), 1), ArrayInitializerExpression.Roles.Comma);
					init.AddChild (new CSharpTokenNode (Convert (initLoc [initLoc.Count - 1]), 1), ArrayInitializerExpression.Roles.RBrace);
				}
			}
开发者ID:N3X15,项目名称:ILSpy,代码行数:58,代码来源:CSharpParser.cs


示例2: Visit

			public override object Visit(NewAnonymousType newAnonymousType)
			{
				var result = new AnonymousTypeCreateExpression();
				var location = LocationsBag.GetLocations(newAnonymousType);
				result.AddChild(new CSharpTokenNode(Convert(newAnonymousType.Location), ObjectCreateExpression.NewKeywordRole), ObjectCreateExpression.NewKeywordRole);
				if (location != null)
					result.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LBrace), Roles.LBrace);
				if (newAnonymousType.Parameters != null) {
					foreach (var par in newAnonymousType.Parameters) {
						if (par == null)
							continue;
						var parLocation = LocationsBag.GetLocations(par);
						
						if (parLocation == null) {
							if (par.Expr != null)
								result.AddChild((Expression)par.Expr.Accept(this), Roles.Expression);
						} else {
							var namedExpression = new NamedExpression();
							namedExpression.AddChild(Identifier.Create(par.Name, Convert(par.Location)), Roles.Identifier);
							namedExpression.AddChild(new CSharpTokenNode(Convert(parLocation [0]), Roles.Assign), Roles.Assign);
							if (par.Expr != null)
								namedExpression.AddChild((Expression)par.Expr.Accept(this), Roles.Expression);
							result.AddChild(namedExpression, Roles.Expression);
						}
					}
				}
				if (location != null && location.Count > 1)
					result.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RBrace), Roles.RBrace);
				return result;
			}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:30,代码来源:CSharpParser.cs


示例3: NameBlock

 public NameBlock(IEmitter emitter, NamedExpression namedExpression)
     : this(emitter, namedExpression.Name, namedExpression, namedExpression.Expression)
 {
 }
开发者ID:Cestbienmoi,项目名称:Bridge,代码行数:4,代码来源:NameBlock.cs


示例4: Visit

			public override object Visit (NewAnonymousType newAnonymousType)
			{
				var result = new AnonymousTypeCreateExpression ();
				if (newAnonymousType.Parameters == null)
					return result;
				foreach (var par in newAnonymousType.Parameters) {
					var location = LocationsBag.GetLocations (par);

					if (location == null) {
						if (par.Expr != null)
							result.AddChild ((Expression)par.Expr.Accept (this), AnonymousTypeCreateExpression.Roles.Expression);
					} else {
						var namedExpression = new NamedExpression ();
						namedExpression.AddChild (Identifier.Create (par.Name, Convert (par.Location)), AnonymousTypeCreateExpression.Roles.Identifier);
						namedExpression.AddChild (new CSharpTokenNode (Convert (location[0]), 1), AnonymousTypeCreateExpression.Roles.Assign);
						if (par.Expr != null)
							namedExpression.AddChild ((Expression)par.Expr.Accept (this), AnonymousTypeCreateExpression.Roles.Expression);
						result.AddChild (namedExpression, AnonymousTypeCreateExpression.Roles.Expression);
					}
				}
				return result;
			}
开发者ID:N3X15,项目名称:ILSpy,代码行数:22,代码来源:CSharpParser.cs


示例5: VisitNamedExpression

 public void VisitNamedExpression(NamedExpression node)
 {
     NotSupported(node);
 }
开发者ID:evanw,项目名称:minisharp,代码行数:4,代码来源:Lower.cs


示例6: InsertImplicitInitializersForPath

		bool InsertImplicitInitializersForPath(AccessPath path)
		{
			if (accessPaths.ContainsKey(path))
				return true;

			if (path.MemberPath.Count == 0)
				return false;
			var parentPath = path.GetParentPath();
			var success = InsertImplicitInitializersForPath(parentPath);
			if (!success)
				return false;

			var parentInitializer = accessPaths [parentPath];
			var initializer = new ArrayInitializerExpression();
			var namedExpression = new NamedExpression(path.MemberPath [path.MemberPath.Count - 1].Name, initializer);
			AddToInitializer(parentInitializer, namedExpression);
			accessPaths [path] = initializer;
			return true;
		}
开发者ID:FloodProject,项目名称:ICSharpCode.NRefactory,代码行数:19,代码来源:StatementsToInitializerConverter.cs


示例7: VisitNamedExpression

 public override void VisitNamedExpression(NamedExpression namedExpression)
 {
     ForceSpacesAround(namedExpression.AssignToken, policy.SpaceAroundAssignment);
     base.VisitNamedExpression(namedExpression);
 }
开发者ID:porcus,项目名称:NRefactory,代码行数:5,代码来源:FormattingVisitor_Expressions.cs


示例8: VisitNamedExpression

		public virtual void VisitNamedExpression (NamedExpression namedExpression)
		{
			VisitChildren (namedExpression);
		}
开发者ID:modulexcite,项目名称:ICSharpCode.Decompiler-retired,代码行数:4,代码来源:DepthFirstAstVisitor.cs


示例9: VisitNamedExpression

 public override void VisitNamedExpression(NamedExpression namedExpression)
 {
     new NameBlock(this, namedExpression).Emit();
 }
开发者ID:yindongfei,项目名称:bridge.lua,代码行数:4,代码来源:Emitter.Visitor.cs


示例10: TransformByteCode


//.........这里部分代码省略.........
				case ILCode.Refanytype:
					return new UndocumentedExpression {
						UndocumentedExpressionType = UndocumentedExpressionType.RefType,
						Arguments = { arg1 }
					}.Member("TypeHandle").WithAnnotation(GetTypeHandleRef());
				case ILCode.Refanyval:
					return MakeRef(
						new UndocumentedExpression {
							UndocumentedExpressionType = UndocumentedExpressionType.RefValue,
							Arguments = { arg1, new TypeReferenceExpression(operandAsTypeRef) }
						});
					case ILCode.Newobj: {
						ITypeDefOrRef declaringType = ((IMethod)operand).DeclaringType;
						if (declaringType.TryGetArraySig() != null) {
							ComposedType ct = AstBuilder.ConvertType(declaringType) as ComposedType;
							if (ct != null && ct.ArraySpecifiers.Count >= 1) {
								var ace = new ArrayCreateExpression();
								ct.ArraySpecifiers.First().Remove();
								ct.ArraySpecifiers.MoveTo(ace.AdditionalArraySpecifiers);
								ace.Type = ct;
								ace.Arguments.AddRange(args);
								return ace;
							}
						}
						if (declaringType.IsAnonymousType()) {
							MethodDef ctor = ((IMethod)operand).ResolveMethodDef();
							if (ctor != null) {
								AnonymousTypeCreateExpression atce = new AnonymousTypeCreateExpression();
								if (CanInferAnonymousTypePropertyNamesFromArguments(args, ctor.Parameters)) {
									atce.Initializers.AddRange(args);
								} else {
									for (int i = 0; i < args.Count; i++) {
										atce.Initializers.Add(
											new NamedExpression {
												Name = ctor.Parameters[i].Name,
												Expression = args[i]
											});
									}
								}
								return atce;
							}
						}
						var oce = new ObjectCreateExpression();
						oce.Type = AstBuilder.ConvertType(declaringType);
						oce.Arguments.AddRange(args);
						return oce.WithAnnotation(operand);
					}
					case ILCode.Nop: return null;
					case ILCode.Pop: return arg1;
					case ILCode.Readonly: return InlineAssembly(byteCode, args);
				case ILCode.Ret:
					if (methodDef.ReturnType.FullName != "System.Void") {
						return new ReturnStatement { Expression = arg1 };
					} else {
						return new ReturnStatement();
					}
					case ILCode.Rethrow: return new ThrowStatement();
					case ILCode.Sizeof:  return new SizeOfExpression { Type = operandAsTypeRef };
					case ILCode.Stloc: {
						ILVariable locVar = (ILVariable)operand;
						if (!locVar.IsParameter)
							localVariablesToDefine.Add(locVar);
						return new AssignmentExpression(new IdentifierExpression(locVar.Name).WithAnnotation(locVar), arg1);
					}
					case ILCode.Switch: return InlineAssembly(byteCode, args);
					case ILCode.Tail: return InlineAssembly(byteCode, args);
开发者ID:modulexcite,项目名称:ICSharpCode.Decompiler-retired,代码行数:67,代码来源:AstMethodBodyBuilder.cs


示例11: VisitNamedExpression

		public override void VisitNamedExpression (NamedExpression namedExpression)
		{
			if (InsertParenthesesForReadability) {
				ParenthesizeIfRequired(namedExpression.Expression, RelationalAndTypeTesting + 1);
			}
			base.VisitNamedExpression (namedExpression);
		}
开发者ID:icsharpcode,项目名称:NRefactory,代码行数:7,代码来源:InsertParenthesesVisitor.cs


示例12: VisitNamedExpression

		public virtual void VisitNamedExpression(NamedExpression namedExpression)
		{
			DebugExpression(namedExpression);
			StartNode(namedExpression);
			WriteIdentifier(namedExpression.NameToken);
			Space();
			WriteToken(Roles.Assign, BoxedTextColor.Operator);
			Space();
			namedExpression.Expression.AcceptVisitor(this);
			EndNode(namedExpression);
		}
开发者ID:0xd4d,项目名称:NRefactory,代码行数:11,代码来源:CSharpOutputVisitor.cs


示例13: VisitNamedExpression

        public void VisitNamedExpression(NamedExpression namedExpression)
        {
            JsonObject expression = CreateJsonExpression(namedExpression);
            expression.AddJsonValue("identifier", GetIdentifier(namedExpression.NameToken));
            expression.AddJsonValue("expression", GenExpression(namedExpression.Expression));

            Push(expression);

        }
开发者ID:CompilerKit,项目名称:CodeWalk,代码行数:9,代码来源:AstCsToJson.cs


示例14: AddConvertCollectionOrObjectInitializers

			void AddConvertCollectionOrObjectInitializers(Expression init, CollectionOrObjectInitializers minit)
			{
				var initLoc = LocationsBag.GetLocations(minit);
				var commaLoc = LocationsBag.GetLocations(minit.Initializers);
				int curComma = 0;
				init.AddChild(new CSharpTokenNode(Convert(minit.Location), Roles.LBrace), Roles.LBrace);
				foreach (var expr in minit.Initializers) {
					var collectionInit = expr as CollectionElementInitializer;
					if (collectionInit != null) {
						AstNode parent;
						// For ease of use purposes in the resolver the ast representation
						// of { a, b, c }  is { {a}, {b}, {c} } - but the generated ArrayInitializerExpression
						// can be identified by expr.IsSingleElement.
						if (!collectionInit.IsSingle) {
							parent = new ArrayInitializerExpression();
							parent.AddChild(new CSharpTokenNode(Convert(collectionInit.Location), Roles.LBrace), Roles.LBrace);
						} else {
							parent = ArrayInitializerExpression.CreateSingleElementInitializer();
						}

						if (collectionInit.Arguments != null) {
							for (int i = 0; i < collectionInit.Arguments.Count; i++) {
								var arg = collectionInit.Arguments [i] as CollectionElementInitializer.ElementInitializerArgument;
								if (arg == null || arg.Expr == null)
									continue;
								parent.AddChild(
									(Expression)arg.Expr.Accept(this),
									Roles.Expression
								);
							}
						}

						if (!collectionInit.IsSingle) {
							var braceLocs = LocationsBag.GetLocations(expr);
							if (braceLocs != null)
								parent.AddChild(new CSharpTokenNode(Convert(braceLocs [0]), Roles.RBrace), Roles.RBrace);
						}
						init.AddChild((ArrayInitializerExpression)parent, Roles.Expression);
					} else {
						var eleInit = expr as ElementInitializer;
						if (eleInit != null) {
							var nexpr = new NamedExpression();
							nexpr.AddChild(
								Identifier.Create(eleInit.Name, Convert(eleInit.Location)),
								Roles.Identifier
							);
							var assignLoc = LocationsBag.GetLocations(eleInit);
							if (assignLoc != null)
								nexpr.AddChild(new CSharpTokenNode(Convert(assignLoc [0]), Roles.Assign), Roles.Assign);
							if (eleInit.Source != null) {
								var colInit = eleInit.Source as CollectionOrObjectInitializers;
								if (colInit != null) {
									var arrInit = new ArrayInitializerExpression();
									AddConvertCollectionOrObjectInitializers(
										arrInit,
										colInit
									);
									nexpr.AddChild(arrInit, Roles.Expression);
								} else {
									nexpr.AddChild((Expression)eleInit.Source.Accept(this), Roles.Expression);
								}
							}

							init.AddChild(nexpr, Roles.Expression);
						}
					}
					if (commaLoc != null && curComma < commaLoc.Count)
						init.AddChild(new CSharpTokenNode(Convert(commaLoc [curComma++]), Roles.Comma), Roles.Comma);
				}

				if (initLoc != null) {
					if (initLoc.Count == 2) // optional comma
						init.AddChild(new CSharpTokenNode(Convert(initLoc [0]), Roles.Comma), Roles.Comma);
					init.AddChild(new CSharpTokenNode(Convert(initLoc [initLoc.Count - 1]), Roles.RBrace), Roles.RBrace);
				}
			}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:76,代码来源:CSharpParser.cs


示例15: GetAttributes

			IEnumerable<Attribute> GetAttributes (List<Mono.CSharp.Attribute> optAttributes)
			{
				if (optAttributes == null)
					yield break;
				foreach (var attr in optAttributes) {
					Attribute result = new Attribute ();
					result.Type = ConvertToType (attr.TypeNameExpression);
					var loc = LocationsBag.GetLocations (attr);
					result.HasArgumentList = loc != null;
					if (loc != null)
						result.AddChild (new CSharpTokenNode (Convert (loc [0]), 1), AttributeSection.Roles.LPar);
						
					if (attr.PosArguments != null) {
						foreach (var arg in attr.PosArguments) {
							result.AddChild ((Expression)arg.Expr.Accept (this), Attribute.Roles.Argument);
						}
					}
					if (attr.NamedArguments != null) { 
						foreach (NamedArgument na in attr.NamedArguments) {
							var newArg = new NamedExpression ();
							newArg.AddChild (Identifier.Create (na.Name, Convert (na.Location)), NamedExpression.Roles.Identifier);
							
							var argLoc = LocationsBag.GetLocations (na);
							if (argLoc != null)
								newArg.AddChild (new CSharpTokenNode (Convert (argLoc[0]), 1), NamedExpression.Roles.Assign);
							newArg.AddChild ((Expression)na.Expr.Accept (this), NamedExpression.Roles.Expression);
							result.AddChild (newArg, Attribute.Roles.Argument);
						}
					}
					if (loc != null)
						result.AddChild (new CSharpTokenNode (Convert (loc [1]), 1), AttributeSection.Roles.RPar);
					
					yield return result;
				}
			}
开发者ID:aleksandersumowski,项目名称:monodevelop,代码行数:35,代码来源:CSharpParser.cs


示例16: GetAttributes

			IEnumerable<Attribute> GetAttributes(IEnumerable<Mono.CSharp.Attribute> optAttributes)
			{
				if (optAttributes == null)
					yield break;
				foreach (var attr in optAttributes) {
					var result = new Attribute();
					result.Type = ConvertToType(attr.TypeNameExpression);
					var loc = LocationsBag.GetLocations(attr);
					result.HasArgumentList = loc != null;
					int pos = 0;
					if (loc != null)
						result.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.LPar), Roles.LPar);
					
					if (attr.PositionalArguments != null) {
						foreach (var arg in attr.PositionalArguments) {
							if (arg == null)
								continue;
							var na = arg as NamedArgument;
							if (na != null) {
								var newArg = new NamedArgumentExpression();
								newArg.AddChild(Identifier.Create(na.Name, Convert(na.Location)), Roles.Identifier);
								
								var argLoc = LocationsBag.GetLocations(na);
								if (argLoc != null)
									newArg.AddChild(new CSharpTokenNode(Convert(argLoc [0]), Roles.Colon), Roles.Colon);
								if (na.Expr != null)
									newArg.AddChild((Expression)na.Expr.Accept(this), Roles.Expression);
								result.AddChild(newArg, Roles.Argument);
							} else {
								if (arg.Expr != null)
									result.AddChild((Expression)arg.Expr.Accept(this), Roles.Argument);
							}
							if (loc != null && pos + 1 < loc.Count)
								result.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.Comma), Roles.Comma);
						}
					}
					if (attr.NamedArguments != null) {
						foreach (var arg in attr.NamedArguments) {
							var na = (NamedArgument)arg;
							var newArg = new NamedExpression();
							newArg.AddChild(Identifier.Create(na.Name, Convert(na.Location)), Roles.Identifier);
							
							var argLoc = LocationsBag.GetLocations(na);
							if (argLoc != null)
								newArg.AddChild(new CSharpTokenNode(Convert(argLoc [0]), Roles.Assign), Roles.Assign);
							if (na.Expr != null)
								newArg.AddChild((Expression)na.Expr.Accept(this), Roles.Expression);
							result.AddChild(newArg, Roles.Argument);
							if (loc != null && pos + 1 < loc.Count)
								result.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.Comma), Roles.Comma);
						}
					}
					if (loc != null && pos < loc.Count)
						result.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.RPar), Roles.RPar);
					
					yield return result;
				}
			}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:58,代码来源:CSharpParser.cs


示例17: VisitNamedExpression

 public virtual void VisitNamedExpression(NamedExpression namedExpression)
 {
     if (this.ThrowException)
     {
         throw (Exception)this.CreateException(namedExpression);
     }
 }
开发者ID:fabriciomurta,项目名称:BridgeUnified,代码行数:7,代码来源:Visitor.Exception.cs


示例18: VisitNamedExpression

		public void VisitNamedExpression(NamedExpression namedExpression)
		{
			StartNode(namedExpression);
			namedExpression.NameToken.AcceptVisitor(this);
			Space();
			WriteToken(Roles.Assign);
			Space();
			namedExpression.Expression.AcceptVisitor(this);
			EndNode(namedExpression);
		}
开发者ID:x-strong,项目名称:ILSpy,代码行数:10,代码来源:CSharpOutputVisitor.cs


示例19: VisitVariableDeclarationStatement

        public override void VisitVariableDeclarationStatement(VariableDeclarationStatement e)
        {
            if (e.Variables.Count == 1 && !(e.Parent is UsingStatement) && e.Variables.First().Initializer is ObjectCreateExpression)
            {
                //AssemblyName assemblyName = new AssemblyName();
                //assemblyName.Name = e;
                //assemblyName.Version = new Version(e1);
                //assemblyName.CultureInfo = new CultureInfo("");
                //====>
                //AssemblyName assemblyName = new AssemblyName()
                //{
                //    Name = e,
                //    Version = new Version(e1),
                //    CultureInfo = new CultureInfo("")
                //};
                var @var = e.Variables.First();
                var creation = @var.Initializer as ObjectCreateExpression;
                var setters = new ArrayInitializerExpression(creation.Initializer.Elements.Select(x => x.Detach()));
                var assignments = e.Parent.Children
                                   .SkipWhile(x => x != e)
                                   .Skip(1)
                                   .ToArray();
                List<NamedExpression> processedList = new List<NamedExpression>();
                foreach (var x in assignments)
                {
                    var es = x as ExpressionStatement;
                    if (es == null) break;

                    // x.Name1 = x.Name2 = …… = value
                    List<MemberReferenceExpression> memberRefs = new List<MemberReferenceExpression>();
                    Expression memberValue = null;
                    var ae = es.Expression as AssignmentExpression;
                    while (ae != null && ae.Operator == AssignmentOperatorType.Assign)
                    {
                        var left = ae.Left as MemberReferenceExpression;
                        if (left == null)
                        {
                            memberRefs = null;
                            break;
                        }

                        var il = left.Target as IdentifierExpression;
                        if (il == null || il.Identifier != @var.Name)
                        {
                            memberRefs = null;
                            break;
                        }

                        memberRefs.Add(left);
                        memberValue = ae.Right;
                        ae = ae.Right as AssignmentExpression;
                    }
                    if (memberRefs == null || memberRefs.Count == 0) break;

                    //StoryboardTransitionBase.C_Ii1 c_Ii = new StoryboardTransitionBase.C_Ii1
                    //{
                    //    f_cUb_987AB8FF = presenter,
                    //    f_7Ub_6737D612 = fromContent,
                    //    f_8Ub_6737D612 = toContent,
                    //    f_Xo_B3F66E6B = this,
                    //    f_5Ub_B15D4D71 = this.GetFromContentStoryboard(c_Ii.f_cUb_987AB8FF, c_Ii.f_7Ub_6737D612),
                    //    f_6Ub_B15D4D71 = this.GetToContentStoryboard(c_Ii.f_cUb_987AB8FF, c_Ii.f_8Ub_6737D612)
                    //};
                    var query = memberValue.DescendantsAndSelf.OfType<MemberReferenceExpression>().Where(y =>
                    {
                        IdentifierExpression ie = y.Target as IdentifierExpression;
                        return ie != null && ie.Identifier == @var.Name;
                    }).Select(y => new { R = y, NE = processedList.FirstOrDefault(z => z.Name == y.MemberName) });
                    if (query.Any(y => y.NE == null)) break;
                    foreach (var y in query)
                    {
                        y.R.ReplaceWith(y.NE.Expression.Clone());
                    }

                    DelayRemove(x);
                    memberValue.Remove();
                    foreach (var r in memberRefs)
                    {
                        var element = new NamedExpression(r.MemberName, memberValue.Clone()).CopyAnnotationsFrom(r);
                        var added = setters.Elements.FirstOrDefault(y =>
                        {
                            NamedExpression ne = y as NamedExpression;
                            return ne != null && ne.Name == r.MemberName;
                        });
                        if (added == null)
                        {
                            setters.Elements.Add(element);
                        }
                        else
                        {
                            // 如果重复设置属性,后来优先
                            added.ReplaceWith(element);
                        }
                        processedList.Add(element);
                    }
                }
                if (setters.Elements.Count > 0)
                {
                    creation.Initializer = setters;
                }
//.........这里部分代码省略.........
开发者ID:DKeeper1523,项目名称:ilspy_yh,代码行数:101,代码来源:YuehanTransform.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# NamedPipeClientStream类代码示例发布时间:2022-05-24
下一篇:
C# NamedArgumentExpression类代码示例发布时间: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