コード例 #1
0
        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);
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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);
        }