Click here to Skip to main content
15,892,965 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
interface IDirectory
{
    public void Copy();
    public void Move(IDirectory Directory);
    public void Delete();
}

class Directory :IDirectory
{
   public List<IDirectory> list = new List<IDirectory>();

   public void Delete(IDirectory Dir)
   {
       foreach (IDirectory item in list)
       {
           item.Delete();
       }
   }

   public void Add(IDirectory Dir)
   {
       list.Add(Dir);
   }

   public void Remove(IDirectory Dir)
   {
       list.Remove(Dir);
   }
}

class File : IDirectory
{
    public void Copy()
    {
            // File copy code
    }
    public void Move(IDirectory Directory)
    {
        // File move code
    }
    public void Delete()
    {
        // File delete code
    }
}
Posted
Comments
OriginalGriff 22-Nov-14 8:46am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
So quite what a "compo patt" is, and what it has to do with that code is a mystery...
As is "what have you tried?", "where are you stuck?", and "what help do you need?"
Use the "Improve question" widget to edit your question and provide better information.
Sergey Alexandrovich Kryukov 23-Nov-14 2:12am    
Excuse me, what is "compo patt"?
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900