private void ComboRange_SelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBox box = (ComboBox)sender; if (box.SelectedIndex == 2 && isInit) { FriendSelectWindow friendSelectWindow = new FriendSelectWindow((ids, names) => { trust_ids.Clear(); if (ids.Count == 0) { MessageBox.Show("편한 친구를 선택해주세요."); box.SelectedIndex = 1; } else { foreach (string id in ids) { trust_ids.Add(id); } } }, false) { Title = "편한 친구 선택", Owner = this }; FriendSelectWindow fsw = friendSelectWindow; fsw.ShowDialog(); } }
private void BT_Friends_Click(object sender, RoutedEventArgs e) { FriendSelectWindow fsw = new FriendSelectWindow((ids, names) => { if (ids.Count > 0) { reciver = ids.First(); AddTarget(ids.First(), names.First()); } }, false) { Title = "쪽지 받는 친구 선택", Owner = this }; fsw.ShowDialog(); }
private void BT_WithFriend_Click(object sender, RoutedEventArgs e) { FriendSelectWindow fsw = new FriendSelectWindow((ids, names) => { with_ids.Clear(); foreach (string id in ids) { with_ids.Add(id); } }, false) { Title = "필독 친구 선택", Owner = this }; fsw.ShowDialog(); }
public FriendSelectWindow(Action <List <string>, List <string> > listener, bool isFriendList) { InitializeComponent(); this.listener = listener; instance = this; if (Properties.Settings.Default.HideScrollBar) { SV_Content.VerticalScrollBarVisibility = ScrollBarVisibility.Hidden; } if (isFriendList) { Title = "친구 목록"; RD_Submit.Height = new GridLength(0); RD_WithFriends.Height = new GridLength(0); } this.isFriendList = isFriendList; Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.ContextIdle, new Action(() => TB_Search.Focus())); }
private void BT_Friends_Click(object sender, RoutedEventArgs e) { if (IsLoggedIn && !IsOffline) { if (FriendListWindow == null) { FriendListWindow = new FriendSelectWindow(null, true); FriendListWindow.BT_Submit.Visibility = Visibility.Collapsed; FriendListWindow.RD_Submit.Height = new GridLength(0); FriendListWindow.Show(); //friendListWindow.Activate(); } else { FriendListWindow.Show(); FriendListWindow.Activate(); } } else { GlobalHelper.ShowOfflineMessage(); } }
private void BT_QuoteFriend_Click(object sender, RoutedEventArgs e) { FriendSelectWindow fsc = new FriendSelectWindow((ids, names) => { for (int i = 0; i < ids.Count; i++) { string append = "{!{{" + "\"id\":\"" + ids[i] + "\", \"type\":\"profile\", \"text\":\"" + names[i] + "\"}}!} "; if (i + 1 < ids.Count) { append += ", "; } int lastPos = TB_Main.CaretIndex; TB_Main.Text = TB_Main.Text.Insert(TB_Main.CaretIndex, append); TB_Main.CaretIndex = lastPos + append.Length; Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.ContextIdle, new Action(() => TB_Main.Focus())); } }, false) { Owner = this }; fsc.ShowDialog(); }