예제 #1
0
        private void BuildDescriptors(IShapeTableProvider bindingStrategy, IEnumerable <ShapeAlteration> builtAlterations)
        {
            var alterationSets = builtAlterations.GroupBy(a => a.Feature.Id + a.ShapeType);

            foreach (var alterations in alterationSets)
            {
                var firstAlteration = alterations.First();

                var key = bindingStrategy.GetType().Name
                          + firstAlteration.Feature.Id
                          + firstAlteration.ShapeType.ToLower();

                if (!_shapeDescriptors.ContainsKey(key))
                {
                    var descriptor = new FeatureShapeDescriptor
                                     (
                        firstAlteration.Feature,
                        firstAlteration.ShapeType
                                     );

                    foreach (var alteration in alterations)
                    {
                        alteration.Alter(descriptor);
                    }

                    _shapeDescriptors[key] = descriptor;
                }
            }
        }
예제 #2
0
 private bool IsEnabledModuleOrRequestedTheme(FeatureShapeDescriptor descriptor, string themeName, List <string> enabledFeatureIds)
 {
     return(IsEnabledModuleOrRequestedTheme(descriptor?.Feature, themeName, enabledFeatureIds));
 }