/// <summary> /// 将一个数据库相应的Button变为焦点状态 /// </summary> /// <param name="enumDBTypeStr">数据库类型的文本</param> /// <param name="lDBID">数据库ID</param> public void SelectButton(DevComponents.AdvTree.Node treenode) { Exception ex = null; try { //cyf 20110627 modify //enumInterDBType DataBaseTpe = GetDBType(enumDBTypeStr, out ex); if (ex != null) return; if (treenode.Level == 2) { XmlElement DbInfoEle = treenode.Tag as XmlElement; string enumDBTypeStr = DbInfoEle.GetAttribute("数据库类型"); if (string.IsNullOrEmpty(enumDBTypeStr)) { return; } if (m_DBButtons.ContainsKey(enumDBTypeStr)) { List <DevComponents.DotNetBar.ButtonX> Getbuttons = new List <DevComponents.DotNetBar.ButtonX>(); m_DBButtons.TryGetValue(enumDBTypeStr, out Getbuttons); if (Getbuttons == null) { return; } foreach (DevComponents.DotNetBar.ButtonX Getbutton in Getbuttons) { if (Getbutton.Tag == null) { continue; } ClsDataBaseProject ClsDataBase = Getbutton.Tag as ClsDataBaseProject; if (ClsDataBase == null) { continue; } if (ClsDataBase.lDBID == (long)treenode.DataKey) { Getbutton.Focus(); break; } } } } Refurbish(treenode); //end } catch { } }
/// <summary> /// 将一个数据库相应的Button变为焦点状态 /// </summary> /// <param name="enumDBTypeStr">数据库类型的文本</param> /// <param name="lDBID">数据库ID</param> public void SelectButton(string enumDBTypeStr, long lDBID) { Exception ex = null; try { //cyf 20110627 modify //enumInterDBType DataBaseTpe = GetDBType(enumDBTypeStr, out ex); if (ex != null) return; if (m_DBButtons.ContainsKey(enumDBTypeStr)) { List <DevComponents.DotNetBar.ButtonX> Getbuttons = new List <DevComponents.DotNetBar.ButtonX>(); m_DBButtons.TryGetValue(enumDBTypeStr, out Getbuttons); if (Getbuttons == null) { return; } foreach (DevComponents.DotNetBar.ButtonX Getbutton in Getbuttons) { if (Getbutton.Tag == null) { continue; } ClsDataBaseProject ClsDataBase = Getbutton.Tag as ClsDataBaseProject; if (ClsDataBase == null) { continue; } if (ClsDataBase.lDBID == lDBID) { Getbutton.Focus(); break; } } } //end } catch { } }