Esempio n. 1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Second);

            // Create your application here
            var btnSend       = FindViewById <Button> (Resource.Id.btnSendMessage);
            var btnCustomPost = FindViewById <Button> (Resource.Id.btnCustomEvent);
            var edtMessage    = FindViewById <EditText> (Resource.Id.edtMessage);

            btnSend.Click += (object sender, EventArgs e) => {
                var message = edtMessage.Text;

                //Creare a MessageBusEvent
                var aEvent = new CoreMessageBusEvent(kEventID)
                {
                    Sender = this,
                    Data   = new object[] { message },
                };

                //send it
                MessageBus.Default.Post(aEvent);
            };

            btnCustomPost.Click += (object sender, EventArgs e) => {
                MessageBus.Default.Post(new CustomMessageBusEvent());
            };
        }
        protected override void OnResume()
        {
            base.OnResume();

            var newEvent = new CoreMessageBusEvent("OutletListItemViewAppeared");

            MessageBus.PostEvent(newEvent);
        }
Esempio n. 3
0
        private void OnSortByOutletIDClick(object sender, EventArgs e)
        {
            SortBy = "OutletID";
            GlobalsAndroid.SortBy = SortBy;
            var newEvent = new CoreMessageBusEvent("OutletListSort");

            MessageBus.PostEvent(newEvent);

            Finish();
        }
Esempio n. 4
0
        partial void didSendMessage(AppKit.NSButton sender)
        {
            var message = txtMessage.StringValue;

            //Creare a MessageBusEvent
            var aEvent = new CoreMessageBusEvent(kEventID)
            {
                Sender = this,
                Data   = new object[] { message },
            };

            //send it
            MessageBus.Default.Post(aEvent);
        }
Esempio n. 5
0
        private void CheckDownloadResult(object state)
        {
            Activity.RunOnUiThread(() =>
            {
                progress.Hide();
                progress.Dismiss();
            });

            if (Core.Globals.GetFileNameResult == GetFileNameResultType.Success)
            {
                // Success
                if (Core.Globals.DownloadMasterDBResult == DownloadDBResultType.Success)
                {
                    if (Core.Globals.DownloadAuditDBResult == DownloadDBResultType.Success)
                    {
                        // Master & Audit DB are downloaded.
                        var newEvent = new CoreMessageBusEvent("SyncFinished");
                        MessageBus.PostEvent(newEvent);
                    }
                    else if (Core.Globals.DownloadAuditDBResult == DownloadDBResultType.NotFoundError || Core.Globals.DownloadAuditDBResult == DownloadDBResultType.BadRequestError)
                    {
                        Activity.RunOnUiThread(() =>
                        {
                            ShowErrorDialog("Audit database file cannot be retrieved. You can still be able to use the app.");
                        });
                    }
                }
                else if (Core.Globals.DownloadMasterDBResult == DownloadDBResultType.NotFoundError || Core.Globals.DownloadMasterDBResult == DownloadDBResultType.BadRequestError)
                {
                    Activity.RunOnUiThread(() =>
                    {
                        ShowErrorDialog("Master database file cannot be retrieved. You can still use the existing database.");
                    });
                }
            }
            else
            {
                // Error
                Activity.RunOnUiThread(() =>
                {
                    ShowErrorDialog("It looks like you are in an error that does not have the data service or the database file information cannot be retrieved.");
                });
            }
        }
Esempio n. 6
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            btnSend.TouchUpInside += (object sender, EventArgs e) => {
                var message = edtMessage.Text;

                //Creare a MessageBusEvent
                var aEvent = new CoreMessageBusEvent(kEventID)
                {
                    Sender = this,
                    Data   = new object[] { message },
                };

                //send it
                MessageBus.Default.Post(aEvent);
            };

            btnCustomPost.TouchUpInside += (object sender, EventArgs e) => {
                MessageBus.Default.Post(new CustomMessageBusEvent());
            };
        }
Esempio n. 7
0
        public SecondPage()
        {
            InitializeComponent();

            btnPostMessage.Click += (object sender, RoutedEventArgs e) =>
            {
                var message = edtMessage.Text;

                //Creare a MessageBusEvent
                var aEvent = new CoreMessageBusEvent(kEventID)
                {
                    Sender = this,
                    Data   = new object[] { message },
                };

                //send it
                MessageBus.Default.Post(aEvent);
            };

            btnPostCustom.Click += (object sender, RoutedEventArgs e) =>
            {
                MessageBus.Default.Post(new CustomMessageBusEvent());
            };
        }