public ThemePropertyComparisonViewModel(
            ThemePropertyViewModel oldProperty, ThemePropertyViewModel newProperty)
        {
            if (oldProperty == null && newProperty == null)
            {
                throw new ArgumentException();
            }

            OldProperty = oldProperty;
            NewProperty = newProperty;
            Comparison  = ComparisonUtils.GetResult(oldProperty != null, newProperty != null);

            if (newProperty != null)
            {
                DisplayName   = newProperty.DisplayName;
                PropertyId    = newProperty.PropertyId;
                PrimitiveType = newProperty.DisplayPrimitiveType;
            }
            else
            {
                DisplayName   = oldProperty.DisplayName;
                PropertyId    = oldProperty.PropertyId;
                PrimitiveType = oldProperty.DisplayPrimitiveType;
            }
        }
        public ThemePropertyComparisonViewModel Compare(
            ThemePropertyViewModel oldProperty,
            ThemePropertyViewModel newProperty)
        {
            if (oldProperty != null && newProperty != null)
            {
                int cmp = Compare(oldProperty.Value, newProperty.Value);
                if (cmp == 0)
                {
                    return(null);
                }
            }

            return(new ThemePropertyComparisonViewModel(oldProperty, newProperty));
        }
Пример #3
0
 public InheritedThemePropertyViewModel(ThemePropertyViewModel property)
 {
     this.property = property;
     Origin        = property.Origin | PropertyOrigin.Inherited;
 }