DotNetXri.Client.Resolve.CacheNode.removeSelf C# (CSharp) Méthode

removeSelf() private méthode

private removeSelf ( bool bRemoveFromParent ) : bool
bRemoveFromParent bool
Résultat bool
        internal bool removeSelf(bool bRemoveFromParent)
        {
            if (moParent == null) {
                return false;
            }

            // remove yourself from the linked list
            detach();

            // lower the counter
            moCache.decrement();

            // tell your children to remove themselves
            IEnumerator oChild = moCacheHash.Values.GetEnumerator();
            while (oChild.MoveNext()) {
                ((CacheNode)oChild.Current).removeSelf(false);
            }

            // if we don't have to remove ourselves from our parent, we are done
            if (!bRemoveFromParent) {
                return true;
            }

            // finally, remove yourself from your parent
            bool result = moParent.moCacheHash.ContainsKey(msSubsegment);
            if (result) {
                moParent.moCacheHash.Remove(msSubsegment);
            }
            return result;
        }