//----------------------------------------------------------------------- // // The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // // fiedlchr // 15.10.2013 // Implements the abstract file class //----------------------------------------------------------------------- namespace CampusAppWPortalLib8.Utility { /// File class. /// fiedlchr, 15.10.2013. public abstract class AbstractFile { #region Events /// Delegation of the write callback function prototype. /// fiedlchr, 15.10.2013. public delegate void WriteCallbackFunc(); #endregion #region Method #region public /// Read data from file to a string. /// fiedlchr, 03.09.2013. /// data string. public abstract byte[] ReadFile(); /// Write bytes to the file. /// fiedlchr, 03.09.2013. /// data byte array. /// callback function, called after writing is done. /// callback function, called when writing failed. public abstract void WriteFile(byte[] data, WriteCallbackFunc onSavedCallback, WriteCallbackFunc onFailedCallback); /// Check if a file is existing. /// fiedlchr, 15.10.2013. /// true, if file exists, otherwise false. public abstract bool Exist(); #endregion #endregion } }