예제 #1
0
 public void Load(string fileName)
 {
     this.Unload();
     if (!string.IsNullOrWhiteSpace(fileName))
     { // try to load the file
         this.CurrentlyOpenFileName = fileName;
         try
         {
             this.stashContainer = StashContainer.LoadFromFile(fileName, logger);
         }
         catch (Exception ex)
         {
             MessageBox.Show($"Could not load file \"{fileName}\": \r\n{ex.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
         }
     }
     else
     {
         this.stashContainer        = new StashContainer();
         this.CurrentlyOpenFileName = null;
     }
 }
예제 #2
0
 /// <summary>
 /// Loads the stash container from a file
 /// </summary>
 /// <param name="fileName">Name of the file to load</param>
 public void Load(string fileName)
 {
     this.Container = StashContainer.LoadFromFile(fileName, this.logger);
     this.FileName  = fileName;
 }