private void SetGroupItemAction(object sender, System.Timers.ElapsedEventArgs e) { for (int i = 0; i < groupList.Count; i++) { Thread.Sleep(100); this.Dispatcher.Invoke(DispatcherPriority.Send, new Action( delegate { var item = GroupInfoItem.GroupToUserInfoItem(groupList[i]); this.SL_GroupList.AddItem(item); })); } }
public GroupInfoItem GetParent(string id) { GroupInfoItem parent = null; GroupInfoItem item = Get(id); if (item != null) { var p = Items.FirstOrDefault(e => e.ParentID == item.GroupCode); if (p != null) { parent = p; } } return(parent); }
public void ShowResult(bool result, Object resultUI) { this.SP_Result.Children.Clear(); if (result == false) { TextBlock textBlock = new TextBlock(); textBlock.Text = "未找到"; this.SP_Result.Children.Add(textBlock); } else { this.current = resultUI; if (resultUI.GetType() == typeof(User)) { this.SP_Result.Children.Add(UserInfoItem.GotyeUserToUserInfoItem(resultUI as User)); } else { this.SP_Result.Children.Add(GroupInfoItem.GroupToUserInfoItem(resultUI as Group)); } } }
public void AddNewGroup(Group group) { var item = GroupInfoItem.GroupToUserInfoItem(group); this.SL_GroupList.AddItem(item); }