MegaMan.Editor.Controls.ViewModels.AddStageViewModel.AddStage C# (CSharp) Method

AddStage() private method

private AddStage ( object obj ) : void
obj object
return void
        private void AddStage(object obj)
        {
            if (ExistingTileset)
            {
                if (!System.IO.File.Exists(TilesetPath))
                {
                    CustomMessageBox.ShowError("That tileset file does not exist.", "Foild!");
                    return;
                }

                var path = FilePath.FromAbsolute(TilesetPath, _project.Project.BaseDir);
                var tileset = _tilesetFactory.Load(path);
                AddStageToProject(tileset);
            }
            else
            {
                if (!System.IO.File.Exists(TilesheetPath))
                {
                    CustomMessageBox.ShowError("That image file does not exist.", "Foild!");
                    return;
                }

                var tilesetFilePath = _project.FileStructure.CreateTilesetPath(Name);
                var tileset = _tilesetFactory.CreateNew(tilesetFilePath);
                tileset.Tileset.ChangeSheetPath(TilesheetPath);
                AddStageToProject(tileset);
            }
        }