static public void RunStructTest(bool isRun) { if (!isRun) { return; } GStudentA stu1 = new GStudentA("God1"); IChangeName iCN = stu1; iCN.Name = "God2"; Console.WriteLine("stu1 name = {0}", stu1.Name); Console.WriteLine("iCN name = {0}", iCN.Name); GStudentB stu2 = new GStudentB("Dog1"); // GStudentB is a sealed class IChangeName iCN2 = stu2; iCN2.Name = "Dog2"; Console.WriteLine("stu2 name = {0}", stu2.Name); Console.WriteLine("iCN2 name = {0}", iCN2.Name); }
public UpdateGameHandler(IChangeName changeName, IUnitOfWork unitOfWork) { _changeName = changeName ?? throw new ArgumentNullException(nameof(changeName)); _unitOfWork = unitOfWork ?? throw new ArgumentNullException(nameof(unitOfWork)); }
public MainMenuViewModel(IStartGame startGame, IChangeName changeName, IConfigServer configureServer) { this.changeName = changeName; this.startGame = startGame; this.configureServer = configureServer; }