コード例 #1
0
        /// <summary>
        ///     Refreshes information about the rule.
        /// </summary>
        /// <returns></returns>
        public Rule Refresh()
        {
            var rule = OpenHab.RestClient.RuleService.GetRule(Uid);

            Triggers           = rule.Triggers;
            Conditions         = rule.Conditions;
            Actions            = rule.Actions;
            Configuration      = rule.Configuration;
            ConfigDescriptions = rule.ConfigDescriptions;
            TemplateUid        = rule.TemplateUid;
            Uid         = rule.Uid;
            Name        = rule.Name;
            Tags        = rule.Tags;
            Visibility  = rule.Visibility;
            Description = rule.Description;
            Enabled     = rule.Enabled;
            Status      = rule.Status;
            return(this);
        }
コード例 #2
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Label != null?Label.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (BridgeUid != null ? BridgeUid.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Configuration != null ? Configuration.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Properties != null ? Properties.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Uid != null ? Uid.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (ThingTypeUid != null ? ThingTypeUid.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Channels != null ? Channels.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Location != null ? Location.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (StatusInfo != null ? StatusInfo.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (FirmwareStatus != null ? FirmwareStatus.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ Editable.GetHashCode();
                return(hashCode);
            }
        }
コード例 #3
0
 protected bool Equals(StatusInfo other)
 {
     return(string.Equals(Status, other.Status) && string.Equals(StatusDetail, other.StatusDetail) &&
            string.Equals(Description, other.Description));
 }