コード例 #1
0
        /// <summary>
        /// Compares two boot notification responses for equality.
        /// </summary>
        /// <param name="BootNotificationResponse">A boot notification response to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public override Boolean Equals(BootNotificationResponse BootNotificationResponse)
        {
            if (BootNotificationResponse is null)
            {
                return(false);
            }

            return(Status.Equals(BootNotificationResponse.Status) &&
                   CurrentTime.Equals(BootNotificationResponse.CurrentTime) &&
                   Interval.Equals(BootNotificationResponse.Interval) &&

                   ((StatusInfo == null && BootNotificationResponse.StatusInfo == null) ||
                    (StatusInfo != null && BootNotificationResponse.StatusInfo != null && StatusInfo.Equals(BootNotificationResponse.StatusInfo))) &&

                   ((CustomData == null && BootNotificationResponse.CustomData == null) ||
                    (CustomData != null && BootNotificationResponse.CustomData != null && CustomData.Equals(BootNotificationResponse.CustomData))));
        }
コード例 #2
0
        /// <summary>
        /// Returns true if EnrichedThingDTO instances are equal
        /// </summary>
        /// <param name="input">Instance of EnrichedThingDTO to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(EnrichedThingDTO input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Label == input.Label ||
                     (Label != null &&
                      Label.Equals(input.Label))
                     ) &&
                 (
                     BridgeUID == input.BridgeUID ||
                     (BridgeUID != null &&
                      BridgeUID.Equals(input.BridgeUID))
                 ) &&
                 (
                     Configuration == input.Configuration ||
                     Configuration != null &&
                     Configuration.SequenceEqual(input.Configuration)
                 ) &&
                 (
                     Properties == input.Properties ||
                     Properties != null &&
                     Properties.SequenceEqual(input.Properties)
                 ) &&
                 (
                     UID == input.UID ||
                     (UID != null &&
                      UID.Equals(input.UID))
                 ) &&
                 (
                     ThingTypeUID == input.ThingTypeUID ||
                     (ThingTypeUID != null &&
                      ThingTypeUID.Equals(input.ThingTypeUID))
                 ) &&
                 (
                     Channels == input.Channels ||
                     Channels != null &&
                     Channels.SequenceEqual(input.Channels)
                 ) &&
                 (
                     Location == input.Location ||
                     (Location != null &&
                      Location.Equals(input.Location))
                 ) &&
                 (
                     StatusInfo == input.StatusInfo ||
                     (StatusInfo != null &&
                      StatusInfo.Equals(input.StatusInfo))
                 ) &&
                 (
                     FirmwareStatus == input.FirmwareStatus ||
                     (FirmwareStatus != null &&
                      FirmwareStatus.Equals(input.FirmwareStatus))
                 ) &&
                 (
                     Editable == input.Editable ||
                     (Editable != null &&
                      Editable.Equals(input.Editable))
                 ));
        }