/// <summary> /// 重新启动配置 /// </summary> public void ReSetConfig() { if (_hotKey != null && _hotKey.IsRegistered) { _hotKey.UnRegister(); } _hotKey = new HotKey(1, _config.Modifiers, _config.HotKey, this); _hotKey.OnHotKeyPress += new DelOnWndProc(_hotKey_OnHotKeyPress); _hotKey.Register(); _qrcode.Options.Width = _config.Side; _qrcode.Options.Height = _config.Side; if (_config.ListenClipboard) { if (!_listener.IsListen) { _listener.Listen(); } } else { if (_listener.IsListen) { _listener.StopListen(); } } }
private void MenuItemSwitchListenChecked(object sender, RoutedEventArgs e) { MenuItemClipboardClear.IsEnabled = true; ButtonClipboardClear.IsEnabled = true; ThumbButtonClear.IsEnabled = true; TrayMenuItemClipboardClear.Enabled = true; StatusBarTextBlockTracklingInfo.Text = app.Language.Enable; cl.Listen(); }
public FrmMain() { _wp = new WordPicture(); _wp.Fcolor = Color.Black; _wp.LineAlpha = 200; _wp.Font = new Font("宋体", 12, FontStyle.Bold); _qrcode = new QRCodeUnit(); InitializeComponent(); _config = ConfigSave.ReadConfig(); _toolItems = new ToolStripMenuItem[] { itemFont, itemQRCode, itemQRCodeEncry }; _listener = new ClipboardListener(this.Handle); _listener.OnClipboardWrite += new DelOnWndProc(_listener_OnClipboardWrite); if (_config.ListenClipboard) { _listener.Listen(); } InitSelectItem(); ReSetConfig(); }