示例#1
0
        /// <summary>
        /// Refresh cached data.
        /// </summary>
        /// <param name="userContext">User context.</param>
        protected override void RefreshCache(IUserContext userContext)
        {
            lock (FactorOrigins)
            {
                FactorOrigins.Clear();
            }

            lock (FactorUpdateModes)
            {
                FactorUpdateModes.Clear();
            }

            lock (FactorFieldTypes)
            {
                FactorFieldTypes.Clear();
            }

            lock (PeriodTypes)
            {
                PeriodTypes.Clear();
            }

            lock (Periods)
            {
                Periods.Clear();
            }
            lock (IndividualCategories)
            {
                IndividualCategories.Clear();
            }
            lock (FactorFieldEnums)
            {
                FactorFieldEnums.Clear();
            }

            lock (FactorDataTypes)
            {
                FactorDataTypes.Clear();
            }
            lock (Factors)
            {
                Factors.Clear();
            }

            lock (FactorTrees)
            {
                FactorTrees.Clear();
            }

            lock (FactorTreeNodes)
            {
                FactorTreeNodes.Clear();
            }

            lock (OrganismGroups)
            {
                OrganismGroups.Clear();
            }
        }
        /// <summary>
        /// Get period types for specified locale.
        /// </summary>
        /// <param name="locale">Locale.</param>
        /// <returns>Period types for specified locale.</returns>
        protected virtual PeriodTypeList GetPeriodTypes(ILocale locale)
        {
            PeriodTypeList periodTypes = null;

            if (PeriodTypes.ContainsKey(locale.ISOCode))
            {
                periodTypes = (PeriodTypeList)(PeriodTypes[locale.ISOCode]);
            }
            return(periodTypes);
        }
示例#3
0
        /// <summary>
        /// Get period types for specified locale.
        /// </summary>
        /// <param name="locale">Locale.</param>
        /// <returns>Period types for specified locale.</returns>
        protected override PeriodTypeList GetPeriodTypes(ILocale locale)
        {
            PeriodTypeList periodTypes = null;

            lock (PeriodTypes)
            {
                if (PeriodTypes.ContainsKey(locale.ISOCode))
                {
                    periodTypes = (PeriodTypeList)(PeriodTypes[locale.ISOCode]);
                }
            }
            return(periodTypes);
        }
 /// <summary>
 /// Refresh cached data.
 /// </summary>
 /// <param name="userContext">User context.</param>
 protected virtual void RefreshCache(IUserContext userContext)
 {
     FactorOrigins.Clear();
     FactorUpdateModes.Clear();
     FactorFieldTypes.Clear();
     PeriodTypes.Clear();
     Periods.Clear();
     IndividualCategories.Clear();
     FactorFieldEnums.Clear();
     FactorDataTypes.Clear();
     Factors.Clear();
     FactorTrees.Clear();
     FactorTreeNodes.Clear();
     OrganismGroups.Clear();
 }
示例#5
0
        /// <summary>
        /// Get period types from web service.
        /// </summary>
        private static void LoadPeriodTypes()
        {
            PeriodTypeList periodTypes;

            if (PeriodTypes.IsNull())
            {
                // Get data from web service.
                periodTypes = new PeriodTypeList();
                foreach (WebPeriodType webPeriodType in WebServiceClient.GetPeriodTypes())
                {
                    periodTypes.Add(new PeriodType(webPeriodType.Id,
                                                   webPeriodType.Name,
                                                   webPeriodType.Description));
                }
                PeriodTypes = periodTypes;
            }
        }
 public bool DeepEquals(DestinyHistoricalStatsDefinition?other)
 {
     return(other is not null &&
            StatId == other.StatId &&
            Group == other.Group &&
            PeriodTypes.DeepEqualsListNaive(other.PeriodTypes) &&
            Modes.DeepEqualsListNaive(other.Modes) &&
            Category == other.Category &&
            StatName == other.StatName &&
            StatNameAbbr == other.StatNameAbbr &&
            StatDescription == other.StatDescription &&
            UnitType == other.UnitType &&
            IconImage == other.IconImage &&
            MergeMethod == other.MergeMethod &&
            UnitLabel == other.UnitLabel &&
            Weight == other.Weight &&
            MedalTierHash == other.MedalTierHash);
 }
