private void treeView1_TypeSelected(object sender, EventArgs e) { btOK.Enabled = false; EventArgObjectSelected e0 = e as EventArgObjectSelected; if (e0 != null) { RetType = e0.SelectedObject as Type; btOK.Enabled = (RetType != null); } }
private void treeView1_TypeSelected(object sender, EventArgs e) { btOK.Enabled = false; SelectedType = null; EventArgObjectSelected os = e as EventArgObjectSelected; if (os != null) { if (os.SelectedObject != null) { Type t = os.SelectedObject as Type; if (t != null) { if (_baseType == null || _baseType.IsAssignableFrom(t)) { SelectedType = t; btOK.Enabled = true; } } } } }