예제 #1
0
        public MainForm()
        {
            InitializeComponent();

            this.finder = new SpotifyFinder();
            this.logic = new TrackerLogic(this, this.finder);
            this.statsHelper = new StatisticsHelper(this, this.finder);
            this.closing = false;
            this.thread = new Thread(delegate() {
                while (!this.closing)
                {
                    if (this.IsDisposed || this.Disposing)
                    {
                        break;
                    }

                    MethodInvoker mi = delegate() { this.MainLoop(); };
                    if (this.IsHandleCreated && this.InvokeRequired)
                    {
                        try
                        {
                            this.Invoke(mi); // Still bugs when closing right during invoke.
                        }
                        catch (Exception)
                        {
                        }
                    }

                    Thread.Sleep(100);
                }
            });
            this.thread.Start();

            this.FillHistory();
        }
        public TrackerLogic(MainForm form, SpotifyFinder finder)
        {
            this.form = form;
            this.finder = finder;

            this.paused = false;
        }
 public StatisticsHelper(MainForm form, SpotifyFinder finder)
 {
     this.form = form;
     this.finder = finder;
 }