public T GetRowByIndex(int index) { if ((index >= 0) && (index < this.m_Count)) { return(this.m_Rows[index]); } ToolFunctions.LogException(new Exception(this.m_FileName + " can't find row! row index = " + index)); return(null); }
/// <summary> /// 使用数据表 /// </summary> /// <param name="tableName">表名</param> /// <param name="isEncrypt">是否加密</param> /// <returns></returns> public static MemoryStream ReadTable(string tableName, bool isEncrypt = false) { try{ MemoryStream buffer = ReadFileByBytes(tableName); return(buffer); }catch (Exception e) { ToolFunctions.LogException(e); return(new MemoryStream()); } }
private T Row(int ID) { if (((this.m_LastIndex >= 0) && (this.m_LastIndex < this.m_Count)) && (this.m_Rows[this.m_LastIndex].GetIndex() == ID)) { return(this.m_Rows[this.m_LastIndex]); } int index = this.BinarySearch(0, this.m_Count - 1, ID); if (index < 0) { ToolFunctions.LogException(new Exception(this.m_FileName + " can't find row! rowID = " + ID)); return(null); } this.m_LastIndex = index; return(this.m_Rows[index]); }