예제 #1
0
        public virtual void ClobberingAddChild(FileSystemObject child, FileSystemObject victim, EventTracker tracker)
        {
            if (children == null)
            {
                throw new Exception("Can't add a child to " + Uri.ToString());
            }
            if (child.parent != null)
            {
                throw new Exception("Can't add parented child " + child.Uri.ToString() + " to " + Uri.ToString());
            }
            if (victim.parent != this)
            {
                throw new Exception("Victim " + victim.Uri.ToString() + " is not a child of " + Uri.ToString());
            }
            if (child.Extension != victim.Extension)
            {
                throw new Exception("Extension mismatch: " + child.Extension + " vs. " + victim.Extension);
            }

            victim.parent         = null;
            child.parent          = this;
            child.id              = victim.id;
            child.base_name       = victim.base_name;
            child.name            = null;
            children [child.Name] = child;

            if (IsRooted)
            {
                child.AddOnDisk(tracker);
            }
        }
예제 #2
0
        public virtual void AddChild(FileSystemObject child, EventTracker tracker)
        {
            if (children == null)
            {
                throw new Exception("Can't add a child to " + Uri.ToString());
            }
            if (child.parent != null)
            {
                throw new Exception("Can't add parented child " + child.Uri.ToString() + " to " + Uri.ToString());
            }

            // FIXME: Need to handle the case of the added child
            // clobbering another w/ the same name.

            child.parent          = this;
            children [child.Name] = child;

            if (IsRooted)
            {
                child.AddOnDisk(tracker);
            }
        }
예제 #3
0
		public virtual void ClobberingAddChild (FileSystemObject child, FileSystemObject victim, EventTracker tracker)
		{
			if (children == null)
				throw new Exception ("Can't add a child to " + Uri.ToString ());
			if (child.parent != null)
				throw new Exception ("Can't add parented child " + child.Uri.ToString () + " to " + Uri.ToString ());
			if (victim.parent != this)
				throw new Exception ("Victim " + victim.Uri.ToString () + " is not a child of " + Uri.ToString ());
			if (child.Extension != victim.Extension)
				throw new Exception ("Extension mismatch: " + child.Extension + " vs. " + victim.Extension);

			victim.parent = null;
			child.parent = this;
			child.id = victim.id;
			child.base_name = victim.base_name;
			child.name = null;
			children [child.Name] = child;

			if (IsRooted)
				child.AddOnDisk (tracker);
		}
예제 #4
0
		public virtual void AddChild (FileSystemObject child, EventTracker tracker)
		{
			if (children == null)
				throw new Exception ("Can't add a child to " + Uri.ToString ());
			if (child.parent != null)
				throw new Exception ("Can't add parented child " + child.Uri.ToString () + " to " + Uri.ToString ());

			// FIXME: Need to handle the case of the added child
			// clobbering another w/ the same name.

			child.parent = this;
			children [child.Name] = child;
			
			if (IsRooted)
				child.AddOnDisk (tracker);
		}