private void _SetListBoxSource() { List <string> userList; if (mode == AddMemberMode.OnMemoReceived) // 전체 { userList = new List <string>(Members.GetMembers().Keys); } else //로그인사용자만 { userList = new List <string>(Members.GetLoginUsers().Keys); } foreach (string user in userList) { MemberObj userObj = Members.GetByUserId(user); if (userObj == null || userObj.Id == "") { continue; } ListBoxItem item = new ListBoxItem(userObj); if (ListBox.NoMatches == ListBoxSelected.FindStringExact(item.Text)) { ListBoxSource.Items.Add(item); } } }
/// <summary> /// 쪽지 수신자 추가 폼에서 "전체" 라디오 버튼 클릭시 /// </summary> private void _DisplayAllMembers() { try { SetTeamMode(false); ListBoxSource.Items.Clear(); Dictionary <string, MemberObj> membersAll = Members.GetMembers(); foreach (var de in membersAll) { if (de.Value != null) { ListBoxItem item = new ListBoxItem(de.Value); if (ListBox.NoMatches == ListBoxSelected.FindStringExact(item.Text)) { ListBoxSource.Items.Add(item); } } } } catch (Exception exception) { Logger.error(exception.ToString()); } }
private void Initialize(List <string> unReaderList) { foreach (var pair in Members.GetMembers()) { string receiver = ((MemberObj)pair.Value).Name + "(" + pair.Key.ToString() + ")"; ListViewItem ditem = listView1.Items.Add(pair.Key.ToString(), receiver, null); if (unReaderList.Contains(pair.Key.ToString())) { ditem.ForeColor = Color.Red; ditem.SubItems.Add("확인안함"); } else { ditem.ForeColor = Color.Blue; ditem.SubItems.Add("읽음"); } } }