private StateEnum SetFieldBrush(Field field, Brush color) { if (DuplicateColor(color)) { return StateEnum.DuplicateColor; } if (field.State == FieldStateEnum.Empty) { field.Color = color; field.State = FieldStateEnum.Filled; return StateEnum.FieldFilled; } return StateEnum.FieldEmpty; }
public static Field NewField(byte id) { var field = new Field(); field.Id = id; field.State = FieldStateEnum.Empty; Color color = System.Windows.Media.Color.FromArgb(10, 255, 255, 255); field.HintColor = new SolidColorBrush(color); field.hintType = HintEnum.NotSet; return field; }
private void GetHint(Field headerRowfield, Field currentRowField) { var headerRow = this.headerRow.First(); if (headerRowfield.InnerColor == currentRowField.InnerColor) { currentRowField.HintType = HintEnum.RightColorRightPosition; } else if (headerRow.Field1.InnerColor == currentRowField.InnerColor || headerRow.Field2.InnerColor == currentRowField.InnerColor || headerRow.Field3.InnerColor == currentRowField.InnerColor || headerRow.Field4.InnerColor == currentRowField.InnerColor) { currentRowField.HintType = HintEnum.RightColorWrongPosition; } else { currentRowField.HintType = HintEnum.WrongColor; } }