예제 #1
0
파일: Program.cs 프로젝트: HautaN7/Demo05
        static void Main(string[] args)
        {
            // Create new clothes
            Fabric shirt = new Fabric { Type = "Shirt", Color = "Red" };
            Fabric pants = new Fabric { Type = "Pants", Color = "Black" };
            Fabric sock = new Fabric { Type = "Sock", Color = "White" };

            // Create dresser
            Dresser dresser = new Dresser();
            dresser.Material = "Wood";
            dresser.Drawer = 2;
            dresser.AddFabric(shirt);
            dresser.AddFabric(pants);
            dresser.AddFabric(sock);
            dresser.AddFabric(sock);

            Console.WriteLine(dresser.ToString());
            Console.WriteLine("Press enter to continue...");
            Console.ReadLine();
        }
예제 #2
0
파일: Dresser.cs 프로젝트: HautaN7/Demo05
 public void AddFabric(Fabric fabric)
 {
     Fabrics.Add(fabric);
 }