Exemple #1
0
        // ----------------------------------------------------------
        public Context()
        {
            database = new Database.Connection();
            Application.ApplicationExit += new EventHandler(this.OnApplicationExit);

            logging = new Logger.Logging();

            settingsForm = new UI.DBDialog(database);
            settingsForm.Closed += new EventHandler(this.settingsForm_Closed);
            settingsForm.Show();
        }
        public ClientForm(Database.Connection db, ClientSettings s, BarCode.ReaderControl r, Logger.Logging l, int inactTime)
            : base(db)
        {
            userObjects = new Dictionary<String, UserObject>();
            settings = s;
            RC = r;
            logger = l;
            if (inactTime > 0)
            {
                inactivityTimer = new Timer();
                inactivityTimer.Tick += new EventHandler(inactivityTimer_Tick);
                inactivityTimer.Interval = inactTime;
            }

            InitializeComponent();
            if (RC != null || disableScanner)
            {
                RC.BarCodeObject.BarCodeEvent += new EventHandler<BarCode.BarCodeEventArgs>(HandleBarCodeEvent);
            }
        }