Beispiel #1
0
        public void Remove()
        {
            if (Parent != null)
            {
                lock (Parent)
                {
                    Parent.IncrementVersion();

                    if (Parent.FirstChild == this)
                    {
                        Parent.FirstChild           = NextSibling;
                        NextSibling.PreviousSibling = null;
                    }
                    else
                    {
                        PreviousSibling.NextSibling = NextSibling;
                        NextSibling.PreviousSibling = PreviousSibling;
                    }
                }
            }
        }
Beispiel #2
0
        public VfsNode(string name, DateTime timestamp, VfsDirectoryNode parent)
        {
            Name      = name;
            Timestamp = timestamp;
            Parent    = parent;

            if (parent != null)
            {
                lock (parent)
                {
                    Parent.IncrementVersion();

                    NextSibling = parent.FirstChild;
                    if (parent.FirstChild != null)
                    {
                        parent.FirstChild.PreviousSibling = this;
                    }

                    Parent.FirstChild = this;
                }
            }
        }