Exemplo n.º 1
0
 public void Remove(MastodonConnection connection)
 {
     if (this.Activated == connection)
     {
         this.Activated = null;
     }
     this._connections.Remove(connection);
 }
Exemplo n.º 2
0
        /// <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);
        }