private void Compare_Click(object sender, EventArgs e) { int[] prodict1_ids = (from x in Product1Ids.Text.Split('\n') where !string.IsNullOrWhiteSpace(x) select int.Parse(x)).ToArray(); if (Company2.SelectedItem == null) { MessageBox.Show("Company2 is not chosen."); return; } this.Cursor = Cursors.WaitCursor; if (t != null && t.IsAlive) { t.Abort(); } t = new Thread(() => { try { List <ProductLink> pls = engine.CreateProductLinkList(prodict1_ids, ((Item)Company2.SelectedItem).Value); } catch (Exception ex) { Message.Error(ex); } ControlRoutines.BeginInvoke(This, () => { this.Cursor = Cursors.Default; }); }); t.Start(); }
public static void ReplaceMessage(string m, int line_number2remove = 1) { ControlRoutines.BeginInvoke(This, () => { This.console.Text = Regex.Replace(This.console.Text, @"^((?:.*\n)*?)(?:.*\n){0," + line_number2remove + "}$", @"$1", RegexOptions.RightToLeft); This.console.Text += m + "\r\n"; }); }
public static void AddMessage(string m) { ControlRoutines.BeginInvoke(This, () => { This.console.Text += m + "\r\n"; }); }