public void Remove()
        {
            if (this.ChildrenCount > 0)
            {
                Childrens.Clear();
            }

            this.Deleted = true;

            // CheckKeyChildrenCount(this);

            if (ParentKey != null)
            {
                ParentKey.Childrens.Remove(this);

                // CheckKeyChildrenCount(this);
            }
            else
            {
                RedisDb.Keys.Remove(this);
            }

            OnPropertyChanged(nameof(Childrens));
            OnPropertyChanged(nameof(Deleted));
        }
Beispiel #2
0
 public void Dispose()
 {
     GL.DeleteBuffer(vId);
     GL.DeleteVertexArray(vao);
     _shape = null;
     InstasingList.Clear();
     foreach (var visuals in Childrens)
     {
         visuals.Dispose();
     }
     Childrens.Clear();
 }
Beispiel #3
0
        /// <summary>
        /// Loads the items.
        /// </summary>
        public void LoadItems()
        {
            // If there is no data
            if (IsLoaded)
            {
                return;
            }

            // Clear the Children list
            var categories = KbContext.CurrentKb.ManagerCategory.GetByParentCategoryID(Id)
                             .Select(category => new CategoryNode(category.CategoryID, category.Name, this));

            // Populate the treeview thanks to the bind


            Childrens.Clear();

            foreach (var node in categories)
            {
                node.IsVisible = KbContext.CurrentKb.PermissionSet.HasVisibleChildren(node.Id);
                Childrens.Add(node);
            }
        }