public TestPropertiesEditorDialog(TestPropertyCollection testProperties) { m_testProperties = testProperties; InitializeComponent(); InitializeDataSet(); }
private void m_btnOK_Click(object sender, EventArgs e) { //TestPropertyCollection properties = new TestPropertyCollection(); m_testProperties = new TestPropertyCollection(); foreach (DataRow row in m_dataTable.Rows) { //m_testProperties.Add((string)row[0], row[1]); } }
/// <summary> /// Displays test parameters dialog for edit from properties window. /// </summary> /// <param name="context"></param> /// <param name="provider"></param> /// <param name="value"></param> /// <returns></returns> public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { IWindowsFormsEditorService wfservice = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService; PropertyGrid grid = provider.GetType().GetProperty("OwnerGrid").GetGetMethod().Invoke(provider, null) as PropertyGrid; TestPropertyCollection testProperties = value as TestPropertyCollection; TestPropertiesEditorDialog dialog = new TestPropertiesEditorDialog((TestPropertyCollection)value); DialogResult result = wfservice.ShowDialog(dialog); if (result == DialogResult.OK) { testProperties = dialog.TestProperties; } return(testProperties); }
private TestPropertyCollection collectTestProperties() { var testProperties = new TestPropertyCollection(); foreach (DataGridViewRow row in m_testPropertiesDataGridView.Rows) { var testProperty = row.Tag as TestProperty; if (!string.IsNullOrEmpty(testProperty.Name)) { testProperties.Add(testProperty); } else { throw new TestPropertyEditorException(row.Index, NameColumn, "A test property name must be specified."); } } return(testProperties); }
private TestPropertyCollection collectTestPropertiesFromGrid(bool includeOverrides) { var testProperties = new TestPropertyCollection(); foreach (DataGridViewRow row in m_testPropertiesDataGridView.Rows) { var testProperty = row.Tag as TestProperty; if (!testProperty.Overridden || includeOverrides) { testProperties.Add(testProperty); } else if (testProperty.OverriddenValue != null) { testProperty.Value = testProperty.OverriddenValue; testProperty.Description = testProperty.OverriddenDescription; testProperties.Add(testProperty); } } return(testProperties); }
private void TestPropertiesGlobalEditor_FormClosing(object sender, FormClosingEventArgs e) { TestPropertyCollection collection = TestProperties.TestPropertyCollection; }