public bool LoadFromDataReader(string path, string sectionName) { bool bAutoReplace = this.m_owner.CRLFReplaceTime == NTextManager.CRLFReplaceTimeType.LOADING; try { NDataReader nDataReader = new NDataReader(); nDataReader.UseFileNameEncryption = this.m_UseFileNameEncryption; nDataReader.Load(path); NDataSection nDataSection = nDataReader[sectionName]; foreach (NDataReader.Row row in nDataSection) { int textKeyStartColumnIndex = NTextManager.TextKeyStartColumnIndex; string column = row.GetColumn(textKeyStartColumnIndex, bAutoReplace); string column2 = row.GetColumn(textKeyStartColumnIndex + 1, bAutoReplace); this.SetText(column, column2); } return(true); } catch (Exception output) { this._OutputDebugLine(output); } return(false); }
public static bool NDataReader_LoadFromText() { string strContext = Example.NDataReader_MakeTestContext(); NDataReader nDataReader = new NDataReader(); bool result = nDataReader.LoadFrom(strContext); int num = 0; foreach (NDataReader.Row row in nDataReader["Table"]) { num++; Console.WriteLine(row.ToDataString()); } NDataSection nDataSection = nDataReader["Table"]; object[] array = new object[] { 0, string.Empty, 0f }; foreach (NDataReader.Row row2 in nDataSection) { result = row2.GetColumn(ref array); } return(result); }
public bool Load(string filename) { using (NDataReader nDataReader = new NDataReader()) { nDataReader.Load(filename); NDataSection nDataSection = nDataReader["Table"]; foreach (NDataReader.Row row in nDataSection) { if (!this.ParseRowData(row)) { return(false); } } } return(true); }
public NoKeyDataException(NDataReader owner, NDataSection section, string keyName) : base(string.Format("NoKeyDataException: FileName : {0}, SectionName : {1}, KeyName : {2}", (!(owner.FileName != string.Empty)) ? "[DownloadString]" : owner.FileName, section._sectionName, keyName)) { this.strNoSectionException = this.Message; Debug.LogError(this.strNoSectionException); }