Exemplo n.º 1
0
        /// <summary>
        /// Returns true if Status instances are equal
        /// </summary>
        /// <param name="other">Instance of Status to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Status other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ApiEnabled == other.ApiEnabled ||
                     ApiEnabled != null &&
                     ApiEnabled.Equals(other.ApiEnabled)
                     ) &&
                 (
                     CareportalEnabled == other.CareportalEnabled ||
                     CareportalEnabled != null &&
                     CareportalEnabled.Equals(other.CareportalEnabled)
                 ) &&
                 (
                     Head == other.Head ||
                     Head != null &&
                     Head.Equals(other.Head)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Version == other.Version ||
                     Version != null &&
                     Version.Equals(other.Version)
                 ) &&
                 (
                     Settings == other.Settings ||
                     Settings != null &&
                     Settings.Equals(other.Settings)
                 ) &&
                 (
                     ExtendedSettings == other.ExtendedSettings ||
                     ExtendedSettings != null &&
                     ExtendedSettings.Equals(other.ExtendedSettings)
                 ));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                var hash = 41;
                // Suitable nullity checks etc, of course :)

                if (ApiEnabled != null)
                {
                    hash = hash * 59 + ApiEnabled.GetHashCode();
                }

                if (CareportalEnabled != null)
                {
                    hash = hash * 59 + CareportalEnabled.GetHashCode();
                }

                if (Head != null)
                {
                    hash = hash * 59 + Head.GetHashCode();
                }

                if (Name != null)
                {
                    hash = hash * 59 + Name.GetHashCode();
                }

                if (Version != null)
                {
                    hash = hash * 59 + Version.GetHashCode();
                }

                if (Settings != null)
                {
                    hash = hash * 59 + Settings.GetHashCode();
                }

                if (ExtendedSettings != null)
                {
                    hash = hash * 59 + ExtendedSettings.GetHashCode();
                }

                return(hash);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Save the Features.General settings to the settings file
        /// </summary>
        /// <param name="administrationNode">XML-node for the General.Administration settings</param>
        public void Save(XmlNode featuresGeneralNode)
        {
            string xpath;

            xpath = "./chartsEnabled";
            SettingsHelper.SetSettingValue(xpath, featuresGeneralNode, ChartsEnabled.ToString());
            xpath = "./apiEnabled";
            SettingsHelper.SetSettingValue(xpath, featuresGeneralNode, ApiEnabled.ToString());
            xpath = "./saveQueryEnabled";
            SettingsHelper.SetSettingValue(xpath, featuresGeneralNode, SavedQueryEnabled.ToString());
            xpath = "./userFriendlyUrlsEnabled";
            SettingsHelper.SetSettingValue(xpath, featuresGeneralNode, UserFriendlyUrlsEnabled.ToString());
            xpath = "./userStatisticsEnabled";
            SettingsHelper.SetSettingValue(xpath, featuresGeneralNode, UserStatisticsEnabled.ToString());
            xpath = "./searchEnabled";
            SettingsHelper.SetSettingValue(xpath, featuresGeneralNode, SearchEnabled.ToString());
            xpath = "./backgroundWorkerEnabled";
            SettingsHelper.SetSettingValue(xpath, featuresGeneralNode, BackgroundWorkerEnabled.ToString());
            xpath = "./clearCache";
            SettingsHelper.SetSettingValue(xpath, featuresGeneralNode, ClearCache.ToString());
        }