Exemplo n.º 1
0
 public void InitData(List <DBDevelopClientWebApi.TagGroup> groups)
 {
     foreach (var vv in groups.Where(e => e.Parent == this.FullName))
     {
         TagGroupViewModel groupViewModel = new TagGroupViewModel()
         {
             Name = vv.Name, Database = Database
         };
         groupViewModel.Parent = this;
         this.Children.Add(groupViewModel);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        private void QueryGroups()
        {
            Application.Current?.Dispatcher.Invoke(() => {
                this.mTagGroups.Clear();
            });

            if (!string.IsNullOrEmpty(CurrentDatabase))
            {
                TagGroupViewModel root = null;
                Application.Current?.Dispatcher.Invoke(() =>
                {
                    root = new TagGroupViewModel()
                    {
                        Database = CurrentDatabase, Name = CurrentDatabase, IsExpended = true, IsSelected = true
                    };
                    mTagGroups.Add(root);

                    CurrentGroup = root;
                });


                var vv = mHelper.GetTagGroup(CurrentDatabase);
                if (vv != null)
                {
                    foreach (var vvv in vv.Where(e => string.IsNullOrEmpty(e.Parent)))
                    {
                        Application.Current?.Dispatcher.Invoke(() =>
                        {
                            TagGroupViewModel groupViewModel = new TagGroupViewModel()
                            {
                                Name = vvv.Name, Database = CurrentDatabase, Parent = root
                            };
                            root.Children.Add(groupViewModel);
                            groupViewModel.InitData(vv);
                        });
                    }
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        private void QueryGroups()
        {
            Application.Current?.Dispatcher.Invoke(() => {
                this.mTagGroups.Clear();
            });

            var vv = mHelper.GetTagGroup(CurrentDatabase);

            if (vv != null)
            {
                foreach (var vvv in vv.Where(e => string.IsNullOrEmpty(e.Parent)))
                {
                    Application.Current?.Dispatcher.Invoke(() => {
                        TagGroupViewModel groupViewModel = new TagGroupViewModel()
                        {
                            Name = vvv.Name, Database = CurrentDatabase
                        };
                        mTagGroups.Add(groupViewModel);
                        groupViewModel.InitData(vv);
                    });
                }
            }
        }