public override Expression CloneExpressionOnly()
        {
            InitializerExpression initializerClone = Initializer != null?Initializer.CloneExpressionOnly() as InitializerExpression : null;

            AnonymousObjectCreationExpression result = new AnonymousObjectCreationExpression(Constructor, Type, initializerClone, null);

            return(result);
        }
        public override bool Equals(Expression other)
        {
            if (!(other is AnonymousObjectCreationExpression))
            {
                return(false);
            }

            AnonymousObjectCreationExpression anonymousObjectCreation = other as AnonymousObjectCreationExpression;

            #region CheckConstructor

            if (this.Constructor == null)
            {
                if (anonymousObjectCreation.Constructor != null)
                {
                    return(false);
                }
            }
            else
            {
                if (anonymousObjectCreation.Constructor == null || this.Constructor.FullName != anonymousObjectCreation.Constructor.FullName)
                {
                    return(false);
                }
            }
            #endregion

            #region CheckType

            if (this.Type == null)
            {
                if (anonymousObjectCreation.Type != null)
                {
                    return(false);
                }
            }
            else if (anonymousObjectCreation.Type == null || this.Type.FullName != anonymousObjectCreation.Type.FullName)
            {
                return(false);
            }
            #endregion

            #region CheckInitializer
            if (this.Initializer == null)
            {
                if (anonymousObjectCreation.Initializer != null)
                {
                    return(false);
                }
            }
            else if (anonymousObjectCreation.Initializer == null || !this.Initializer.Equals(anonymousObjectCreation.Initializer))
            {
                return(false);
            }
            #endregion

            return(true);
        }
		public override void VisitAnonymousObjectCreationExpression(AnonymousObjectCreationExpression node)
		{
			WriteKeyword(KeyWordWriter.New);

			if (KeyWordWriter.ObjectInitializer != null)
			{
				WriteSpace();
				WriteKeyword(KeyWordWriter.ObjectInitializer);
			}
			StartInitializer(node.Initializer);
			Visit(node.Initializer);
		}
		public override void VisitAnonymousObjectCreationExpression(AnonymousObjectCreationExpression node)
		{
			TypesDependingOn.UnionWith(Utilities.GetTypeReferenceTypesDepedningOn(node.ExpressionType));
			base.VisitAnonymousObjectCreationExpression(node);
		}
		public override void VisitAnonymousObjectCreationExpression(AnonymousObjectCreationExpression node)
		{
			if (node.Constructor != null)
			{
				TrySetObjectCreationPendingName(node.Constructor.DeclaringType);
			}
			ClearPendingForSuggestion();

			base.VisitAnonymousObjectCreationExpression(node);
		}
 public virtual void VisitAnonymousObjectCreationExpression(AnonymousObjectCreationExpression node)
 {
     Visit(node.Initializer);
 }
        public override Expression CloneExpressionOnly()
        {
			InitializerExpression initializerClone = Initializer != null ? Initializer.CloneExpressionOnly() as InitializerExpression : null;
			AnonymousObjectCreationExpression result = new AnonymousObjectCreationExpression(Constructor, Type, initializerClone, null);
            return result;
        }
			public override void VisitAnonymousObjectCreationExpression(AnonymousObjectCreationExpression node)
			{
				if (state == SearchState.Propagation)
				{
					canBePropagated = false;
					return;
				}
				base.VisitAnonymousObjectCreationExpression(node);
			}