Exemplo n.º 1
0
        private void BrowseUp()
        {
            var parent = _focus.Parent;

            if (parent != null)
            {
                _focus = parent;
            }
        }
Exemplo n.º 2
0
        public void AddChild(CustomShapeBase child)
        {
            var children    = Volatile.Read(ref _children);
            var length      = children.Length;
            var newChildren = new CustomShapeBase[length + 1];

            children.CopyTo(newChildren, 0);
            newChildren[length] = child;
            Volatile.Write(ref child._parent, this);
            Volatile.Write(ref _children, newChildren);
            SetGroupChange();
        }
Exemplo n.º 3
0
        private void RemoveChild()
        {
            var parent = _focus.Parent;

            if (parent == null)
            {
                _focus.RemoveAll();
                return;
            }
            parent.RemoveChild(_focus);
            _focus = parent;
        }
Exemplo n.º 4
0
        public void RemoveChild(CustomShapeBase child)
        {
            if (child._parent != this)
            {
                return;
            }
            var children    = Volatile.Read(ref _children);
            var length      = children.Length;
            var newChildren = children.Where(c => c != child).ToArray();

            Volatile.Write(ref _children, newChildren);
            Volatile.Write(ref child._parent, null);
            //child.Dispose();
            SetGroupChange();
        }
Exemplo n.º 5
0
        private void AddChild()
        {
            int             max   = 100;
            CustomShapeBase child = null;

            for (int i = 0; i < max; i++)
            {
                for (int j = 0; j < max; j++)
                {
                    child = new CustomRectangle(i, j, 0, 10, 10);
                    _focus.AddChild(child);
                }
            }
            _focus = child;
        }