//Basic constructor, without building the entity public DataLine(Context context, int lineNumber, string lineText, int columnCount) { IsOk = true; LineNumber = lineNumber; LineText = lineText; LineData = lineText.Split(';'); if (LineData.Count( ) != columnCount) { IsOk = false; ErrorMessage = "Invalid Row"; } }
/// <summary> /// Returns the lines as a Dictionary of key value pairs for a specific locale /// Returns null if locale does not exist /// </summary> /// <param name="locale"></param> /// <returns></returns> public Dictionary <string, string> GetLineDataForLocale(string locale) { if (LocaleKeys.Contains(locale) && LineData.Count() > 0) { Dictionary <string, string> data = new Dictionary <string, string>(); foreach (KeyValuePair <string, Dictionary <string, string> > line in LineData) { if (line.Value.ContainsKey(locale)) { data.Add(line.Key, line.Value[locale]); } else { data.Add(line.Key, ""); } } return(data); } return(null); }