예제 #1
0
        protected override void DoImplementation(string from, string to)
        {
            try
            {
                this.CommandsInput.SetBusy(true);
                try
                {
                    if (!Corner2CornerProjectPersistence.Load(to, this.Project))
                    {
                        this.Project.Clear();

                        var bytes = File.ReadAllBytes(to);
                        this.Project.Image = Image.FromStream(new MemoryStream(bytes));
                    }
                }
                finally
                {
                    this.CommandsInput.SetBusy(false);
                }
            }
            catch
            {
                this.CommandsInput.ShowMessage($"Could not load file {to}");
            }
        }
예제 #2
0
 protected override void DoImplementation(string from, string to)
 {
     try
     {
         this.CommandsInput.SetBusy(true);
         try
         {
             Corner2CornerProjectPersistence.Save(to, this.Project);
         }
         finally
         {
             this.CommandsInput.SetBusy(false);
         }
     }
     catch (Exception e)
     {
         this.CommandsInput.ShowMessage($"Could not save file: {e.Message}");
     }
 }