public WorldVariableViewModel ShowEditView(IWin32Window owner, WorldVariableViewModel viewModel) { owner.ThrowIfNull(nameof(owner)); viewModel.ThrowIfNull(nameof(viewModel)); return(View.ShowView(owner, viewModel, EditMode.Edit) == DialogResult.OK ? viewModel : null); }
public DialogResult ShowView(IWin32Window owner, WorldVariableViewModel viewModel, EditMode editMode) { owner.ThrowIfNull(nameof(owner)); _viewModel = viewModel.EnsureNotNull(nameof(viewModel)); Text = $"{(editMode == EditMode.New ? "New" : "Edit")} Variable"; return(ShowDialog(owner)); }
public WorldVariableViewModel ShowNewView(IWin32Window owner, WorldVariableViewModel viewModel = null, string category = null) { owner.ThrowIfNull(nameof(owner)); viewModel = viewModel ?? new WorldVariableViewModel { Category = category, Type = WorldVariableType.String }; return(View.ShowView(owner, viewModel, EditMode.New) == DialogResult.OK ? viewModel : null); }