public void userDictHandler() { if (user_dictionary.Count > 0) { user_dictionary.Clear(); } foreach (Record r in record_list) { user_dictionary.Add(r.UserName, r.LocCode); } SCMClient.sendDict(user_dictionary); }
void cellSelected(object sender, DataGridViewCellEventArgs e) { if (!clickCoolDown) { clickCoolDown = true; coolDownTimer = new System.Timers.Timer(1000); coolDownTimer.Elapsed += resetCoolDown; coolDownTimer.AutoReset = false; coolDownTimer.Enabled = true; try { var rowClicked = dataGridView.Rows[e.RowIndex]; var record = rowClicked.DataBoundItem as Record; if (record.APInteracted) { RemoveRecord(record); RemoveHelpRecord(record); new Thread(() => { Thread.CurrentThread.IsBackground = true; SCMClient.sendCancel(record); }).Start(); } else { record.APInteracted = true; record.APName = Environment.UserName.ToUpper(); record.APInteractTime = DateTime.Now; new Thread(() => { Thread.CurrentThread.IsBackground = true; SCMClient.sendAPI(record); }).Start(); } } catch { } } }
static void Main() { //SCMClient client = new SCMClient(); SCMClient.SCMTimer.Elapsed += SCMClient.checkConnected; SCMClient.SCMTimer.Interval = 60000; SCMClient.SCMTimer.Enabled = true; Thread thread = new Thread(SCMClient.connect); thread.IsBackground = true; thread.Start(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Form1 form = new Form1(); SCMClient.setform(form); Application.Run(form); }