private Size GetRequiredSize(Segment7Character character) { if (character != Segment7Character.Period && character != Segment7Character.Colon && character != Segment7Character.SemiColon && character != Segment7Character.Comma) { return(new Size(10 * this.Size, 18 * this.Size)); } return(new Size(2 * this.Size, 18 * this.Size)); }
void ISegment7.Draw(PaintArgs p, iRectangle r, Segment7Character character) { this.Draw(p, r, character); }
private void Draw(PaintArgs p, iRectangle r, Segment7Character character) { Color colorOn = this.ColorOn; Color offColor = this.GetOffColor(); bool[] array; switch (character) { case Segment7Character.Space: { bool[] array2 = new bool[7]; array = array2; goto IL_01c9; } case Segment7Character.X0: array = new bool[7] { true, true, true, true, true, true, false }; goto IL_01c9; case Segment7Character.X1: array = new bool[7] { false, true, true, false, false, false, false }; goto IL_01c9; case Segment7Character.X2: array = new bool[7] { true, true, false, true, true, false, true }; goto IL_01c9; case Segment7Character.X3: array = new bool[7] { true, true, true, true, false, false, true }; goto IL_01c9; case Segment7Character.X4: array = new bool[7] { false, true, true, false, false, true, true }; goto IL_01c9; case Segment7Character.X5: array = new bool[7] { true, false, true, true, false, true, true }; goto IL_01c9; case Segment7Character.X6: array = new bool[7] { true, false, true, true, true, true, true }; goto IL_01c9; case Segment7Character.X7: array = new bool[7] { true, true, true, false, false, false, false }; goto IL_01c9; case Segment7Character.X8: array = new bool[7] { true, true, true, true, true, true, true }; goto IL_01c9; case Segment7Character.X9: array = new bool[7] { true, true, true, false, false, true, true }; goto IL_01c9; case Segment7Character.XA: array = new bool[7] { true, true, true, false, true, true, true }; goto IL_01c9; case Segment7Character.XB: array = new bool[7] { false, false, true, true, true, true, true }; goto IL_01c9; case Segment7Character.XC: array = new bool[7] { true, false, false, true, true, true, false }; goto IL_01c9; case Segment7Character.XD: array = new bool[7] { false, true, true, true, true, false, true }; goto IL_01c9; case Segment7Character.XE: array = new bool[7] { true, false, false, true, true, true, true }; goto IL_01c9; case Segment7Character.XF: array = new bool[7] { true, false, false, false, true, true, true }; goto IL_01c9; case Segment7Character.ArrowUp: this.DrawArrowUp(p, r); break; case Segment7Character.ArrowDown: this.DrawArrowDown(p, r); break; case Segment7Character.Colon: this.DrawColon(p, r); break; case Segment7Character.Comma: this.DrawComma(p, r); break; case Segment7Character.SemiColon: this.DrawSemiColon(p, r); break; case Segment7Character.Period: this.DrawPeriod(p, r); break; case Segment7Character.Minus: this.DrawMinus(p, r); break; case Segment7Character.Plus: { this.DrawPlus(p, r); break; } IL_01c9: if (array[0]) { this.DrawSegmentA(p, r, colorOn); } else if (this.ShowOffSegments) { this.DrawSegmentA(p, r, offColor); } if (array[1]) { this.DrawSegmentB(p, r, colorOn); } else if (this.ShowOffSegments) { this.DrawSegmentB(p, r, offColor); } if (array[2]) { this.DrawSegmentC(p, r, colorOn); } else if (this.ShowOffSegments) { this.DrawSegmentC(p, r, offColor); } if (array[3]) { this.DrawSegmentD(p, r, colorOn); } else if (this.ShowOffSegments) { this.DrawSegmentD(p, r, offColor); } if (array[4]) { this.DrawSegmentE(p, r, colorOn); } else if (this.ShowOffSegments) { this.DrawSegmentE(p, r, offColor); } if (array[5]) { this.DrawSegmentF(p, r, colorOn); } else if (this.ShowOffSegments) { this.DrawSegmentF(p, r, offColor); } if (array[6]) { this.DrawSegmentG(p, r, colorOn); } else if (this.ShowOffSegments) { this.DrawSegmentG(p, r, offColor); } break; } }
Size ISegment7.GetRequiredSize(Segment7Character character) { return(this.GetRequiredSize(character)); }