Esempio n. 1
0
 public PlaytimeLoggingIntegration(Player player)
 {
     this.player         = player;
     player.SongChanged += Player_SongChanged;
     filePath            = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FRESHMusicPlayer", "Tracking");
     trackingFile        = Read();
     LoggingHandler.Log("Playtime Logging: Starting!");
 }
Esempio n. 2
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);
     }
 }