public IPropertyValue Construct(CssProperty[] properties) { if (properties.Length == 4) { var options = new IPropertyValue[4]; options[0] = _converter.Construct(properties.Where(m => m.Name == _labels[0]).ToArray()); options[1] = _converter.Construct(properties.Where(m => m.Name == _labels[1]).ToArray()); options[2] = _converter.Construct(properties.Where(m => m.Name == _labels[2]).ToArray()); options[3] = _converter.Construct(properties.Where(m => m.Name == _labels[3]).ToArray()); return options[0] != null && options[1] != null && options[2] != null && options[3] != null ? new PeriodicValue(options, Enumerable.Empty<CssToken>(), _labels) : null; } return null; }
public IPropertyValue Construct(CssProperty[] properties) { var filtered = properties.Where(m => _labels.Contains(m.Name)); var existing = default(String); foreach (var filter in filtered) { var value = filter.Value; if (existing != null && value != existing) return null; existing = value; } var result = _converter.Construct(filtered.Take(1).ToArray()); return result != null ? new TransformationValueConverter(result, _labels) : null; }