private void BeforeNodeSelected(TreeNode node)
        {
            if (node != null)
            {
                if (node.Tag == null)
                {
                    return;
                }

                NodeData   data = node.Tag as NodeData;
                MetaObject obj  = null;

                if (data.Type != NodeType.ESMETADATAENGINE)
                {
                    obj = data.Meta as MetaObject;
                }

                if (data != null)
                {
                    switch (data.Type)
                    {
                    case NodeType.COLUMNS:
                        this.EditNiceNames(data.Meta as Columns);
                        break;

                    case NodeType.DATABASES:
                        this.EditNiceNames(data.Meta as Databases);
                        break;

                    case NodeType.TABLES:
                    case NodeType.SUBTABLES:
                        this.EditNiceNames(data.Meta as Tables);
                        break;

                    case NodeType.VIEWS:
                    case NodeType.SUBVIEWS:
                        this.EditNiceNames(data.Meta as Views);
                        break;

                    case NodeType.FOREIGNKEYS:
                    case NodeType.INDIRECTFOREIGNKEYS:
                        this.EditNiceNames(data.Meta as ForeignKeys);
                        break;

                    case NodeType.PARAMETERS:
                        this.EditNiceNames(data.Meta as Parameters);
                        break;

                    case NodeType.RESULTCOLUMNS:
                        this.EditNiceNames(data.Meta as ResultColumns);
                        break;

                    case NodeType.INDEXES:
                        this.EditNiceNames(data.Meta as Indexes);
                        break;

                    case NodeType.PROCEDURES:
                        this.EditNiceNames(data.Meta as Procedures);
                        break;

                    case NodeType.DOMAINS:
                        this.EditNiceNames(data.Meta as Domains);
                        break;

                    default:
                        this.Grid.DataSource = null;
                        break;
                    }

                    switch (data.Type)
                    {
                    case NodeType.DATABASE:
                    {
                        Database o = obj as Database;
                        metadataProperties.DisplayDatabaseProperties(o, node);
                        this.EditSingle(o, o.Alias);
                    }
                    break;

                    case NodeType.COLUMN:
                    {
                        Column o = obj as Column;
                        metadataProperties.DisplayColumnProperties(o, node);
                        this.EditSingle(o, o.Alias);
                    }
                    break;

                    case NodeType.TABLE:
                    {
                        Table o = obj as Table;
                        metadataProperties.DisplayTableProperties(o, node);
                        this.EditSingle(o, o.Alias);
                    }
                    break;

                    case NodeType.VIEW:
                    {
                        EntitySpaces.MetadataEngine.View o = obj as EntitySpaces.MetadataEngine.View;
                        metadataProperties.DisplayViewProperties(o, node);
                        this.EditSingle(o, o.Alias);
                    }
                    break;

                    case NodeType.PARAMETER:
                    {
                        Parameter o = obj as Parameter;
                        metadataProperties.DisplayParameterProperties(o, node);
                        this.EditSingle(o, o.Alias);
                    }
                    break;

                    case NodeType.RESULTCOLUMN:
                    {
                        ResultColumn o = obj as ResultColumn;
                        metadataProperties.DisplayResultColumnProperties(o, node);
                        this.EditSingle(o, o.Alias);
                    }
                    break;

                    case NodeType.FOREIGNKEY:
                    {
                        ForeignKey o = obj as ForeignKey;
                        metadataProperties.DisplayForeignKeyProperties(o, node);
                        this.EditSingle(o, o.Alias);
                    }
                    break;

                    case NodeType.INDEX:
                    {
                        Index o = obj as Index;
                        metadataProperties.DisplayIndexProperties(o, node);
                        this.EditSingle(o, o.Alias);
                    }
                    break;

                    case NodeType.PROCEDURE:
                    {
                        Procedure o = obj as Procedure;
                        metadataProperties.DisplayProcedureProperties(o, node);
                        this.EditSingle(o, o.Alias);
                    }
                    break;

                    case NodeType.DOMAIN:
                    {
                        Domain o = obj as Domain;
                        metadataProperties.DisplayDomainProperties(o, node);
                        this.EditSingle(o, o.Alias);
                    }
                    break;

                    default:
                        metadataProperties.Clear();
                        break;
                    }
                }
            }
        }
		internal void AddView(View view)
		{
			this._array.Add(view);
		}