示例#1
0
 public void Edit(MyMeta.View obj)
 {
     if (this._currentType == obj.GetType())
     {
         return;
     }
     BindGrid(obj.GlobalProperties);
     this._currentType = obj.GetType();
 }
示例#2
0
        private void BeforeNodeSelected(TreeNode node)
        {
            if (node != null)
            {
                if (this.MetaData == null || node.Tag == null)
                {
                    return;
                }

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

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

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

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

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

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

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

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

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

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

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

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

                    default:
                        UserData.Clear();
                        break;
                    }

                    switch (data.Type)
                    {
                    case NodeType.DATABASE:
                    {
                        Database o = obj as Database;
                        MetaData.DisplayDatabaseProperties(o, node);
                        UserData.EditSingle(o, o.Alias);
                        //GlobalUserData.Edit(o);
                    }
                    break;

                    case NodeType.COLUMN:
                    {
                        Column o = obj as Column;
                        MetaData.DisplayColumnProperties(o, node);
                        UserData.EditSingle(o, o.Alias);
                        GlobalUserData.Edit(o);
                    }
                    break;

                    case NodeType.TABLE:
                    {
                        Table o = obj as Table;
                        MetaData.DisplayTableProperties(o, node);
                        UserData.EditSingle(o, o.Alias);
                        GlobalUserData.Edit(o);
                    }
                    break;

                    case NodeType.VIEW:
                    {
                        MyMeta.View o = obj as MyMeta.View;
                        MetaData.DisplayViewProperties(o, node);
                        UserData.EditSingle(o, o.Alias);
                        GlobalUserData.Edit(o);
                    }
                    break;

                    case NodeType.PARAMETER:
                    {
                        MyMeta.Parameter o = obj as MyMeta.Parameter;
                        MetaData.DisplayParameterProperties(o, node);
                        UserData.EditSingle(o, o.Alias);
                        GlobalUserData.Edit(o);
                    }
                    break;

                    case NodeType.RESULTCOLUMN:
                    {
                        ResultColumn o = obj as ResultColumn;
                        MetaData.DisplayResultColumnProperties(o, node);
                        UserData.EditSingle(o, o.Alias);
                        GlobalUserData.Edit(o);
                    }
                    break;

                    case NodeType.FOREIGNKEY:
                    {
                        ForeignKey o = obj as ForeignKey;
                        MetaData.DisplayForeignKeyProperties(o, node);
                        UserData.EditSingle(o, o.Alias);
                        GlobalUserData.Edit(o);
                    }
                    break;

                    case NodeType.INDEX:
                    {
                        Index o = obj as Index;
                        MetaData.DisplayIndexProperties(o, node);
                        UserData.EditSingle(o, o.Alias);
                        GlobalUserData.Edit(o);
                    }
                    break;

                    case NodeType.PROCEDURE:
                    {
                        Procedure o = obj as Procedure;
                        MetaData.DisplayProcedureProperties(o, node);
                        UserData.EditSingle(o, o.Alias);
                        GlobalUserData.Edit(o);
                    }
                    break;

                    case NodeType.DOMAIN:
                    {
                        Domain o = obj as Domain;
                        MetaData.DisplayDomainProperties(o, node);
                        UserData.EditSingle(o, o.Alias);
                        GlobalUserData.Edit(o);
                    }
                    break;

                    default:
                        MetaData.Clear();
                        GlobalUserData.Clear();
                        break;
                    }
                }
            }
        }
示例#3
0
		internal void AddView(View view)
		{
			this._array.Add(view);
		}
示例#4
0
 public void Edit(MyMeta.View obj)
 {
     BindGrid(obj.GlobalProperties);
 }
示例#5
0
        private void MyTree_BeforeSelect(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
        {
            try
            {
                if (null == this.MetaData)
                {
                    return;
                }

                NodeData   data = (NodeData)e.Node.Tag;
                MetaObject obj  = null;

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

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

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

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

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

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

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

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

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

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

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

                    default:
                        UserData.Clear();
                        break;
                    }

                    switch (data.Type)
                    {
                    case NodeType.DATABASE:
                    {
                        Database o = obj as Database;
                        MetaData.DisplayDatabaseProperties(o, e.Node);
                        UserData.EditSingle(o, o.Alias);
                        //GlobalUserData.Edit(o);
                    }
                    break;

                    case NodeType.COLUMN:
                    {
                        Column o = obj as Column;
                        MetaData.DisplayColumnProperties(o, e.Node);
                        UserData.EditSingle(o, o.Alias);
                        GlobalUserData.Edit(o);
                    }
                    break;

                    case NodeType.TABLE:
                    {
                        Table o = obj as Table;
                        MetaData.DisplayTableProperties(o, e.Node);
                        UserData.EditSingle(o, o.Alias);
                        GlobalUserData.Edit(o);
                    }
                    break;

                    case NodeType.VIEW:
                    {
                        MyMeta.View o = obj as MyMeta.View;
                        MetaData.DisplayViewProperties(o, e.Node);
                        UserData.EditSingle(o, o.Alias);
                        GlobalUserData.Edit(o);
                    }
                    break;

                    case NodeType.PARAMETER:
                    {
                        MyMeta.Parameter o = obj as MyMeta.Parameter;
                        MetaData.DisplayParameterProperties(o, e.Node);
                        UserData.EditSingle(o, o.Alias);
                        GlobalUserData.Edit(o);
                    }
                    break;

                    case NodeType.RESULTCOLUMN:
                    {
                        ResultColumn o = obj as ResultColumn;
                        MetaData.DisplayResultColumnProperties(o, e.Node);
                        UserData.EditSingle(o, o.Alias);
                        GlobalUserData.Edit(o);
                    }
                    break;

                    case NodeType.FOREIGNKEY:
                    {
                        ForeignKey o = obj as ForeignKey;
                        MetaData.DisplayForeignKeyProperties(o, e.Node);
                        UserData.EditSingle(o, o.Alias);
                        GlobalUserData.Edit(o);
                    }
                    break;

                    case NodeType.INDEX:
                    {
                        Index o = obj as Index;
                        MetaData.DisplayIndexProperties(o, e.Node);
                        UserData.EditSingle(o, o.Alias);
                        GlobalUserData.Edit(o);
                    }
                    break;

                    case NodeType.PROCEDURE:
                    {
                        Procedure o = obj as Procedure;
                        MetaData.DisplayProcedureProperties(o, e.Node);
                        UserData.EditSingle(o, o.Alias);
                        GlobalUserData.Edit(o);
                    }
                    break;

                    case NodeType.DOMAIN:
                    {
                        Domain o = obj as Domain;
                        MetaData.DisplayDomainProperties(o, e.Node);
                        UserData.EditSingle(o, o.Alias);
                        GlobalUserData.Edit(o);
                    }
                    break;
                    //
                    //					case NodeType.PROVIDERTYPE:
                    //						MetaData.DisplayProviderTypeProperties(obj as IProviderType, e.Node);
                    //						break;

                    default:
                        MetaData.Clear();
                        GlobalUserData.Clear();
                        break;
                    }
                }
            }
#if DEBUG
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
#else
            catch {}
#endif
        }