Example #1
0
        protected static void InsertRecordAsync(DbObserverForm form, DbClientFileInfo info)
        {
            if (form.IsDisposed)
            {
                return;
            }

            form.InvokeSafe(new Action <DbClientFileInfo>((i) =>
            {
                Image voucher = i.VoucherImage.ToImage();
                Image barcode = i.BarCodeImage.ToImage();

                form.dgvData.Rows.Insert(0, i.RetailerID, i.RetailerID, i.VoucherID);
                form.dgvData.Rows[0].Tag = i;
                form.SetCurrent(0);
            }), info);
        }
Example #2
0
        public static void Start()
        {
            //Start once
            if (ms_Thread != null)
            {
                return;
            }

            ms_Thread = new Thread(() =>
            {
                DbObserverForm form = new DbObserverForm();
                ms_This             = form.Handle;
                Application.Run(form);
                ms_Thread = null;
                ms_This   = IntPtr.Zero;
            })
            {
                IsBackground = true
            };
            ms_Thread.Start();
        }