示例#1
0
        private void RunConnectionUpdate(ConnectionUpdateArgs args)
        {
            if (_lastArgs.IsEqual(args))
            {
                return;
            }

            _lastArgs.SetFrom(args);
            MessageBroker.RunActions("ConnectionUpdate", args);
        }
        private void RunConnectionUpdate()
        {
            var args = new ConnectionUpdateArgs(IsOpen, IsConnected, PortName);

            if (_lastArgs.IsEqual(args))
            {
                return;
            }

            _lastArgs.CopyFrom(args);
            MessageBroker.RunActions("ConnectionUpdate", args);
        }
示例#3
0
 /// <summary>
 /// Function to set one object based on the parameters of another.
 /// </summary>
 /// <param name="newArgs">The object to copy.</param>
 public void SetFrom(ConnectionUpdateArgs newArgs)
 {
     IsConnected = newArgs.IsConnected;
     IpEndpoint  = newArgs.IpEndpoint;
 }
示例#4
0
 /// <summary>
 /// Function to test for equality between two ConnectionUpdateArgs objects.
 /// </summary>
 /// <param name="newArgs">ConnectionUpdateArgs object to compare against.</param>
 /// <returns>True = Objects are equal, False = Objects differ</returns>
 public bool IsEqual(ConnectionUpdateArgs newArgs)
 {
     return(IsConnected == newArgs.IsConnected &&
            IpEndpoint != null && newArgs.IpEndpoint != null &&
            IpEndpoint.Equals(newArgs.IpEndpoint));
 }
 /// <summary>
 /// Function to test for equality between two ConnectionUpdateArgs objects.
 /// </summary>
 /// <param name="newArgs">ConnectionUpdateArgs object to compare against.</param>
 /// <returns>True = Objects are equal, False = Objects differ</returns>
 public bool IsEqual(ConnectionUpdateArgs newArgs)
 {
     return(IsConnected == newArgs.IsConnected &&
            IsOpen == newArgs.IsOpen &&
            Port == newArgs.Port);
 }
 /// <summary>
 /// A function to update the values from the args object.
 /// </summary>
 /// <param name="args">ConnectionUpdateArgs object to copy settings from.</param>
 public void CopyFrom(ConnectionUpdateArgs args)
 {
     IsConnected = args.IsConnected;
     IsOpen      = args.IsOpen;
     Port        = args.Port;
 }