c# - Returning data via WCF service -



c# - Returning data via WCF service -

i want homecoming latitude , longitude variables via wcf show user's location on map. can homecoming latitude, can't same thing longitude, because method returns 1 value. thought returning array, don't know how that. here wp code:

void proxy_getusrlatcompleted(object sender, servicereference1.getusrlatcompletedeventargs e) { grid mygrid = new grid(); mygrid.rowdefinitions.add(new rowdefinition()); mygrid.rowdefinitions.add(new rowdefinition()); mygrid.background = new solidcolorbrush(colors.transparent); rectangle myrectangle = new rectangle(); myrectangle.fill = new solidcolorbrush(colors.black); myrectangle.height = 20; myrectangle.width = 20; myrectangle.setvalue(grid.rowproperty, 0); myrectangle.setvalue(grid.columnproperty, 0); mygrid.children.add(myrectangle); polygon mypolygon = new polygon(); mypolygon.points.add(new point(2, 0)); mypolygon.points.add(new point(22, 0)); mypolygon.points.add(new point(2, 40)); mypolygon.stroke = new solidcolorbrush(colors.black); mypolygon.fill = new solidcolorbrush(colors.black); mypolygon.setvalue(grid.rowproperty, 1); mypolygon.setvalue(grid.columnproperty, 0); mygrid.children.add(mypolygon); mapoverlay myoverlay = new mapoverlay(); myoverlay.content = mygrid; myoverlay.positionorigin = new point(0, 0.5); maplayer mylayer = new maplayer(); mylayer.add(myoverlay); mymap.layers.add(mylayer); float glat = float.parse(e.result); mymap.center = new geocoordinate(glat, glong); myoverlay.geocoordinate = new geocoordinate(glat, glong); }

you must define class hold both properties, , utilize homecoming value:

class point { public string lat {get;set;} public string lon {get;set} } public point getusrlocation(string uname) { dataclasses1datacontext info = new dataclasses1datacontext(); homecoming (from s in data.users s.usrname == uname select new point(){lat=s.usrlat,lon=s.usrlong}).single(); }

c# wcf windows-phone-8 geolocation

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -