Example #1
0
        public override DataComponent Remove(DataComponent component)
        {
            if (component is File)
            {
                filesCount--;
            }
            else if (component is Folder)
            {
                foldersCount--;
            }

            dataList.Remove(component);
            return(this);
        }
Example #2
0
        public override DataComponent Add(DataComponent component)
        {
            if (component is File)
            {
                filesCount++;
            }
            else if (component is Folder)
            {
                foldersCount++;
            }

            dataList.Add(component);
            return(this);
        }
Example #3
0
 public override DataComponent Remove(DataComponent component)
 {
     Console.WriteLine("Can't remove file from a file.");
     return(this);
 }
Example #4
0
 public override DataComponent Add(DataComponent component)
 {
     Console.WriteLine("Can't add file in a file.");
     return(this);
 }
 public abstract DataComponent Remove(DataComponent c);
 public abstract DataComponent Add(DataComponent c);