示例#7
0
        public bool Equals(DestinyHistoricalStatsDefinition input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     StatId == input.StatId ||
                     (StatId != null && StatId.Equals(input.StatId))
                     ) &&
                 (
                     Group == input.Group ||
                     (Group != null && Group.Equals(input.Group))
                 ) &&
                 (
                     PeriodTypes == input.PeriodTypes ||
                     (PeriodTypes != null && PeriodTypes.SequenceEqual(input.PeriodTypes))
                 ) &&
                 (
                     Modes == input.Modes ||
                     (Modes != null && Modes.SequenceEqual(input.Modes))
                 ) &&
                 (
                     Category == input.Category ||
                     (Category != null && Category.Equals(input.Category))
                 ) &&
                 (
                     StatName == input.StatName ||
                     (StatName != null && StatName.Equals(input.StatName))
                 ) &&
                 (
                     StatNameAbbr == input.StatNameAbbr ||
                     (StatNameAbbr != null && StatNameAbbr.Equals(input.StatNameAbbr))
                 ) &&
                 (
                     StatDescription == input.StatDescription ||
                     (StatDescription != null && StatDescription.Equals(input.StatDescription))
                 ) &&
                 (
                     UnitType == input.UnitType ||
                     (UnitType != null && UnitType.Equals(input.UnitType))
                 ) &&
                 (
                     IconImage == input.IconImage ||
                     (IconImage != null && IconImage.Equals(input.IconImage))
                 ) &&
                 (
                     MergeMethod == input.MergeMethod ||
                     (MergeMethod.Equals(input.MergeMethod))
                 ) &&
                 (
                     UnitLabel == input.UnitLabel ||
                     (UnitLabel != null && UnitLabel.Equals(input.UnitLabel))
                 ) &&
                 (
                     Weight == input.Weight ||
                     (Weight.Equals(input.Weight))
                 ) &&
                 (
                     MedalTierHash == input.MedalTierHash ||
                     (MedalTierHash.Equals(input.MedalTierHash))
                 ));
        }
 public void Update(DestinyHistoricalStatsDefinition?other)
 {
     if (other is null)
     {
         return;
     }
     if (StatId != other.StatId)
     {
         StatId = other.StatId;
         OnPropertyChanged(nameof(StatId));
     }
     if (Group != other.Group)
     {
         Group = other.Group;
         OnPropertyChanged(nameof(Group));
     }
     if (!PeriodTypes.DeepEqualsListNaive(other.PeriodTypes))
     {
         PeriodTypes = other.PeriodTypes;
         OnPropertyChanged(nameof(PeriodTypes));
     }
     if (!Modes.DeepEqualsListNaive(other.Modes))
     {
         Modes = other.Modes;
         OnPropertyChanged(nameof(Modes));
     }
     if (Category != other.Category)
     {
         Category = other.Category;
         OnPropertyChanged(nameof(Category));
     }
     if (StatName != other.StatName)
     {
         StatName = other.StatName;
         OnPropertyChanged(nameof(StatName));
     }
     if (StatNameAbbr != other.StatNameAbbr)
     {
         StatNameAbbr = other.StatNameAbbr;
         OnPropertyChanged(nameof(StatNameAbbr));
     }
     if (StatDescription != other.StatDescription)
     {
         StatDescription = other.StatDescription;
         OnPropertyChanged(nameof(StatDescription));
     }
     if (UnitType != other.UnitType)
     {
         UnitType = other.UnitType;
         OnPropertyChanged(nameof(UnitType));
     }
     if (IconImage != other.IconImage)
     {
         IconImage = other.IconImage;
         OnPropertyChanged(nameof(IconImage));
     }
     if (MergeMethod != other.MergeMethod)
     {
         MergeMethod = other.MergeMethod;
         OnPropertyChanged(nameof(MergeMethod));
     }
     if (UnitLabel != other.UnitLabel)
     {
         UnitLabel = other.UnitLabel;
         OnPropertyChanged(nameof(UnitLabel));
     }
     if (Weight != other.Weight)
     {
         Weight = other.Weight;
         OnPropertyChanged(nameof(Weight));
     }
     if (MedalTierHash != other.MedalTierHash)
     {
         MedalTierHash = other.MedalTierHash;
         OnPropertyChanged(nameof(MedalTierHash));
     }
 }