public void FavoriteSelecteds() { var accounts = CurrentAccounts .Select(Setting.Accounts.Get) .Where(a => a != null) .ToArray(); if (accounts.Length == 0) { this.Messenger.RaiseSafe(() => new TaskDialogMessage(new TaskDialogOptions { Title = MainAreaTimelineResources.MsgQuickActionFailedTitle, MainIcon = VistaTaskDialogIcon.Error, MainInstruction = MainAreaTimelineResources.MsgFavoriteFailedInst, Content = MainAreaTimelineResources.MsgQuickActionAccountIsNotSelected, CommonButtons = TaskDialogCommonButtons.Close, })); return; } SelectedStatuses .Where(s => s.CanFavorite && !s.IsFavorited) .ForEach(s => s.Favorite(accounts, true)); DeselectAll(); }
public ClientConnection(Socket socket) : base(socket) { Log.Info("Client IP: {0} connected", this); this.DisconnectedEvent += this.ClientConnection_DisconnectedEvent; this.m_LittleEndian = true; //init session = LocalCommons.Cookie.Cookie.Generate(); //byte[] key = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00 }; Account nCurrent = new Account { //EncryptKey = key, Connection = this, Session = session, isLogin = false }; CurrentAccount = nCurrent; CurrentAccounts.TryAdd(session, CurrentAccount); //this.SendAsync(new Net_OnConnection()); //this.SendAsync(new Net_OnConnection2()); nCurrent = null; //key = null; //NormalRoom room = new NormalRoom(); //room.setID(1000); //Rooms.AddRoom(room.ID, room); }
public void FavoriteSelecteds() { var accounts = CurrentAccounts .Select(Setting.Accounts.Get) .Where(a => a != null) .ToArray(); if (accounts.Length == 0) { var msg = new TaskDialogMessage(new TaskDialogOptions { Title = "クイックアクション エラー", MainIcon = VistaTaskDialogIcon.Error, MainInstruction = "ツイートをお気に入り登録できません。", Content = "アカウントが選択されていません。", CommonButtons = TaskDialogCommonButtons.Close, }); this.Messenger.Raise(msg); return; } SelectedStatuses .Where(s => s.CanFavorite && !s.IsFavorited) .ForEach(s => s.Favorite(accounts, true)); DeselectAll(); }
public void ReplySelecteds() { var users = SelectedStatuses .Select(s => "@" + s.User.ScreenName) .Distinct() .JoinString(" "); var accs = CurrentAccounts.Select(id => Setting.Accounts.Get(id)) .Where(a => a != null) .ToArray(); InputModel.InputCore.SetText(InputSetting.Create(accs, users + " ")); DeselectAll(); }
void ClientConnection_DisconnectedEvent(object sender, EventArgs e) { //remove user try { if (CurrentAccounts.ContainsKey(CurrentAccount.NickName)) { CurrentAccounts.TryRemove(CurrentAccount.NickName, out _); } } catch { Log.Warning("Client IP: {0} disconnected,But the remove fail", this); } Log.Info("Client IP: {0} disconnected", this); this.Dispose(); }
void ClientConnection_DisconnectedEvent(object sender, EventArgs e) { //remove user try { if (CurrentAccounts.TryRemove(session, out var account) && account.isLogin) { GameRoomHandle.LeaveRoom(CurrentAccount); //GameRoomEvent.LeaveRoom(this, true, 0x1); //HandleLogout(this.CurrentAccount); } } catch { Log.Warning("Client IP: {0} disconnected,But the remove fail", this); } Log.Info("Client IP: {0} disconnected", this); this.Dispose(); }
private void UpdateGrouping() { CurrentAccounts.Refresh(); }