Пример #1
0
 public static void load(string fileName, Graph graph, GraphParser parser)
 {
     StreamReader reader = null;
     try
     {
         reader = new StreamReader(File.Open(fileName, FileMode.Open));
         String line = "";
         while ((line = reader.ReadLine()) != null)
         {
             graph.add(parser(graph, line));
         }
     }
     catch (System.Exception e)
     {
         throw new BadFileFormatException("Unexpected error while parsing '" + fileName + "'.", e);
     }
     finally
     {
         if (reader != null)
         {
             reader.Close();
         }
     }
 }
Пример #2
0
 public void Initialize()
 {
     this.graphParser = new GraphParser();
 }