コード例 #1
0
ファイル: ConnectionHost.cs プロジェクト: RConDev/RaptoRCon
        public void Add(IHostedConnection hostedConnection)
        {
            if (connections.Any(x => x.Id == hostedConnection.Id))
            {
                throw new ConnectionAlreadyAddedException();
            }

            connections.Add(hostedConnection);
        }
コード例 #2
0
ファイル: ConnectionHost.cs プロジェクト: RConDev/RaptoRCon
        public bool Remove(IHostedConnection hostedConnection)
        {
            if (connections.Contains(hostedConnection))
            {
                connections.Remove(hostedConnection);
                return true;
            }

            return false;
        }