Skip to content

C# implementation/port of the Android loaders, for better task handling

License

Notifications You must be signed in to change notification settings

martinhoess/netLoader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

netLoader

C# implementation/port of the Android loaders, for better task/async handling

Example

Func<string, InetLoader, string> Load = delegate(string input, InetLoader l)
{
	(DateTime.Now + TimeSpan.FromSeconds(5)).With(time => { while (DateTime.Now < time) ; }); // Simulate long runing operation
	// l.Cancel(0, true);
	// throw new Exception("");
	return "Loaded Data";
};

netLoaderFuncLoader loader = new netLoaderFuncLoader("TEST LOADER", null, Load, null);
loader.FuncParams = new object[] { "input value", loader };
loader.OnLoadStart += (l) => Debug.WriteLine($"{l.Name} start");
loader.OnLoadFinished += (l) => Debug.WriteLine($"{l.Name} finished with data:<{l.Data}>");
loader.OnLoadCanceled += (l) => Debug.WriteLine($"{l.Name} canceled");
loader.OnLoadFailed += (l) => Debug.WriteLine($"{l.Name} failed");
loader.AsyncLoad();

About

C# implementation/port of the Android loaders, for better task handling

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages