Ejemplo n.º 1
0
        internal Command(CommandsList parent, HierarchyNode node, string text, Action <HierarchyNode, Command> onInvoke = null, string description = null)
        {
            Parent      = parent;
            Text        = text;
            Description = description;

            if (onInvoke != null)
            {
                Commanded += (cs, ca) => { onInvoke(node, this); };
            }
        }
Ejemplo n.º 2
0
        public HierarchyNode()
        {
            Id = System.Threading.Interlocked.Increment(ref Counter);
            allItems.Add(this);
            Children   = new NotifyingList <HierarchyNode>();
            Properties = new PropertiesList();
            Commands   = new CommandsList(this);

            Children.ItemAdded += (s, a) =>
            {
                a.Item.Parent = this;
                this.NotifyChildAdded(a.Item);
            };
            Children.ItemRemoved += (s, a) =>
            {
                this.NotifyChildRemoved(a.Item);
                a.Item.Parent = null;
            };
        }