Exemplo n.º 1
0
        public override DataComponent Remove(DataComponent component)
        {
            if (component is File)
            {
                filesCount--;
            }
            else if (component is Folder)
            {
                foldersCount--;
            }

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

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