public MainForm() { InitializeComponent(); ts_setter_ = new TExcState(this.Handle); // Init option_cb_dic_ opt_cb_dic_[TExcState.AWAY_MODE] = this.checkBox1; opt_cb_dic_[TExcState.SYS_REQ] = this.checkBox2; opt_cb_dic_[TExcState.DISPLAY_REQ] = this.checkBox3; opt_cb_dic_[TExcState.AWAKE_IN_LID_CLODE] = this.checkBox4; foreach (KeyValuePair <uint, CheckBox> item in opt_cb_dic_) { uint opt = item.Key; CheckBox cb = item.Value; cb_opt_dic_[cb] = opt; cb.Text = Public.OptNameDic[opt]; cb.Click += new System.EventHandler(this.OptionCBClick); } this.Text = Public.LocalStrDic[Public.LocalStrID.TITLE]; SetCheckBoxState(); ts_setter_.AddValChangeCB( new TExcState.ValChangeCB(this.SetCheckBoxState)); notify_icon_ = new MyNotifyIcon(this, ts_setter_, false); }
public Form1() { InitializeComponent(); ts_setter_ = new TExcState(this.Handle); // Init option_cb_dic_ opt_cb_dic_[TExcState.AWAY_MODE] = this.checkBox1; opt_cb_dic_[TExcState.SYS_REQ] = this.checkBox2; opt_cb_dic_[TExcState.DISPLAY_REQ] = this.checkBox3; opt_cb_dic_[TExcState.AWAKE_IN_LID_CLODE] = this.checkBox4; foreach (KeyValuePair<uint, CheckBox> item in opt_cb_dic_) { uint opt = item.Key; CheckBox cb = item.Value; cb_opt_dic_[cb] = opt; cb.Text = Public.opt_name_dic_[opt]; cb.Click += new System.EventHandler(this.OptionCBClick); } this.Text = Public.kProgramName; SetCheckBoxState(); ts_setter_.AddValChangeCB( new TExcState.ValChangeCB(this.SetCheckBoxState)); notify_icon_ = new MyNotifyIcon(this, ts_setter_, false); }
public MyNotifyIcon(Form form, TExcState ts_setter = null, bool show_now = false) { ts_setter_ = ts_setter ?? new TExcState(); main_form_ = form; InitMenuStrip(); // Notify_icon notify_icon_ = new System.Windows.Forms.NotifyIcon(); notify_icon_.Text = Public.kProgramName; notify_icon_.Visible = true; notify_icon_.Click += new System.EventHandler(notifyIcon_Click); notify_icon_.ContextMenuStrip = notify_menu_; InitIcon(); // Set state SetMenuItemState(); ts_setter_.AddValChangeCB(new TExcState.ValChangeCB(this.SetMenuItemState)); if (show_now) { main_form_.Show(); } }
public MyNotifyIcon(Form form, TExcState ts_setter = null, bool show_now = false) { ts_setter_ = ts_setter ?? new TExcState(); main_form_ = form; InitMenuStrip(); // Notify_icon notify_icon_ = new System.Windows.Forms.NotifyIcon(); notify_icon_.Text = Public.LocalStrDic[Public.LocalStrID.TITLE]; notify_icon_.Visible = true; notify_icon_.Click += new System.EventHandler(notifyIcon_Click); notify_icon_.ContextMenuStrip = notify_menu_; InitIcon(); // Set state SetMenuItemState(); ts_setter_.AddValChangeCB(new TExcState.ValChangeCB(this.SetMenuItemState)); if (show_now) { main_form_.Show(); } }