コード例 #1
0
        public ParameterEditorView(ParameterEditorViewModel viewModel)
        {
            _viewModel = Arguments.ValidateNotNull(viewModel, "viewModel");

            InitializeComponent();

            this.DataContext = _viewModel;

            _viewModel.ParameterEditingFinished += OnParameterEditingFinished;
        }
コード例 #2
0
        private static bool?ShowParameterEditor(ParamBlockAst paramBlockAst, out string scriptArgs)
        {
            scriptArgs = String.Empty;
            var model     = PowerShellParseUtilities.ParseParameters(paramBlockAst);
            var viewModel = new ParameterEditorViewModel(model);
            var view      = new ParameterEditorView(viewModel);

            bool?wasOkClicked = view.ShowModal();

            if (wasOkClicked != true)
            {
                return(wasOkClicked);
            }

            scriptArgs = GenerateScripArgsFromModel(model);
            return(wasOkClicked);
        }