private static int Convert(CodeTableColumn fromType, int fromValue, int defaultValue) { int ix_from = (int)fromType; int ix_to = (int)(fromType == CodeTableColumn.CharSet ? CodeTableColumn.CodePage : CodeTableColumn.CharSet); for(int i=0; i<_codeTable.GetLength(0); ++i) { if(fromValue == _codeTable[i, ix_from]) return _codeTable[i, ix_to]; } return defaultValue; }
private static int Convert(CodeTableColumn fromType, int fromValue, int defaultValue) { int ix_from = (int)fromType; int ix_to = (int)(fromType == CodeTableColumn.CharSet ? CodeTableColumn.CodePage : CodeTableColumn.CharSet); for (int i = 0; i < _codeTable.GetLength(0); ++i) { if (fromValue == _codeTable[i, ix_from]) { return(_codeTable[i, ix_to]); } } return(defaultValue); }