public ThemeStateComparisonViewModel( ThemeStateViewModel oldState, ThemeStateViewModel newState) { OldState = oldState; NewState = newState; Comparison = ComparisonUtils.GetResult(oldState != null, newState != null); DisplayName = NewState?.DisplayName ?? OldState?.DisplayName; }
public void AddInheritedProperties(ThemeStateViewModel baseState) { foreach (var inherited in baseState.Properties) { if (properties.All(x => x.PropertyId != inherited.PropertyId)) { properties.Add(new InheritedThemePropertyViewModel(inherited)); } } }
public ThemeStateViewModel AddState(int stateId) { ThemeStateViewModel state = FindState(stateId); if (state == null) { state = new ThemeStateViewModel(Part.AddState(stateId), this); states.Add(state); } return(state); }
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); }