/// <summary> /// Determines wether the specified simple id equals the current address. /// </summary> /// <param name="other">The simple id to compare with.</param> /// <returns>True if the specified simple id is equal to the current simple id; otherwise, false.</returns> public bool Equals(SimpleId other) { if ((object)other == null) { return(false); } int iRes = String.Compare(_simpleId, other._simpleId); return(iRes == 0); }
/// <summary> /// Determines wether the specified object equals the current object. /// </summary> /// <param name="other">The object to compare with.</param> /// <returns>True if the specified object is equal to the current object; otherwise, false.</returns> public override bool Equals(object other) { if (other == null) { return(false); } SimpleId id = other as SimpleId; if ((object)id == null) { return(false); } int iRes = String.Compare(_simpleId, id._simpleId); return(iRes == 0); }
/// <summary> /// Copy Constructor for a zone state. /// It copies all memebers (incl. the Guid) to the new object. /// </summary> /// <param name="sourceZoneState">Source zone state.</param> public ZoneState(ZoneState sourceZoneState) { if (sourceZoneState == null) { _id = SimpleId.NewGuid(); _lastUpdate = DateTime.Now; _zoneQuality = ZoneQuality.Offline; // Default Value } else { _id = sourceZoneState._id; _lastUpdate = sourceZoneState._lastUpdate; _zoneQuality = sourceZoneState._zoneQuality; _source = sourceZoneState._source; _powerStatus = sourceZoneState._powerStatus; Volume = sourceZoneState._volume; _commandUnacknowledged = sourceZoneState._commandUnacknowledged; } }
private DateTime _lastUpdate = new DateTime(1970, 1, 1); // set to a default time #endregion #region Constructors /// <summary> /// Default constructor, without any parameter. /// This is required to allow this object as command parameter via WCF framework. /// </summary> public ZoneState() { _id = SimpleId.NewGuid(); _lastUpdate = DateTime.Now; _zoneQuality = ZoneQuality.Offline; // Default Value }