Пример #1
0
        private void FindProductsTaskCompleted(Task task)
        {
            DGrid_FoundProducts.Invoke(new Action(() =>
            {
                if (task.IsFaulted)
                {
                    Rtbx_DebugLog.Invoke((MethodInvoker) delegate
                    {
                        if (Rtbx_DebugLog.Text.Length > Logger.MaxLogMesssages)
                        {
                            Rtbx_DebugLog.Clear();
                        }
                    });

                    Rtbx_DebugLog.AppendText(task.Exception?.StackTrace + Environment.NewLine);
                    label_FindingStatus.Text      = @"Some Errors!";
                    label_FindingStatus.ForeColor = Color.Red;
                }
                else
                {
                    label_FindingStatus.Text      = @"Done!";
                    label_FindingStatus.ForeColor = Color.DarkGreen;
                }

                btn_FindProducts.Enabled = true;
            }));
        }
Пример #2
0
 private void Btn_ClearAllLogs_Click(object sender, EventArgs e)
 {
     Rtbx_EventLog.Clear();
     Rtbx_DebugLog.Clear();
 }