c# - Wrong Return Type -


i don't understand why getting error of:

'system.collections.generic.list notify.mainpage.webclient_openreadcompleted(object, system.net.openreadcompletedeventargs)' has wrong return type

code:

webclient.openreadcompleted += webclient_openreadcompleted; 

and:

private list<sightingtype> webclient_openreadcompleted(object sender, openreadcompletedeventargs e)         {             datacontractjsonserializer ser = null;             var sightingt = new list<sightingtype>();             try             {                 ser = new datacontractjsonserializer(typeof(observablecollection<sightingtype>));                 observablecollection<sightingtype> sightingtypes = ser.readobject(e.result) observablecollection<sightingtype>;                 foreach (var sightingtype in sightingtypes)                 {                     sightingt.add(sightingtype);                 }             }             catch (exception ex)             {                 messagebox.show(ex.message);             }              return sightingt;         } 

does know going wrong?

the return type of event handler should void:

private void webclient_openreadcompleted(object sender, openreadcompletedeventargs e)         { 

there's nothing @ other end receive return data.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -