Ejemplo n.º 1
0
        public MainForm()
        {
            ClientInfo.ProgramName = "rfidcenter";
            ClientInfo.MainForm    = this;
            Program.Rfid           = _driver;

            InitializeComponent();

            {
                _floatingMessage           = new FloatingMessageForm(this);
                _floatingMessage.AutoHide  = false;
                _floatingMessage.Font      = new System.Drawing.Font(this.Font.FontFamily, this.Font.Size * 2, FontStyle.Bold);
                _floatingMessage.Opacity   = 0.7;
                _floatingMessage.RectColor = Color.Green;
                _floatingMessage.Show(this);
            }

            UsbNotification.RegisterUsbDeviceNotification(this.Handle);
        }
Ejemplo n.º 2
0
        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            m_rfidObj?.BeginCapture(false);

            UsbNotification.UnregisterUsbDeviceNotification();

            _cancelInventory?.Cancel();

            {
                if (this.checkBox_cfg_savePasswordLong.Checked == false)
                {
                    this.textBox_cfg_password.Text = "";
                }
                ClientInfo.Config.Set("global", "ui_state", this.UiState);
                ClientInfo.Config.Set("global", "replication_start", this.textBox_replicationStart.Text);
                ClientInfo.Finish();
            }

            EndChannel();
            EndRemotingServer();

            _driver.ReleaseDriver();
        }