Permalink
Browse files

Change CSVSource.ToList returns IList<T>

  • Loading branch information...
1 parent 2861765 commit dcc9ed455d0b51b4a022bb0e3d4ad968b8f86d26 @udawtr committed Apr 17, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 LibCSV/CSVSource.cs
View
@@ -485,13 +485,13 @@ private string[] GetCSVLine()
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1000")]
- public static ReadOnlyCollection<T> ToList(string filename)
+ public static IList<T> ToList(string filename)
{
return ToList(filename, Encoding.GetEncoding(932));
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1000")]
- public static ReadOnlyCollection<T> ToList(string filename, Encoding encoding)
+ public static IList<T> ToList(string filename, Encoding encoding)
{
using(var stream =new FileStream(filename, FileMode.Open))
{
@@ -500,13 +500,13 @@ public static ReadOnlyCollection<T> ToList(string filename, Encoding encoding)
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1000")]
- public static ReadOnlyCollection<T> ToList(Stream stream)
+ public static IList<T> ToList(Stream stream)
{
return ToList(stream, Encoding.GetEncoding(932));
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1000")]
- public static ReadOnlyCollection<T> ToList(Stream stream, Encoding encoding)
+ public static IList<T> ToList(Stream stream, Encoding encoding)
{
var rows = new List<T>();
using(var reader =new CSVSource<T>(stream, encoding))
@@ -516,7 +516,7 @@ public static ReadOnlyCollection<T> ToList(Stream stream, Encoding encoding)
rows.Add(reader.ReadNext());
}
}
- return new ReadOnlyCollection<T>(rows);
+ return rows;
}
public void Close()

0 comments on commit dcc9ed4

Please sign in to comment.