public static IDataSet Read(string ipAddress, int port, string dataBase, string tags, string filterExpression, bool isDevmode) { if (dataBase == null) { throw new ArgumentNullException("database"); } if (tags == null) { throw new ArgumentNullException("tags"); } if (filterExpression == null) { throw new ArgumentNullException("filterExpression"); } var dic = new Dictionary <string, object>(); dic.Add("type", "bin"); dic.Add("tags", tags); dic.Add("database", dataBase); dic.Add("devmode", isDevmode); if (filterExpression != string.Empty) { dic.Add("filter", filterExpression); } var items = dic.Select(i => string.Format("{0}=\"{1}\"", i.Key, i.Value)).ToArray(); var name = string.Join(";", items); using (var stream = new RemoteStream(ipAddress, port + 1, name)) { return(CremaReader.Read(stream)); } }
public static IDataSet Read(string filename, ReadOptions options) { Stream stream = new FileStream(filename, FileMode.Open, FileAccess.Read); return(CremaReader.Read(stream, options)); }