public void Remove(MastodonConnection connection) { if (this.Activated == connection) { this.Activated = null; } this._connections.Remove(connection); }
/// <summary> /// 新しい接続をグループに追加しようとする /// </summary> /// <param name="connection"></param> /// <returns>グループへの追加が成功したらtrue。何らかの理由で失敗すればfalse</returns> public bool TryAdd(MastodonConnection connection) { if (this._connections.Count >= MaxConnectionCount) { return(false); } this._connections.Add(connection); if (this._connections.Count == 1) { this.Activated = connection; } return(true); }