/// <summary> /// Initializes a new instance of the <see cref="Code128Glyph"/> class. /// </summary> /// <param name="first">A <see cref="T:Code128SpecialGlyph"/> /// representing the first set object.</param> /// <param name="second">The second set character.</param> /// <param name="third">The third set character.</param> /// <param name="bitEncoding">The glyph bit encoding.</param> public Code128Glyph(Code128SpecialGlyph first, char second, char third, short bitEncoding) : base(new char[] { (char)0, second, third }, bitEncoding) { if (first == Code128SpecialGlyph.None) { throw new ArgumentException("first cannot be None."); } _special = new Code128SpecialGlyph[] { first, Code128SpecialGlyph.None, Code128SpecialGlyph.None }; }
private int GetSetIndex(int set, char character, Code128SpecialGlyph special) { GetGlyphs(); for (int index = 0; index < _glyphs.Length; ++index) { if ((special != Code128SpecialGlyph.None && _glyphs[index].GetSpecialBySet(set) == special) || (special == Code128SpecialGlyph.None && _glyphs[index].GetCharacterBySet(set) == character)) { return(index); } } return(-1); }
private int GetSetIndex(int set, Code128SpecialGlyph special) { return(GetSetIndex(set, (char)0, special)); }
private bool IsInSet(int set, Code128SpecialGlyph special) { return(GetSetIndex(set, (char)0, special) != -1); }