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); }
/// <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; }
/// <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; }