Paint.AppDelegate.EditImage C# (CSharp) Method

EditImage() private method

Edits a specific image.
private EditImage ( Guid pictureId, ImageStateData imageStateData = null ) : void
pictureId Guid /// Unique ID referencing the specific image we want to edit ///
imageStateData ImageStateData /// Image state data for this image - if null then it will be read from disk (so should not be null for new images) ///
return void
        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();
        }