/// <summary> /// Reads in the map file at the specified path, returning null if any exceptions are encountered /// </summary> public static List <MapFileRow> SafeMapFileRowRead(string file) { try { return(MapFileRow.Read(file).ToList()); } catch (Exception err) { Log.Error("MapFileResover.Create(): " + file + " \tError: " + err.Message); return(null); } }
/// <summary> /// Parses the contents as a MapFile, if error returns a new empty map file /// </summary> private static MapFile SafeRead(string filename, IEnumerable <string> contents, string market) { var permtick = Path.GetFileNameWithoutExtension(filename); try { return(new MapFile(permtick, contents.Select(s => MapFileRow.Parse(s, market)))); } catch { return(new MapFile(permtick, Enumerable.Empty <MapFileRow>())); } }
/// <summary> /// Initializes a new instance of the <see cref="MapFileRowEntry"/> class /// </summary> /// <param name="entitySymbol">The map file that produced this row</param> /// <param name="mapFileRow">The map file row data</param> public MapFileRowEntry(string entitySymbol, MapFileRow mapFileRow) { MapFileRow = mapFileRow; EntitySymbol = entitySymbol; }