Ejemplo n.º 1
0
        public AdditionalSymbols ProcessAdditionalSymbolsFile(string input)
        {
            AdditionalSymbols additionalSymbols = new AdditionalSymbols();

            using (StreamReader iFile = new StreamReader(input))
            {
                while (!iFile.EndOfStream)
                {
                    string   line   = iFile.ReadLine();
                    string[] values = line.Split(new char[] { ';' });

                    if (values[0] == "")
                    {
                        char ch   = '\0';
                        int  code = int.Parse(values[1]);
                        additionalSymbols.Add(new AdditionalSymbol(ch, code));
                    }
                    else
                    {
                        char ch   = char.Parse(values[0]);
                        int  code = int.Parse(values[1]);

                        additionalSymbols.Add(new AdditionalSymbol(ch, code));
                    }
                }
            }

            return(additionalSymbols);
        }
Ejemplo n.º 2
0
 public void AddAdditionalSymbols(string input)
 {
     if (input != null)
     {
         FileProcessor fileProcessor = new FileProcessor();
         additionalSymbols = fileProcessor.ProcessAdditionalSymbolsFile(input);
     }
 }