Пример #1
0
        public void Initialize(DBTable table, DBItem row, DBColumn ownColumn, TableEditorMode openmode, bool readOnly)
        {
            if (this.table == null)
            {
                this.table = table;
            }

            if (Name == "")
            {
                Name = table.Name + ownColumn?.Name;
            }

            TableExplorerNode node = null;

            if (openmode == TableEditorMode.Item)
            {
                node = SelectRow(null, table, row, ownColumn, readOnly);
            }
            else
            {
                node = InitToolTable(table, row, ownColumn, openmode, readOnly);
                Tree.Nodes.Add(node);
            }
            Current = node;
        }
Пример #2
0
        public TableExplorerNode InitToolTable(DBTable table, DBItem row, DBColumn ownColumn, TableEditorMode openmode, bool readOnly)
        {
            TableExplorerNode node = Find(table, ownColumn, row);

            if (node == null)
            {
                node = new TableExplorerNode()
                {
                    Info = new TableEditorInfo()
                    {
                        Table     = table,
                        TableView = openmode == TableEditorMode.Item ? null
                        : table.CreateItemsView("", DBViewKeys.None, DBStatus.Actual | DBStatus.Edit | DBStatus.New | DBStatus.Error),
                        Item     = row,
                        Column   = ownColumn,
                        Mode     = openmode,
                        ReadOnly = readOnly
                    }
                };
            }
            return(node);
        }