Exemplo n.º 1
0
        public PlaytimeTrackingHandler(MainWindow window)
        {
            LoggingHandler.Log("Starting Playtime Logging Handler");

            this.window  = window;
            FilePath     = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FRESHMusicPlayer", "Tracking");
            TrackingFile = Read();

            window.Player.SongChanged += Player_SongChanged;
        }
        public PlaytimeTrackingHandler(MainWindow window)
        {
            LoggingHandler.Log("Starting Playtime Logging Handler");

            this.window  = window;
            FilePath     = Path.Combine(App.DataFolderLocation, "Tracking");
            TrackingFile = Read();

            window.Player.SongChanged += Player_SongChanged;
        }
Exemplo n.º 3
0
 private void Write(TrackingFile trackingFile)
 {
     if (!Directory.Exists(FilePath))
     {
         Directory.CreateDirectory(FilePath);
     }
     using (StreamWriter file = File.CreateText(Path.Combine(FilePath, "tracking.json")))
     {
         new JsonSerializer().Serialize(file, trackingFile);
     }
 }