Пример #1
0
        private void AddNewProperty(PropertyViewModel propertyInProject)
        {
            var values = new List <PropertyFilterValue>();

            if (propertyInProject.ValueList != null && propertyInProject.ValueList.Any())
            {
                values.AddRange(propertyInProject.ValueList.Distinct().Select(x => new PropertyFilterValue(x)));
            }
            else
            {
                values.Add(new PropertyFilterValue(propertyInProject.Value));
            }

            var prop = new PropertyFilterModel()
            {
                Key            = propertyInProject.Key,
                Values         = values,
                OccurenceCount = 1,
            };

            this.Properties.Add(prop);
        }
Пример #2
0
 private static void UpdateExistingProperty(PropertyFilterModel propertyInViewModel, PropertyViewModel propertyInProject)
 {
     propertyInViewModel.OccurenceCount++;
     if (propertyInProject.ValueList != null && propertyInProject.ValueList.Any())
     {
         foreach (string propertyValue in propertyInProject.ValueList.Distinct())
         {
             IncrementValueInExistingProperty(propertyInViewModel, propertyValue);
         }
     }
     else
     {
         IncrementValueInExistingProperty(propertyInViewModel, propertyInProject.Value);
     }
 }