Exemple #1
0
 private void Save_Click(object sender, RoutedEventArgs e)
 {
     PathReader.SavePathToRegistry(PathType, PathReader.ItemsToPathString(Items));
     if (PathType == PathType.User)
     {
         PathReader.SavePathToRegistry(PathType, PathReader.ItemsToPathString(Items));
     }
     else
     {
         BatchMode.UseBatchModeAsAdmin(Items);
     }
     DisabledItems.SaveDisabledItems(PathType, Items);
     PathBox.Focus();
 }
Exemple #2
0
 public static void SavePathFromTempFile()
 {
     try
     {
         var fullPath = Path.Combine(AppDataPath.AppDataDirPath, TempFileName);
         var file     = new StreamReader(fullPath);
         var path     = file.ReadToEnd();
         PathReader.SavePathToRegistry(PathType.System, path);
         file.Close();
     }
     catch
     {
         MessageBox.Show("Непредвиденная ошибка PATH.");
     }
     finally
     {
         File.Delete(TempFileName);
     }
 }