static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); MainForm mMainForm = new MainForm(); mMainForm.Visible = false; Login mLogin = new Login(mMainForm); WerewolfController mControler = WerewolfController.GetInstance(); WerewolfModel mModel = new WerewolfModel(); register mRegister = new register(mLogin, ""); // View -> Controller mMainForm.setController(mControler); mLogin.setController(mControler); mRegister.setController(mControler); // Controler -> Model mControler.AddModel(mModel); // Model -> View mModel.AttachObserver(mLogin); mModel.AttachObserver(mMainForm); mModel.AttachObserver(mRegister); Application.Run(mLogin); }
public Login(Form MainForm) { InitializeComponent(); string sever = TBServer.Text; frm = new register(this, sever); _mainForm = MainForm; }