This project is read-only.

LoadManager class

Методы

 

Load

public void Load(string url)

 Create new WebClient oblect and call DownloadStringAsync method.

Свойства

 

Encoding

public int Encoding 

Set data encoding.

Important! To work with different encodings MSPToolkit.dll library used. It`s already added to the project.

This paramenter is not obligatory, but sometimes, for example, to work with 1251 encoding, it must be used.

SaveTo

public string SaveTo 

Name for local file, where data will be stored. File will be located in application isolated storage.

События

 

OnCancel

public event System.Action OnCancel 

Calls on cancel request.

OnError

public event System.Action<Exception> OnError 

Calls on load data exception rise.

OnFinish

public event System.Action OnFinish 

Calls on load finished, with error or without it.

Very useful to use it for hiding progress bar.

OnLoad

public event System.Action<string> OnLoad 

 Срабатывает при удачной загрузке данных.

Call on load success.

OnNoNetwork

public event System.Action OnNoNetwork 

Call on network unavailable.

If network found, but internet is not available, OnError event will be called with resource unavailable message.

OnProgress

public event System.Action<DownloadProgressChangedEventArgs> OnProgress 

Call on request progress changed.

OnStart

public event System.Action OnStart 

Call on request start.

Very useful for hide progress bar.

FileManager class

Методы

 

Read

public void Read(string FileName)

Open file in read mode.

Save

public void Save(string FileName, string Data)

Open existing file in write mode or create new file.

Свойства

 

WriteAfter

public string WriteAfter 

String, will be added at the and of the data.

Sometimes XML file can`t be serialized because wrong XML format. For example root node is absent. So, root node can be added in this way.

WriteBefore

public string WriteBefore 

String, will be added before data (like WriteAfter).

События

 

OnReadError

public event System.Action<Exception> OnReadError 

 Срабатывает при возникновении ошибки чтения файла.

OnReadFileMissing

public event System.Action OnReadFileMissing 

Call on file absent. If this exception intercepted, OnReadError event will not called.

OnReadReady

public event System.Action<StreamReader> OnReadReady 

Call on file opened and stream ready.

OnSaveError

public event System.Action<Exception> OnSaveError 

Call on file write error.

Last edited Jan 1, 2013 at 9:39 PM by vbilenko, version 5

Comments

No comments yet.