private void OKButton_Click(object sender, System.EventArgs e) { if (RestrictionRadioButton.Checked) { UPnPComplexType.Restriction r = new UPnPComplexType.Restriction(); r.PATTERN = PatternTextBox.Text; r.baseType = BaseComboBox.SelectedItem.ToString(); if (BaseComboBox.SelectedItem.GetType() == typeof(UPnPComplexType)) { r.baseTypeNS = ((UPnPComplexType)BaseComboBox.SelectedItem).Name_NAMESPACE; } re = r; } else { UPnPComplexType.Extension ex = new UPnPComplexType.Extension(); ex.baseType = BaseComboBox.SelectedItem.ToString(); if (BaseComboBox.SelectedItem.GetType() == typeof(UPnPComplexType)) { ex.baseTypeNS = ((UPnPComplexType)BaseComboBox.SelectedItem).Name_NAMESPACE; } re = ex; } DialogResult = DialogResult.OK; }
private void OKButton_Click(object sender, System.EventArgs e) { if(RestrictionRadioButton.Checked) { UPnPComplexType.Restriction r = new UPnPComplexType.Restriction(); r.PATTERN = PatternTextBox.Text; r.baseType = BaseComboBox.SelectedItem.ToString(); if(BaseComboBox.SelectedItem.GetType()==typeof(UPnPComplexType)) { r.baseTypeNS = ((UPnPComplexType)BaseComboBox.SelectedItem).Name_NAMESPACE; } re = r; } else { UPnPComplexType.Extension ex = new UPnPComplexType.Extension(); ex.baseType = BaseComboBox.SelectedItem.ToString(); if(BaseComboBox.SelectedItem.GetType()==typeof(UPnPComplexType)) { ex.baseTypeNS = ((UPnPComplexType)BaseComboBox.SelectedItem).Name_NAMESPACE; } re = ex; } DialogResult = DialogResult.OK; }