示例#1
0
        public override async void OnExpandChanged(bool expanded)
        {
            if (_binded)
            {
                return;
            }

            if (this.Parent is DatabaseItemNode)
            {
                DatabaseItemNode databaseItemNode = (DatabaseItemNode)this.Parent;
                var tabenode = (数据表Node)databaseItemNode.Children.FirstOrDefault(m => m is 数据表Node);
                if (tabenode != null && tabenode.Children.Count == 1 && tabenode.Children[0].Name == "Loading...")
                {
                    tabenode.OnExpandChanged(true);
                }
            }
            try
            {
                var modules = await Helper.Client.InvokeAsync <EJ.DBModule[]>("GetDBModuleList", this.Module.DatabaseID.Value, this.Module.id.Value);

                this.Children.Clear();
                _binded = true;
                foreach (var module in modules)
                {
                    DBModuleNode node = new DBModuleNode(this, module);
                    this.Children.Add(node);
                    node.ReBindItems();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#2
0
        public override void ReBindItems()
        {
            var modules = Helper.Client.InvokeSync <EJ.DBModule[]>("GetDBModuleList", this.Module.DatabaseID.Value, this.Module.id.Value);

            foreach (var module in modules)
            {
                DBModuleNode node = new DBModuleNode(this, module);
                this.Children.Add(node);
                node.ReBindItems();
            }
        }