private void Main_Load(object sender, EventArgs e) { ShellPrefix.SelectedIndex = 0; tracker = Tracker.New(x => { var split = x.Split(new string[] { "#unique=" }, StringSplitOptions.RemoveEmptyEntries); if (split.Length == 2) { ShellPrefix.Invoke(new MethodInvoker(() => { var unique = "#" + split[1]; foreach (var item in ShellPrefix.Items) { if (item.ToString() == unique) return; } ShellPrefix.Items.Add(unique); })); } }, track: ShellPrefix.SelectedItem.ToString(), log: null); }
public static Tracker New(Action<string> statusHandler, string track = null, TextWriter log = null) { var t = new Tracker(statusHandler, log); t.Start(track); return t; }