コード例 #1
0
 public Automobile(Automobile c)
 {
     Model = c.Model; ProdYear = c.ProdYear; Name = c.Name; Type = c.Type; GarageNumber = c.GarageNumber; Status = c.Status; Project = c.Project;
     foreach (Part item in c.Parts)
     {
         Parts.Add(item);
     }
 }
コード例 #2
0
        static void Main(string[] args)
        {
            Automobile myAutomobile = new Automobile();

            myAutomobile.Make             = "Toyota";
            myAutomobile.Model            = "Corolla";
            myAutomobile.Year             = 2015;
            myAutomobile.EngineType       = Engine.Hybrid;
            myAutomobile.TransmissionType = Transmission.Automatic;
            Console.WriteLine($"Now we have our {myAutomobile.Make} {myAutomobile.Model} {myAutomobile.Year}");
            Console.ReadLine();
        }
コード例 #3
0
 public CheckList(DateTime dt, Automobile c, string desc, string adv)
 {
     CreateDate = dt; Car = new Automobile(c);  IssueDescription = desc; Advices = adv;
 }