//initial the server value public ViewServerInfo(String serverName, MemberInServer members, String bossInfo) { InitializeComponent(); memberInServer = members; this.bossInfo = bossInfo; this.serverName = serverName; }
//View the detail of selected server private void btn_Server_View_Click(object sender, RoutedEventArgs e) { int index = lvServerState.SelectedIndex; try { if (index != -1) { String serverName = serverList.Keys.ElementAt(index); List <String> bossInfo = m_DGBiz.GetBossInfoList(); ServerInfo serverInfo = new ServerInfo(); serverInfo = m_DGBiz.GetServerInfo(); MemberInServer memberInServer = serverInfo.serverInfoList[index]; ViewServerInfo viewServerInfo = new ViewServerInfo(serverName, memberInServer, bossInfo[index]); viewServerInfo.ShowDialog(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }