public ThemeProperty AddProperty( int index, long offset, int partId, int stateId, int primitiveType, int propertyId, object value, bool isGlobal) { if (partId == 0) { var property = properties.FindProperty(primitiveType, propertyId); if (property != null) { return(property); } var origin = isGlobal ? PropertyOrigin.Global : PropertyOrigin.Class; property = new ThemeProperty( this, index, offset, (TMT)propertyId, (TMT)primitiveType, origin, value); properties.Add(property); return(property); } var part = AddPart(partId); if (stateId == 0) { return(part.AddProperty(index, offset, primitiveType, propertyId, value)); } var state = part.AddState(stateId); return(state.AddProperty(index, offset, primitiveType, propertyId, value)); }
public ThemeProperty AddProperty( int index, long offset, int primitiveType, int propertyId, object value) { var property = properties.FindProperty(primitiveType, propertyId); if (property != null) { return(property); } property = new ThemeProperty( this, index, offset, (TMT)propertyId, (TMT)primitiveType, PropertyOrigin.Part, value); properties.Add(property); Debug.Assert(Id != 0); return(property); }
private int CompareProperty(ThemeProperty x, ThemeProperty y) { return(x.PropertyId.CompareTo(y.PropertyId)); }