void SetDefaults() { var length = Enum.GetValues(typeof(VisualRoleType)).Length; BackGroundColors = new ElementColors[length]; TextColors = new ElementColors[length]; OutlineColors = new ElementColors[length]; }
public void SetEmptyElementColors( ElementColors outline, ElementColors background, ElementColors text ) { // TODO: here, enum values are cast to ints // TODO: in other places, you count from 0 to length - 1 // TODO: those are not the same thing foreach (var enum_ in Enum.GetValues(typeof(VisualRoleType))) { var i = (int)enum_; BackGroundColors[i] ??= background.Clone(); OutlineColors[i] ??= outline.Clone(); TextColors[i] ??= text.Clone(); } }