コード例 #1
0
        private void btn_EditTestParameter_Click(object sender, RoutedEventArgs e)
        {
            TestParameterViewModel pCurrentSelection = lst_TestParameters.SelectedItem as TestParameterViewModel;

            if (pCurrentSelection == null)
            {
                MessageBox.Show("Please select a TestParameter from the list for editing", "No selection", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                AddEditTestParamDialog pDialog = new AddEditTestParamDialog();
                pDialog.SetData(pCurrentSelection);

                bool?bResult = pDialog.ShowDialog();

                if (bResult.HasValue && bResult.Value)
                {
                    if (EditTestParameter != null)
                    {
                        EditTestParameter(this, new TestParameterArgs {
                            TestParams = pDialog.Data
                        });
                    }
                }
            }
        }
コード例 #2
0
        private void __pView_AddNewTestParameters(object sender, EventArgs e)
        {
            AddEditTestParamDialog pDialog = new AddEditTestParamDialog();

            bool?bResult = pDialog.ShowDialog();

            if (bResult.HasValue && bResult.Value)
            {
                try {
                    TestParameterViewModel pData = pDialog.Data;

                    long nNewID = __pServiceProxy.AddTestParameter(pData);

                    if (nNewID > 0)
                    {
                        pData.ID = nNewID;
                        __pParamModels.Add(pData);
                    }
                }
                catch (Exception ex) {
                    //todo: Add logging
                }
            }
        }