Пример #1
0
 /// <summary>
 /// Creates all required directories if they don't already exist.
 /// </summary>
 public void CreateDirectories()
 {
     FileOpener.CreateDirectory("\\configuration");
     FileOpener.CreateDirectory("\\configuration\\odometers");
     FileOpener.CreateDirectory("\\configuration\\screens");
     FileOpener.CreateDirectory("\\configuration\\tankminders");
     FileOpener.CreateDirectory("\\history_files");
     FileOpener.CreateDirectory("\\engines");
     FileOpener.CreateDirectory("\\logs");
     FileOpener.CreateDirectory("\\audio");
     if (!FileOpener.DirectoryExists("\\rawlogs"))
     {
         FileOpener.CreateDirectory("\\rawlogs");
         FileOpener.WriteAllText("\\rawlogs\\j1708_demo.vms", FileSaveDefaults.DefaultRawLog.GetDefaultRawLog);
     }
     else
     {
         FileOpener.CreateDirectory("\\rawlogs");
     }
 }
Пример #2
0
 public void VerifyEngineDirectory()
 {
     if (FileOpener.IsDirectoryEmpty("\\engines"))
     {
         bool downloadEngines = MessageBox.Show(
             "No engine files are available. Do you want VMSpc to automatically download them now (requires internet connection)?",
             "No Engine Files",
             MessageBoxButton.YesNo,
             MessageBoxImage.Question
             ) == MessageBoxResult.Yes;
         if (downloadEngines)
         {
             if (EngineDownloader.DownloadEngines())
             {
                 MessageBox.Show("Successfully downloaded Engines");
             }
             else
             {
                 MessageBox.Show("Failed to download Engines. Verify that you have internet connection.");
             }
         }
     }
 }