Ejemplo n.º 1
0
 public Form1()
 {
     soundDirectory = new SoundDirectory();
     InitializeComponent();
     initializeJson();
     if (soundDirectory.soundDir == "")
     {
         getSoundDirectory();
     }
     if (soundDirectory.soundDir != "")
     {
         getFiles();
     }
     assignDevices();
 }
Ejemplo n.º 2
0
 private void initializeJson()
 {
     try
     {
         soundDirectory = JsonConvert.DeserializeObject <SoundDirectory>(File.ReadAllText(Convert.ToBase64String(Properties.Resources.soundDirect))); // Convert.ToBase64String(Properties.Resources.soundDirect))
     }
     catch (FileNotFoundException e)
     {
         MessageBox.Show("No memory file detected, generating one..");
         soundDirectory = new SoundDirectory();
         saveSettings();
     }
     catch (JsonReaderException e)
     {
         MessageBox.Show("Corrupt Memory File");
         File.Delete(File.ReadAllText(Convert.ToBase64String(Properties.Resources.soundDirect)));
         this.Close();
     }
 }