ScriptStack 1.0.4
Loading...
Searching...
No Matches
ScannerPrototype.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.IO;
5
7
9{
10
11 internal class ScannerPrototype : Scanner {
12
13 #region Public Methods
14
15 public List<string> Scan(string source)
16 {
17
18 try
19 {
20
21 List<string> lines = new List<string>();
22
23 StreamReader streamReader = new StreamReader(source);
24
25 while (!streamReader.EndOfStream)
26 lines.Add(streamReader.ReadLine());
27
28 streamReader.Close();
29
30 return lines;
31
32 }
33 catch (Exception exception)
34 {
35 throw new ScriptStackException("Beim einlesen der Datei '" + source + "' ist ein Fehler aufgetreten.", exception);
36 }
37
38 }
39
40 #endregion
41
42 }
43
44}
An interface to modify the default process of reading text files into Script's.
Definition Scanner.cs:116