public DBLoadProgressEventArgs(IDBTableView view, int total, int current, DBItem row)
     : base(view, null)
 {
     this.totalCount = total;
     this.current    = current;
     this.row        = row;
 }
Exemple #2
0
        public void Initialize(IDBTableView view, DBItem row, DBColumn ownColumn, TableEditorMode openmode, bool readOnly)
        {
            TableView   = view;
            OwnerColumn = ownColumn;
            OwnerRow    = row;

            if (Table == null)
            {
                return;
            }

            ReadOnly = readOnly;
            OpenMode = openmode;

            Name = Table.Name.Replace(" ", "_") + ownColumn;
            Text = GetText(this);

            // toolInsert.DropDownItems.Clear();

            if (openmode == TableEditorMode.Referencing)
            {
                foreach (var cs in Table.Columns.GetIsReference())
                {
                    if (cs.ReferenceTable != null && cs.Name.ToLower() != baseColumn.Name.ToLower())
                    {
                        var item = new ToolMenuItem
                        {
                            Tag  = cs,
                            Name = cs.Name,
                            Text = cs.ToString()
                        };
                        toolAdd.DropDownItems.Add(item);
                    }
                }
                //toolInsert.Add(new SeparatorToolItem ());
            }
        }
Exemple #3
0
 public DBLoadColumnsEventArgs(IDBTableView synch)
     : base()
 {
     this.target = synch;
 }
Exemple #4
0
 public DBLoadCompleteEventArgs(IDBTableView synch, IEnumerable rows)
     : base()
 {
     this.target = synch;
     this.rows   = rows;
 }
Exemple #5
0
        public void InitItem(IDBTableView view, bool show, GlyphType glyph, Color glyphColor)
        {
            if (view == null)
            {
                return;
            }
            TableItemNode node = null;

            if (show)
            {
                view.CollectionChanged   += OnCollectionChanged;
                view.ItemPropertyChanged += OnItemPropertyChanged;
                views.Add(view);
                if (ShowListNode)
                {
                    node            = InitItem((IDBTableContent)view);
                    node.Glyph      = glyph;
                    node.GlyphColor = glyphColor;
                    node.CheckNodes = true;
                    node.Localize();
                }
                IEnumerable enumer = view;
                if (view.Table.GroupKey != null)
                {
                    enumer = view.Table.SelectItems(view.Table.GroupKey, CompareType.Is, null);
                }

                foreach (DBItem item in enumer)
                {
                    if ((!Current ||
                         ((DBStatus.Actual | DBStatus.Edit | DBStatus.New | DBStatus.Error) & item.Status) != DBStatus.Empty) &&
                        (!Access || item.Access.GetFlag(AccessType.Read, GuiEnvironment.User)))
                    {
                        var element = InitItem(item);
                        if (ShowListNode)
                        {
                            element.Group = node;
                        }
                        else
                        {
                            Nodes.Add(element);
                        }
                    }
                }
                if (ShowListNode)
                {
                    Nodes.Add(node);
                }
            }
            else
            {
                view.CollectionChanged   -= OnCollectionChanged;
                view.ItemPropertyChanged -= OnItemPropertyChanged;
                views.Remove(view);
                node = (TableItemNode)Nodes.Find(GetName(view));
                if (node != null)
                {
                    node.Hide();
                }
            }
        }
Exemple #6
0
 public override void AddView(IDBTableView view)
 {
     queryViews.Add(view);
 }
Exemple #7
0
 public override void RemoveView(IDBTableView view)
 {
     queryViews.Remove(view);
 }