コード例 #1
0
 /// <summary>
 /// Creates a new object.
 /// </summary>
 /// <param name="endPoint"></param>
 /// <param name="bytesSent"></param>
 /// <param name="port"></param>
 /// <param name="format"></param>
 public BroadcastEventArgs(IPEndPoint endPoint, int bytesSent, int port, RebroadcastFormat format)
 {
     EndPoint = endPoint;
     BytesSent = bytesSent;
     Port = port;
     Format = format;
 }
コード例 #2
0
 /// <summary>
 /// Creates a new object.
 /// </summary>
 /// <param name="endPoint"></param>
 /// <param name="bytesSent"></param>
 /// <param name="port"></param>
 /// <param name="format"></param>
 public BroadcastEventArgs(IPEndPoint endPoint, int bytesSent, int port, RebroadcastFormat format)
 {
     EndPoint  = endPoint;
     BytesSent = bytesSent;
     Port      = port;
     Format    = format;
 }
コード例 #3
0
        /// <summary>
        /// Returns the localised string for a <see cref="RebroadcastFormat"/>.
        /// </summary>
        /// <param name="format"></param>
        /// <returns></returns>
        private string ConvertFormatToString(RebroadcastFormat format)
        {
            switch (format)
            {
            case RebroadcastFormat.Passthrough:     return(Strings.RebroadcastFormatPassthrough);

            case RebroadcastFormat.Port30003:       return(Strings.RebroadcastFormatPort30003);

            case RebroadcastFormat.Avr:             return(Strings.RebroadcastFormatAvr);

            default:                                throw new NotImplementedException();
            }
        }
コード例 #4
0
 /// <summary>
 /// See interface docs.
 /// </summary>
 /// <param name="endPointAddress"></param>
 /// <param name="endPointPort"></param>
 /// <param name="connectedToPort"></param>
 /// <param name="portFormat"></param>
 /// <param name="bytesSent"></param>
 public void ShowRebroadcastClientServiced(string endPointAddress, int endPointPort, int connectedToPort, RebroadcastFormat portFormat, int bytesSent)
 {
     rebroadcastStatusControl.UpdateEntry(endPointAddress, endPointPort, connectedToPort, portFormat, bytesSent);
 }
コード例 #5
0
        /// <summary>
        /// Updates or adds a connection to the list.
        /// </summary>
        /// <param name="endPointAddress"></param>
        /// <param name="endPointPort"></param>
        /// <param name="connectedToPort"></param>
        /// <param name="portFormat"></param>
        /// <param name="bytesSent"></param>
        public void UpdateEntry(string endPointAddress, int endPointPort, int connectedToPort, RebroadcastFormat portFormat, int bytesSent)
        {
            lock (_SyncLock) {
                var connection = _Connections.Where(r => r.EndPointPort == endPointPort && r.EndPointAddress == endPointAddress).FirstOrDefault();
                if (connection == null)
                {
                    connection = new Connection()
                    {
                        EndPointAddress = endPointAddress, EndPointPort = endPointPort
                    };
                    _Connections.Add(connection);
                }

                connection.BytesSent      += bytesSent;
                connection.Format          = portFormat;
                connection.ConnectedToPort = connectedToPort;
                connection.Changed         = true;
            }
        }
コード例 #6
0
 /// <summary>
 /// Returns the localised string for a <see cref="RebroadcastFormat"/>.
 /// </summary>
 /// <param name="format"></param>
 /// <returns></returns>
 private string ConvertFormatToString(RebroadcastFormat format)
 {
     switch(format) {
         case RebroadcastFormat.Passthrough:     return Strings.RebroadcastFormatPassthrough;
         case RebroadcastFormat.Port30003:       return Strings.RebroadcastFormatPort30003;
         case RebroadcastFormat.Avr:             return Strings.RebroadcastFormatAvr;
         default:                                throw new NotImplementedException();
     }
 }
コード例 #7
0
        /// <summary>
        /// Updates or adds a connection to the list.
        /// </summary>
        /// <param name="endPointAddress"></param>
        /// <param name="endPointPort"></param>
        /// <param name="connectedToPort"></param>
        /// <param name="portFormat"></param>
        /// <param name="bytesSent"></param>
        public void UpdateEntry(string endPointAddress, int endPointPort, int connectedToPort, RebroadcastFormat portFormat, int bytesSent)
        {
            lock(_SyncLock) {
                var connection = _Connections.Where(r => r.EndPointPort == endPointPort && r.EndPointAddress == endPointAddress).FirstOrDefault();
                if(connection == null) {
                    connection = new Connection() { EndPointAddress = endPointAddress, EndPointPort = endPointPort };
                    _Connections.Add(connection);
                }

                connection.BytesSent += bytesSent;
                connection.Format = portFormat;
                connection.ConnectedToPort = connectedToPort;
                connection.Changed = true;
            }
        }
コード例 #8
0
 /// <summary>
 /// See interface docs.
 /// </summary>
 /// <param name="endPointAddress"></param>
 /// <param name="endPointPort"></param>
 /// <param name="connectedToPort"></param>
 /// <param name="portFormat"></param>
 /// <param name="bytesSent"></param>
 public void ShowRebroadcastClientServiced(string endPointAddress, int endPointPort, int connectedToPort, RebroadcastFormat portFormat, int bytesSent)
 {
     rebroadcastStatusControl.UpdateEntry(endPointAddress, endPointPort, connectedToPort, portFormat, bytesSent);
 }