/// <summary> /// Called once the 'paint app' has exited. /// </summary> /// <param name='sender'>Sender</param> /// <param name='e'>Any relevant event args </param> private void PaintAppExiting(object sender, EventArgs e) { if (this.paintApp != null) { this.paintApp.Exiting -= PaintAppExiting; this.paintApp.Dispose(); this.paintApp = null; } this.BackToHomeScreenAfterEdit(); }
/// <summary> /// Edits a specific image. /// </summary> /// <param name='pictureId'> /// Unique ID referencing the specific image we want to edit /// </param> /// <param name='imageStateData'> /// Image state data for this image - if null then it will be read from disk (so should not be null for new images) /// </param> private void EditImage(Guid pictureId, ImageStateData imageStateData = null) { var filenameResolver = this.CreateFilenameResolver(pictureId); var pictureIOManager = new PictureIOManager(filenameResolver); pictureIOManager.CreateDirectoryStructure(); if (imageStateData == null) { imageStateData = pictureIOManager.LoadImageStateData(); } this.SetOrientationForImage(imageStateData); BusyMessageDisplay busyMessageDisplay = new BusyMessageDisplay("Saving", "Please wait..."); // Simply instantiate the class derived from monogame:game and away we go... ToolboxLayoutDefinition layoutDefinition = imageStateData.Width > imageStateData.Height ? this.toolboxLayoutManager.PaintLandscapeToolboxLayout : this.toolboxLayoutManager.PaintPortraitToolboxLayout; this.paintApp = new PaintApp(pictureIOManager, filenameResolver, imageStateData, busyMessageDisplay, layoutDefinition, this.deviceScale); this.paintApp.Exiting += PaintAppExiting; this.paintApp.Run(); }