Пример #1
0
		public override ICodeNode VisitObjectCreationExpression (ObjectCreationExpression node)
		{
			if (node.Constructor == null)
				goto skip;
			
			var type = node.Constructor.DeclaringType;
			
			if (!type.Resolve ().IsDelegate ())
				goto skip;
			
			var target = node.Arguments [0];
			var method = node.Arguments [1] as MethodAddressExpression;
			
			if (method == null)
				goto skip;
			
			return new DelegateCreationExpression (type, method.Method, target);

		skip:
			return base.VisitObjectCreationExpression (node);
		}
Пример #2
0
 public virtual ICodeNode VisitObjectCreationExpression(ObjectCreationExpression node)
 {
     node.Arguments   = (ExpressionCollection)Visit(node.Arguments);
     node.Initializer = (BlockExpression)Visit(node.Initializer);
     return(node);
 }
		public override void VisitObjectCreationExpression (ObjectCreationExpression node)
		{
			WriteKeyword ("new");
			WriteSpace ();
			WriteReference (node.Constructor != null ? node.Constructor.DeclaringType : node.Type);
			WriteToken ("(");
			Visit (node.Arguments);
			WriteToken (")");
		}
Пример #4
0
		public virtual void VisitObjectCreationExpression (ObjectCreationExpression node)
		{
			Visit (node.Arguments);
			Visit (node.Initializer);
		}
Пример #5
0
 public virtual void VisitObjectCreationExpression(ObjectCreationExpression node)
 {
     Visit(node.Arguments);
     Visit(node.Initializer);
 }