コード例 #1
0
 public ThemeStateComparisonViewModel(
     ThemeStateViewModel oldState, ThemeStateViewModel newState)
 {
     OldState    = oldState;
     NewState    = newState;
     Comparison  = ComparisonUtils.GetResult(oldState != null, newState != null);
     DisplayName = NewState?.DisplayName ?? OldState?.DisplayName;
 }
コード例 #2
0
 public void AddInheritedProperties(ThemeStateViewModel baseState)
 {
     foreach (var inherited in baseState.Properties)
     {
         if (properties.All(x => x.PropertyId != inherited.PropertyId))
         {
             properties.Add(new InheritedThemePropertyViewModel(inherited));
         }
     }
 }
コード例 #3
0
        public ThemeStateViewModel AddState(int stateId)
        {
            ThemeStateViewModel state = FindState(stateId);

            if (state == null)
            {
                state = new ThemeStateViewModel(Part.AddState(stateId), this);
                states.Add(state);
            }

            return(state);
        }
コード例 #4
0
        public ThemeStateComparisonViewModel Compare(
            ThemeStateViewModel oldState, ThemeStateViewModel newState)
        {
            var cmpModel = new ThemeStateComparisonViewModel(oldState, newState);

            if (oldState != null && newState != null)
            {
                cmpModel.Properties = Compare(oldState.Properties, newState.Properties);
                if (cmpModel.Properties.Count == 0)
                {
                    return(null);
                }
            }

            return(cmpModel);
        }