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(); }
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(); }