/// <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 (Units != null)
                {
                    hash = hash * 59 + Units.GetHashCode();
                }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                return(hash);
            }
        }
Esempio n. 2
0
        public override Task DivideLine(string line)
        {
            if (line.Length < 5)
            {
                Console.WriteLine("Line too small, skipped.");
            }

            else if (line.Contains("'s application. ("))
            {
                Applications.Add(line);
            }
            else if (line.Contains(" has submitted an application."))
            {
                Applications.Add(line);
            }

            else if (line.Contains(" is promoting "))
            {
                RankChanges.Add(line);
            }
            else if (line.Contains(" is demoting "))
            {
                RankChanges.Add(line);
            }

            else if (line.Contains(") joined the group"))
            {
                JoinsDepartures.Add(line);
            }
            else if (line.Contains(" has kicked "))
            {
                JoinsDepartures.Add(line);
            }
            else if (line.Contains(") left the group as "))
            {
                JoinsDepartures.Add(line);
            }

            else if (line.Contains(" deposited to "))
            {
                Bank.Add(line);
            }
            else if (line.Contains(" in the group bank"))
            {
                Bank.Add(line);
            }
            else if (line.Contains(" group bank for reason:"))
            {
                Bank.Add(line);
            }
            else if (line.Contains(" withdrew "))
            {
                Bank.Add(line);
            }

            else if (line.Contains(") updated the group info"))
            {
                Management.Add(line);
            }
            else if (line.Contains(" has updated group application."))
            {
                Management.Add(line);
            }
            else if (line.Contains(" blacklist."))
            {
                Management.Add(line);
            }
            else if (line.Contains("updated the group whitelist"))
            {
                Management.Add(line);
            }

            else if (line.Contains(") warned "))
            {
                Warnings.Add(line);
            }
            else if (line.Contains(") rewarded "))
            {
                Warnings.Add(line);
            }

            else if (line.Contains(") has promoted group: "))
            {
                Management.Add(line);
            }
            else if (line.Contains(") updated rank: "))
            {
                Management.Add(line);
            }
            else if (line.Contains(") added rank: "))
            {
                Management.Add(line);
            }
            else if (line.Contains(") removed rank: "))
            {
                Management.Add(line);
            }

            else if (line.Contains("custom title"))
            {
                CustomTitle.Add(line);
            }

            else
            {
                Other.Add(line);
            }
            return(Task.CompletedTask);
        }
        /// <summary>
        /// Returns true if Settings instances are equal
        /// </summary>
        /// <param name="other">Instance of Settings to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Settings other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Units == other.Units ||
                     Units != null &&
                     Units.Equals(other.Units)
                     ) &&
                 (
                     TimeFormat == other.TimeFormat ||
                     TimeFormat != null &&
                     TimeFormat.Equals(other.TimeFormat)
                 ) &&
                 (
                     CustomTitle == other.CustomTitle ||
                     CustomTitle != null &&
                     CustomTitle.Equals(other.CustomTitle)
                 ) &&
                 (
                     NightMode == other.NightMode ||
                     NightMode != null &&
                     NightMode.Equals(other.NightMode)
                 ) &&
                 (
                     Theme == other.Theme ||
                     Theme != null &&
                     Theme.Equals(other.Theme)
                 ) &&
                 (
                     Language == other.Language ||
                     Language != null &&
                     Language.Equals(other.Language)
                 ) &&
                 (
                     ShowPlugins == other.ShowPlugins ||
                     ShowPlugins != null &&
                     ShowPlugins.Equals(other.ShowPlugins)
                 ) &&
                 (
                     ShowRawbg == other.ShowRawbg ||
                     ShowRawbg != null &&
                     ShowRawbg.Equals(other.ShowRawbg)
                 ) &&
                 (
                     AlarmTypes == other.AlarmTypes ||
                     AlarmTypes != null &&
                     AlarmTypes.SequenceEqual(other.AlarmTypes)
                 ) &&
                 (
                     AlarmUrgentHigh == other.AlarmUrgentHigh ||
                     AlarmUrgentHigh != null &&
                     AlarmUrgentHigh.Equals(other.AlarmUrgentHigh)
                 ) &&
                 (
                     AlarmHigh == other.AlarmHigh ||
                     AlarmHigh != null &&
                     AlarmHigh.Equals(other.AlarmHigh)
                 ) &&
                 (
                     AlarmLow == other.AlarmLow ||
                     AlarmLow != null &&
                     AlarmLow.Equals(other.AlarmLow)
                 ) &&
                 (
                     AlarmUrgentLow == other.AlarmUrgentLow ||
                     AlarmUrgentLow != null &&
                     AlarmUrgentLow.Equals(other.AlarmUrgentLow)
                 ) &&
                 (
                     AlarmTimeagoWarn == other.AlarmTimeagoWarn ||
                     AlarmTimeagoWarn != null &&
                     AlarmTimeagoWarn.Equals(other.AlarmTimeagoWarn)
                 ) &&
                 (
                     AlarmTimeagoWarnMins == other.AlarmTimeagoWarnMins ||
                     AlarmTimeagoWarnMins != null &&
                     AlarmTimeagoWarnMins.Equals(other.AlarmTimeagoWarnMins)
                 ) &&
                 (
                     AlarmTimeagoUrgent == other.AlarmTimeagoUrgent ||
                     AlarmTimeagoUrgent != null &&
                     AlarmTimeagoUrgent.Equals(other.AlarmTimeagoUrgent)
                 ) &&
                 (
                     AlarmTimeagoUrgentMins == other.AlarmTimeagoUrgentMins ||
                     AlarmTimeagoUrgentMins != null &&
                     AlarmTimeagoUrgentMins.Equals(other.AlarmTimeagoUrgentMins)
                 ) &&
                 (
                     Enable == other.Enable ||
                     Enable != null &&
                     Enable.SequenceEqual(other.Enable)
                 ) &&
                 (
                     Thresholds == other.Thresholds ||
                     Thresholds != null &&
                     Thresholds.Equals(other.Thresholds)
                 ));
        }