コード例 #1
0
        private Intent init(Intent intent)
        {
            var loginIntent = new Intent(ServiceAction.INIT.ToString());

            Log.Info("SharpXmppDemo", this.Class.ToString() + "Accepted intend to init from form-provided connection strings");

            String jid      = intent.GetStringExtra(ServiceMessage.JID);
            String password = intent.GetStringExtra(ServiceMessage.PASSWORD);
            String name     = intent.GetStringExtra(ServiceMessage.TAG);

            try
            {
                xmppConnection = new SharpComms(jid, password, name, (IUIThreadDispatcher)osDispatcher);

                loginIntent.PutExtra(ServiceMessage.OK, true);
            }
            catch (Exception e)
            {
                Log.Error("SharpXmppDemo", this.Class.ToString() + "Error at updating TrustVillage" + e.ToString() + e.StackTrace);
                loginIntent.PutExtra(ServiceMessage.OK, false);
            }

            return(loginIntent);
        }
コード例 #2
0
        private Intent init(Intent intent)
        {
            var loginIntent = new Intent(ServiceAction.INIT.ToString());

            Log.Info("SharpXmppDemo", this.Class.ToString() + "Accepted intend to init from form-provided connection strings");

            String jid = intent.GetStringExtra(ServiceMessage.JID);
            String password = intent.GetStringExtra(ServiceMessage.PASSWORD);
            String name = intent.GetStringExtra(ServiceMessage.TAG);

            try
            {
                xmppConnection = new SharpComms(jid, password, name, (IUIThreadDispatcher)osDispatcher);

                loginIntent.PutExtra(ServiceMessage.OK, true);
            }
            catch (Exception e)
            {
                Log.Error("SharpXmppDemo", this.Class.ToString() + "Error at updating TrustVillage" + e.ToString() + e.StackTrace);
                loginIntent.PutExtra(ServiceMessage.OK, false);
            }

            return loginIntent;
        }