C# Class Simplify.Web.Modules.Data.FileReader

Provides localizable files reader, reads the files from data folder
Inheritance: IFileReader
Show file Open project: i4004/Simplify.Web Class Usage Examples

Public Methods

Method Description
ClearCache ( ) : void

Clears the cache.

FileReader ( string dataPhysicalPath, string defaultLanguage, ILanguageManagerProvider languageManagerProvider, bool disableCache = false ) : System

Initializes a new instance of the FileReader class.

GetFilePath ( string fileName ) : string

Get file path

GetFilePath ( string fileName, string language ) : string

Get extension data file path for specific language

LoadTextDocument ( string fileName, bool memoryCache = false ) : string

Load text from a extension data file

LoadTextDocument ( string fileName, string language, bool memoryCache = false ) : string

Load text from a file with specific language

LoadXDocument ( string fileName, bool memoryCache = false ) : System.Xml.Linq.XDocument

Load xml document from a file

LoadXDocument ( string fileName, string language, bool memoryCache = false ) : System.Xml.Linq.XDocument

Load xml document from a file with specific language

Setup ( ) : void

Setups the file reader.

Private Methods

Method Description
TryToLoadTextDocumentFromCache ( string fileName, string language, string &data ) : bool
TryToLoadXDocumentFromCache ( string fileName, string language, System.Xml.Linq.XDocument &data ) : bool

Method Details

ClearCache() public static method

Clears the cache.
public static ClearCache ( ) : void
return void

FileReader() public method

Initializes a new instance of the FileReader class.
public FileReader ( string dataPhysicalPath, string defaultLanguage, ILanguageManagerProvider languageManagerProvider, bool disableCache = false ) : System
dataPhysicalPath string The data physical path.
defaultLanguage string The default language.
languageManagerProvider ILanguageManagerProvider The language manager provider.
disableCache bool Disable FileReader cache.
return System

GetFilePath() public method

Get file path
public GetFilePath ( string fileName ) : string
fileName string File name
return string

GetFilePath() public method

Get extension data file path for specific language
public GetFilePath ( string fileName, string language ) : string
fileName string File name
language string File language
return string

LoadTextDocument() public method

Load text from a extension data file
public LoadTextDocument ( string fileName, bool memoryCache = false ) : string
fileName string File name
memoryCache bool Load file from memory cache if possible.
return string

LoadTextDocument() public method

Load text from a file with specific language
public LoadTextDocument ( string fileName, string language, bool memoryCache = false ) : string
fileName string File name
language string File language
memoryCache bool Load file from memory cache if possible.
return string

LoadXDocument() public method

Load xml document from a file
public LoadXDocument ( string fileName, bool memoryCache = false ) : System.Xml.Linq.XDocument
fileName string File name
memoryCache bool Load file from memory cache if possible.
return System.Xml.Linq.XDocument

LoadXDocument() public method

Load xml document from a file with specific language
public LoadXDocument ( string fileName, string language, bool memoryCache = false ) : System.Xml.Linq.XDocument
fileName string File name
language string File language
memoryCache bool Load file from memory cache if possible.
return System.Xml.Linq.XDocument

Setup() public method

Setups the file reader.
public Setup ( ) : void
return void