Esempio n. 1
0
        //构造函数注入
        public ApplePhone(IMicrophone microphone)
        {
            Microphone = microphone;
            WriteLineWithColor($"构造函数注入{microphone.GetType().Name}类型");

            Id = Guid.NewGuid().ToString();
            Console.WriteLine($"ApplePhone 被构造,Id:{Id}");
        }
Esempio n. 2
0
 public ApplePhone(IMicrophone microphone)
 {
     Microphone = microphone;
     WriteLineWithColor($"构造函数注入{microphone.GetType().Name}类型");
 }