private Controller.OptionCtrl InitOptionCtrl() { var ctrl = new Controller.OptionCtrl(); ctrl.Plug( new Controller.OptionComponent.Import( flyImportPanel, btnImportAdd)); ctrl.Plug( new Controller.OptionComponent.Subscription( flySubsUrlContainer, btnAddSubsUrl, btnUpdateViaSubscription)); return(ctrl); }
private void FormOption_Shown(object sender, System.EventArgs e) { this.optionCtrl = InitOptionCtrl(); this.FormClosing += (s, a) => { if (!this.optionCtrl.IsOptionsSaved()) { a.Cancel = !Lib.UI.Confirm(I18N("ConfirmCloseWinWithoutSave")); } }; this.FormClosed += (s, a) => { setting.LazyGC(); }; }
private void FormOption_Shown(object sender, System.EventArgs e) { // throw new System.ArgumentException("for debug"); this.optionCtrl = InitOptionCtrl(); this.FormClosing += (s, a) => { if (!this.optionCtrl.IsOptionsSaved()) { a.Cancel = !Lib.UI.Confirm(I18N("ConfirmCloseWinWithoutSave")); } }; this.FormClosed += (s, a) => { Service.Servers.Instance.LazyGC(); }; }