Here's one call to the method:

public OperationResult BeginLogin(string login, string password, string
sessionId, string clientVersion)
        {
            try
            {
                writeLog(string.Format("{0} - {1} - login: {2}, sessionId:
{3}", myName, GetMethodName(1), login, sessionId), 2);
                var request = new RestRequest("MobileLogin", Method.POST);
                request.RequestFormat = DataFormat.Json;
                request.AddBody(new MobileLoginParameters { Login = login,
Password = password, SessionId = sessionId, ClientVersion = clientVersion
});

                client.ExecuteAsync(request, response => 
                {
                    processRestResponse(new LoginResult(), response, () =>
                    {
                        OnLoginComplete(new LoginEventArgs { Result = new
LoginResult { Code = BooleanOperationResultCode.GenericError } });
                    }, (res) =>
                    {
                        if (res.Code == BooleanOperationResultCode.Success)
                            currentSessionId = sessionId;
                        OnLoginComplete(new LoginEventArgs { Result = res
});
                    });
                });
                return new OperationResult { Code =
OperationResultCode.Success };
            }
            catch (Exception e)
            {
                return processErrorInBeginMethod(e);
            }
        }

And I currently have it again while running - all kinds of methods are red
underlined - I have "Cannot implicitly convert to
ClientInterface.LoginResult" for

ClientInterface.LoginResult res = smartAppServer.EndMobileLogin(ar);

(declaration: protected ISmartAppMobile smartAppServer = null;

and ISmartAppMobile interface:

        [OperationContract]
        [WebInvoke()]
        LoginResult MobileLogin(MobileLoginParameters parameters);

)... it goes down to usings that it doesn't like, types or namespaces not
found, etc. Funny thing is that it all runs just fine.

I'm beginning to doubt the VS plugin :(

As for IObservable - it would involve a major rewrite. Currently I have one
monolithic class that does communication for everything (so they all have
access to the same shared information like the remote server reference,
session Id, initialization and connection state) and the quick look I had at
the interface definition makes me think it would mean ripping my connector
class into different bits - one per method.

I've also started looking at TinyMessenger as alternative to all my event
wiring up code, but it seems to me, you cannot quite get around writing
plumbing code in any case. But I fear we're getting off topic now (not that
it's not an interesting topic for discussion..)

Stephan


Wait, you're getting this error at runtime? Usually it's a compile-time
error. It would be interesting to see how you are calling it.

As an aside, you might want to look into IObservable<T> by the way. It
looks a lot like your method signature, but it also abstracts out merging,
fork/join, and marshalling control flow across threads. You might find it
an interesting abstraction.

-Max





--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/cannot-convert-from-lambda-expression-to-System-Action-tp5711402p5711590.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to