Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace imgMessCons
- {
- class TableTranslation
- {
- private List<Char> tableTranslation;
- public TableTranslation()
- {
- this.tableTranslation = new List<char>();
- //part first - english capital letters
- this.tableTranslation.Add('A');
- this.tableTranslation.Add('B');
- this.tableTranslation.Add('C');
- this.tableTranslation.Add('D');
- this.tableTranslation.Add('E');
- this.tableTranslation.Add('F');
- this.tableTranslation.Add('G');
- this.tableTranslation.Add('H');
- this.tableTranslation.Add('I');
- this.tableTranslation.Add('J');
- this.tableTranslation.Add('K');
- this.tableTranslation.Add('L');
- this.tableTranslation.Add('M');
- this.tableTranslation.Add('N');
- this.tableTranslation.Add('O');
- this.tableTranslation.Add('P');
- this.tableTranslation.Add('Q');
- this.tableTranslation.Add('R');
- this.tableTranslation.Add('S');
- this.tableTranslation.Add('T');
- this.tableTranslation.Add('U');
- this.tableTranslation.Add('V');
- this.tableTranslation.Add('W');
- this.tableTranslation.Add('X');
- this.tableTranslation.Add('Y');
- this.tableTranslation.Add('Z');
- // part second - english small letters
- this.tableTranslation.Add('a');
- this.tableTranslation.Add('b');
- this.tableTranslation.Add('c');
- this.tableTranslation.Add('d');
- this.tableTranslation.Add('e');
- this.tableTranslation.Add('f');
- this.tableTranslation.Add('g');
- this.tableTranslation.Add('h');
- this.tableTranslation.Add('i');
- this.tableTranslation.Add('j');
- this.tableTranslation.Add('k');
- this.tableTranslation.Add('l');
- this.tableTranslation.Add('m');
- this.tableTranslation.Add('n');
- this.tableTranslation.Add('o');
- this.tableTranslation.Add('p');
- this.tableTranslation.Add('q');
- this.tableTranslation.Add('r');
- this.tableTranslation.Add('s');
- this.tableTranslation.Add('t');
- this.tableTranslation.Add('u');
- this.tableTranslation.Add('v');
- this.tableTranslation.Add('w');
- this.tableTranslation.Add('x');
- this.tableTranslation.Add('y');
- this.tableTranslation.Add('z');
- //part third - ukrainian and russian capital letters
- this.tableTranslation.Add('А');
- this.tableTranslation.Add('Б');
- this.tableTranslation.Add('В');
- this.tableTranslation.Add('Г');
- this.tableTranslation.Add('Д');
- this.tableTranslation.Add('Е');
- this.tableTranslation.Add('Ё');
- this.tableTranslation.Add('Ж');
- this.tableTranslation.Add('З');
- this.tableTranslation.Add('И');
- this.tableTranslation.Add('Й');
- this.tableTranslation.Add('К');
- this.tableTranslation.Add('Л');
- this.tableTranslation.Add('М');
- this.tableTranslation.Add('Н');
- this.tableTranslation.Add('О');
- this.tableTranslation.Add('П');
- this.tableTranslation.Add('Р');
- this.tableTranslation.Add('С');
- this.tableTranslation.Add('Т');
- this.tableTranslation.Add('У');
- this.tableTranslation.Add('Ф');
- this.tableTranslation.Add('Х');
- this.tableTranslation.Add('Ц');
- this.tableTranslation.Add('Ч');
- this.tableTranslation.Add('Ш');
- this.tableTranslation.Add('Щ');
- this.tableTranslation.Add('Ъ');
- this.tableTranslation.Add('Ы');
- this.tableTranslation.Add('Ь');
- this.tableTranslation.Add('Э');
- this.tableTranslation.Add('Ю');
- this.tableTranslation.Add('Я');
- this.tableTranslation.Add('Ґ');
- this.tableTranslation.Add('І');
- this.tableTranslation.Add('Ї');
- this.tableTranslation.Add('Є');
- //part fourth - russian and ukrainian small letters
- this.tableTranslation.Add('а');
- this.tableTranslation.Add('б');
- this.tableTranslation.Add('в');
- this.tableTranslation.Add('г');
- this.tableTranslation.Add('д');
- this.tableTranslation.Add('е');
- this.tableTranslation.Add('ё');
- this.tableTranslation.Add('ж');
- this.tableTranslation.Add('з');
- this.tableTranslation.Add('и');
- this.tableTranslation.Add('й');
- this.tableTranslation.Add('к');
- this.tableTranslation.Add('л');
- this.tableTranslation.Add('м');
- this.tableTranslation.Add('н');
- this.tableTranslation.Add('о');
- this.tableTranslation.Add('п');
- this.tableTranslation.Add('р');
- this.tableTranslation.Add('с');
- this.tableTranslation.Add('т');
- this.tableTranslation.Add('у');
- this.tableTranslation.Add('ф');
- this.tableTranslation.Add('х');
- this.tableTranslation.Add('ц');
- this.tableTranslation.Add('ч');
- this.tableTranslation.Add('ш');
- this.tableTranslation.Add('щ');
- this.tableTranslation.Add('ъ');
- this.tableTranslation.Add('ы');
- this.tableTranslation.Add('ь');
- this.tableTranslation.Add('э');
- this.tableTranslation.Add('ю');
- this.tableTranslation.Add('я');
- this.tableTranslation.Add('ґ');
- this.tableTranslation.Add('і');
- this.tableTranslation.Add('ї');
- this.tableTranslation.Add('є');
- //part fifth - spesial symbols
- this.tableTranslation.Add('0');
- this.tableTranslation.Add('1');
- this.tableTranslation.Add('2');
- this.tableTranslation.Add('3');
- this.tableTranslation.Add('4');
- this.tableTranslation.Add('5');
- this.tableTranslation.Add('6');
- this.tableTranslation.Add('7');
- this.tableTranslation.Add('8');
- this.tableTranslation.Add('9');
- this.tableTranslation.Add('≠');
- this.tableTranslation.Add('>');
- this.tableTranslation.Add('<');
- this.tableTranslation.Add('≥');
- this.tableTranslation.Add('≤');
- this.tableTranslation.Add('+');
- this.tableTranslation.Add('±');
- this.tableTranslation.Add('∓');
- this.tableTranslation.Add('(');
- this.tableTranslation.Add(')');
- this.tableTranslation.Add('{');
- this.tableTranslation.Add('}');
- this.tableTranslation.Add('[');
- this.tableTranslation.Add(']');
- this.tableTranslation.Add('-');
- this.tableTranslation.Add('*');
- this.tableTranslation.Add('÷');
- this.tableTranslation.Add('∙');
- this.tableTranslation.Add('^');
- this.tableTranslation.Add('&');
- this.tableTranslation.Add('\\');
- this.tableTranslation.Add('/');
- this.tableTranslation.Add('|');
- this.tableTranslation.Add('@');
- this.tableTranslation.Add('#');
- this.tableTranslation.Add('$');
- this.tableTranslation.Add('&');
- this.tableTranslation.Add('_');
- this.tableTranslation.Add('~');
- this.tableTranslation.Add('`');
- this.tableTranslation.Add('\'');
- this.tableTranslation.Add('\"');
- this.tableTranslation.Add('\n');
- this.tableTranslation.Add('\t');
- this.tableTranslation.Add('\v');
- this.tableTranslation.Add('\b');
- this.tableTranslation.Add('\r');
- this.tableTranslation.Add('\a');
- this.tableTranslation.Add('\0');
- this.tableTranslation.Add(':');
- this.tableTranslation.Add('.');
- this.tableTranslation.Add(',');
- this.tableTranslation.Add('!');
- this.tableTranslation.Add('?');
- this.tableTranslation.Add(';');
- this.tableTranslation.Add(' ');
- this.tableTranslation.Add('№');
- //extra special symbol - for all undefined other symbols
- this.tableTranslation.Add('☻');
- //extra special symbol - end of string
- this.tableTranslation.Add('☺');
- }
- public int GetLength()
- {
- return this.tableTranslation.Count;
- }
- public char GetSymbol(int key)
- {
- char ch;
- if ((key < 0) && (key > 255))
- {
- ch = this.tableTranslation[this.tableTranslation.Count - 2];
- }
- else
- {
- ch = this.tableTranslation[key];
- }
- return ch;
- }
- public int GetIndex(char ch)
- {
- int key = 0;
- try
- {
- key = this.tableTranslation.IndexOf(ch);
- }
- catch (Exception e)
- {
- }
- if((key < 0) || (key > 255))
- {
- key = this.tableTranslation.Count - 2;
- }
- return key;
- }
- }
- }
Add Comment
Please, Sign In to add comment