public bool LoadFromText(string strText, IUpdateCustomCacheInfo updateCustomCacheInfo) { if (updateCustomCacheInfo != null) { this.UpdateCustomCacheInfo = updateCustomCacheInfo; } bool result; try { NDataReader nDataReader = new NDataReader(); if (!nDataReader.LoadFrom(strText)) { this._OutputDebug(string.Format("NDataReader.LoadFromText failed: {0}", strText)); this.m_bLoadedOrSkipped = false; result = false; } else { this.FilesList.Clear(); this.m_bLoadedOrSkipped = this.ReadFinalList2(ref nDataReader); result = this.m_bLoadedOrSkipped; } } catch (Exception arg) { this._OutputDebug(string.Format("The process failed: {0}", arg)); this.m_bLoadedOrSkipped = false; result = false; } return(result); }
public bool LoadFromComp(byte[] gzData, IUpdateCustomCacheInfo updateCustomCacheInfo) { string text = this.__open_comp_bzip2(gzData); if (text == null) { text = this.__open_comp_bzip2(gzData); } return(this.LoadFromText(text, updateCustomCacheInfo)); }
public bool Load(string strListFileName, IUpdateCustomCacheInfo updateCustomCacheInfo) { if (updateCustomCacheInfo != null) { this.UpdateCustomCacheInfo = updateCustomCacheInfo; } bool result; try { if (Path.GetExtension(strListFileName).ToLower() == ".zip") { using (FileStream fileStream = new FileStream(strListFileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { using (BinaryReader binaryReader = new BinaryReader(fileStream)) { byte[] gzData = binaryReader.ReadBytes((int)fileStream.Length); result = this.LoadFromComp(gzData, updateCustomCacheInfo); return(result); } } } NDataReader nDataReader = new NDataReader(); if (!nDataReader.Load(strListFileName)) { this.m_bLoadedOrSkipped = false; result = false; } else { this.FilesList.Clear(); this.m_bLoadedOrSkipped = this.ReadFinalList2(ref nDataReader); result = this.m_bLoadedOrSkipped; } } catch (Exception ex) { Console.WriteLine("The process failed: {0}", ex.ToString()); this.m_bLoadedOrSkipped = false; result = false; } return(result); }