public MainWindow()
        {
            InitializeComponent();
            string dbPath           = "database.db";
            string connectionString = @"Data Source =" + dbPath + ";Version=3;";

            CreateDatabase(dbPath, connectionString);

            _dbConnection = new SQLiteConnection(connectionString);
            _dbConnection.Open();

            RankingModel solo         = new SoloRanking(_dbConnection);
            RankingModel doubles      = new DoublesRanking(_dbConnection);
            RankingModel soloStandard = new SoloStandardRanking(_dbConnection);
            RankingModel standard     = new StandardRanking(_dbConnection);
            var          scoreModel   = new Score();

            var pc = new ProcessController();

            pc.AddMemoryHandler(solo);
            pc.AddMemoryHandler(doubles);
            pc.AddMemoryHandler(soloStandard);
            pc.AddMemoryHandler(standard);
            pc.AddMemoryHandler(scoreModel);

            soloRanking.DataContext         = solo;
            doublesRanking.DataContext      = doubles;
            soloStandardRanking.DataContext = soloStandard;
            standardRanking.DataContext     = standard;
            scores.DataContext      = scoreModel;
            processInfo.DataContext = pc;

            _notifyIcon         = new NotifyIcon();
            _notifyIcon.Icon    = new System.Drawing.Icon("logo.ico");
            _notifyIcon.Visible = true;
            _notifyIcon.Click  +=
                delegate(object sender, EventArgs args)
            {
                this.Show();
                this.WindowState = WindowState.Normal;
            };
            Closing += OnWindowClosing;
        }
        public MainWindow()
        {
            InitializeComponent();
            string dbPath = "database.db";
            string connectionString = @"Data Source =" + dbPath + ";Version=3;";

            CreateDatabase(dbPath, connectionString);

            _dbConnection = new SQLiteConnection(connectionString);
            _dbConnection.Open();

            RankingModel solo = new SoloRanking(_dbConnection);
            RankingModel doubles = new DoublesRanking(_dbConnection);
            RankingModel soloStandard = new SoloStandardRanking(_dbConnection);
            RankingModel standard = new StandardRanking(_dbConnection);
            var scoreModel = new Score();

            var pc = new ProcessController();

            pc.AddMemoryHandler(solo);
            pc.AddMemoryHandler(doubles);
            pc.AddMemoryHandler(soloStandard);
            pc.AddMemoryHandler(standard);
            pc.AddMemoryHandler(scoreModel);

            soloRanking.DataContext = solo;
            doublesRanking.DataContext = doubles;
            soloStandardRanking.DataContext = soloStandard;
            standardRanking.DataContext = standard;
            scores.DataContext = scoreModel;
            processInfo.DataContext = pc;

            _notifyIcon = new NotifyIcon();
            _notifyIcon.Icon = new System.Drawing.Icon("logo.ico");
            _notifyIcon.Visible = true;
            _notifyIcon.Click +=
                delegate (object sender, EventArgs args)
                {
                    this.Show();
                    this.WindowState = WindowState.Normal;
                };
            Closing += OnWindowClosing;
        }