logo

Http utily class More...

Public Member Functions

 HttpUtil (string url, System.Net.Cache.RequestCacheLevel cachesettings, string postdata)
 Initializes a new instance of the HttpUtil class. More...
 
 HttpUtil (string url, System.Net.Cache.RequestCacheLevel cachesettings)
 Initializes a new instance of the HttpUtil class. Using no http POST. More...
 
bool Start (RunWorkerCompletedEventHandler workcompleethandler)
 Create a new Http request only if DownloadCompleet event is assigned. More...
 
void Stop ()
 Instantly stop the http worker, if still running. More...
 

Private Member Functions

static bool InternetGetConnectedState (out int description, int ReservedValue)
 
void httpthread_DoWork (object sender, DoWorkEventArgs e)
 Http background worker thread reading stream and writing to memory in string. More...
 
HttpWebRequest CreateHttpWebRequest (string url, System.Net.Cache.RequestCacheLevel cachesettings)
 Create a WebRequest object More...
 
bool IsNetworkConnected ()
 Check if there is internet connection, if not warn user. Uses windows API, other platforms return always true at the moment. More...
 

Private Attributes

readonly string url
 Url of http request, immutable. More...
 
readonly
System.Net.Cache.RequestCacheLevel 
cachesettings
 Cache settings of http request, immutable. More...
 
readonly string postdata
 
BackgroundWorker httpthread
 HTTP backgroundworker thread More...
 

Detailed Description

Constructor & Destructor Documentation

NoteFly.HttpUtil.HttpUtil ( string  url,
System.Net.Cache.RequestCacheLevel  cachesettings,
string  postdata 
)
Parameters
urlThe url of the request to make
cachesettingsThe cache settings (important note: this is always NoCacheNoStore under Mono)
postdataPOST data for a POST Http request.
Returns
NoteFly.HttpUtil.HttpUtil ( string  url,
System.Net.Cache.RequestCacheLevel  cachesettings 
)
Parameters
url
cachesettings

Member Function Documentation

HttpWebRequest NoteFly.HttpUtil.CreateHttpWebRequest ( string  url,
System.Net.Cache.RequestCacheLevel  cachesettings 
)
private
Parameters
urlHttp request url.
cachesettingsHttp cache settings
Returns
A new httpwebrequest object.
void NoteFly.HttpUtil.httpthread_DoWork ( object  sender,
DoWorkEventArgs  e 
)
private
Parameters
senderThe sender object
eDoWorkEvent arguments
static bool NoteFly.HttpUtil.InternetGetConnectedState ( out int  description,
int  ReservedValue 
)
private
bool NoteFly.HttpUtil.IsNetworkConnected ( )
private

Decreated, used for send to twitter/facebook

Returns
true if there is a connection, otherwise return false
bool NoteFly.HttpUtil.Start ( RunWorkerCompletedEventHandler  workcompleethandler)
Parameters
workcompleethandlerThe RunWorkerCompletedEventHandler
Returns
True if http background worker succesfully started
void NoteFly.HttpUtil.Stop ( )

Member Data Documentation

readonly System.Net.Cache.RequestCacheLevel NoteFly.HttpUtil.cachesettings
private
BackgroundWorker NoteFly.HttpUtil.httpthread
private
readonly string NoteFly.HttpUtil.postdata
private
readonly string NoteFly.HttpUtil.url
private