Example #1
0
        void Handle_Clicked_1(object sender, System.EventArgs e)
        {
            var logmeout = new Authenticate.CloudData();

            logmeout.Logout();

            var home = new Views.AboutPage();

            App.Current.MainPage = home;
        }
Example #2
0
        async void Handle_Clicked_1(object sender, System.EventArgs e)
        {
            var logmeout = new Authenticate.CloudData();

            logmeout.Logout();

            var home = new Views.AboutPage();
            // Navigate to our scanner page
            await Navigation.PushModalAsync(home);

            NavigationPage.SetHasBackButton(this, false);
        }
        async void CallAuthenticate()

        {
            var x = new CloudData();
            AuthenticationResult token = await x.GetAccessToken();

            System.Diagnostics.Debug.WriteLine("Debug: access token " + token);

            if (token == null)

            {
                await DisplayAlert("Alert", "User has cancelled login or the browser is incompatible", "OK");

                var About = new Views.AboutPage();

                // Navigate to our scanner page
                //await Navigation.PushModalAsync(About);
                //NavigationPage.SetHasBackButton(this, false);

                Application.Current.MainPage = About;

                return;
            }

            GraphUser y = await x.GetDisplayName();

            //await DisplayAlert("Alert", "Welcome, " + y, "OK");

            var displayName = new Item
            {
                Id   = y.displayName,
                Text = "Welcome! You have successfully logged in"
            };

            var Scanner = new Scanner.Scanner();

            Scanner.BindingContext = displayName;

            // Navigate to our scanner page
            //await Navigation.PushModalAsync(Scanner);
            //NavigationPage.SetHasBackButton(this, false);

            Application.Current.MainPage = Scanner;
        }
        async public void SubmitCodeToCloud(string code)

        {
            //string encodedString = Base64Encode(code);

            System.Diagnostics.Debug.WriteLine("Debug: user is attempting to submit code of length " + code.Length + ":" + code);

            var submit = new CloudData();

            var response = await submit.PostBarcode(code);

            if (response == "OK")

            {
                var action = await DisplayAlert("Success", "Your barcode was successfully stored in the Cloud. Scan another?", "OK", "Cancel");

                if (action)

                {
                    var scanPage = new FullScreenScanning();
                    // Navigate to our scanner page
                    await Navigation.PushModalAsync(scanPage);

                    NavigationPage.SetHasBackButton(this, false);
                }

                else

                {
                    var About = new Views.AboutPage();

                    // Navigate to our scanner page
                    await Navigation.PushModalAsync(About);

                    NavigationPage.SetHasBackButton(this, false);
                }
            }

            else

            {
                await DisplayAlert("Alert", "An error occurred, please scan and submit your barcode again", "OK");
            }
        }
Example #5
0
        void Handle_Clicked(object sender, System.EventArgs e)
        {
            var About = new Views.AboutPage();

            if (_scanView.IsScanning == true)
            {
                _scanView.IsScanning = false;

                System.Diagnostics.Debug.WriteLine("Debug: On click has been called, setting IsScanning to false");
            }
            if (_scanView.IsAnalyzing == true)

            {
                _scanView.IsAnalyzing = false;
                System.Diagnostics.Debug.WriteLine("Debug: On click has been called, setting IsAnalyzing to false");
            }
            // Navigate to our scanner page
            //await Navigation.PushModalAsync(About);

            Application.Current.MainPage = About;
        }