Example #1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            AnalyticsSettings analyticsSetting = (AnalyticsSettings)obj;

            if (this.LogVersion == analyticsSetting.LogVersion && this.LogType == analyticsSetting.LogType && this.IsLogRetentionPolicyEnabled == analyticsSetting.IsLogRetentionPolicyEnabled && (this.LogRetentionInDays == analyticsSetting.LogRetentionInDays || !this.IsLogRetentionPolicyEnabled) && this.MetricsVersion == analyticsSetting.MetricsVersion && this.MetricsType == analyticsSetting.MetricsType && this.IsMetricsRetentionPolicyEnabled == analyticsSetting.IsMetricsRetentionPolicyEnabled && (this.MetricsRetentionInDays == analyticsSetting.MetricsRetentionInDays || !this.IsMetricsRetentionPolicyEnabled) && this.MinuteMetricsVersion == analyticsSetting.MinuteMetricsVersion && this.MinuteMetricsType == analyticsSetting.MinuteMetricsType)
            {
                bool?isMinuteMetricsRetentionPolicyEnabled = this.IsMinuteMetricsRetentionPolicyEnabled;
                bool?nullable = analyticsSetting.IsMinuteMetricsRetentionPolicyEnabled;
                if ((isMinuteMetricsRetentionPolicyEnabled.GetValueOrDefault() != nullable.GetValueOrDefault() ? false : isMinuteMetricsRetentionPolicyEnabled.HasValue == nullable.HasValue))
                {
                    if (this.MinuteMetricsRetentionInDays != analyticsSetting.MinuteMetricsRetentionInDays)
                    {
                        bool?isMinuteMetricsRetentionPolicyEnabled1 = this.IsMinuteMetricsRetentionPolicyEnabled;
                        if ((!isMinuteMetricsRetentionPolicyEnabled1.GetValueOrDefault() ? false : isMinuteMetricsRetentionPolicyEnabled1.HasValue))
                        {
                            return(false);
                        }
                    }
                    if (this.DefaultRESTVersion == analyticsSetting.DefaultRESTVersion)
                    {
                        return(this.CorsRulesSerializedString == analyticsSetting.CorsRulesSerializedString);
                    }
                }
            }
            return(false);
        }
Example #2
0
        public object Clone()
        {
            AnalyticsSettings analyticsSetting = new AnalyticsSettings()
            {
                LogType    = this.LogType,
                LogVersion = this.LogVersion,
                IsLogRetentionPolicyEnabled = this.IsLogRetentionPolicyEnabled,
                LogRetentionInDays          = this.LogRetentionInDays,
                MetricsType    = this.MetricsType,
                MetricsVersion = this.MetricsVersion,
                IsMetricsRetentionPolicyEnabled = this.IsMetricsRetentionPolicyEnabled,
                MetricsRetentionInDays          = this.MetricsRetentionInDays,
                MinuteMetricsType    = this.MinuteMetricsType,
                MinuteMetricsVersion = this.MinuteMetricsVersion,
                IsMinuteMetricsRetentionPolicyEnabled = this.IsMinuteMetricsRetentionPolicyEnabled,
                MinuteMetricsRetentionInDays          = this.MinuteMetricsRetentionInDays,
                corsRules = new List <CorsRule>()
            };

            foreach (CorsRule corsRule in this.corsRules)
            {
                analyticsSetting.corsRules.Add((CorsRule)corsRule.Clone());
            }
            analyticsSetting.corsRulesSerializedString = this.corsRulesSerializedString;
            analyticsSetting.DefaultRESTVersion        = this.DefaultRESTVersion;
            return(analyticsSetting);
        }