Пример #1
0
        public async Task<bool> SaveBook()
        {
            // save to some db
            using (SQLiteConnection conn = new SQLiteConnection(App.DatabasePath))
            {
                conn.CreateTable<Book>();
                int rowsInserted = conn.Insert(this);

                Dictionary<string, string> keyValuePairs = new Dictionary<string, string>
                {
                    { "book_info", ToString() },
                    { "network", "Cellular" }
                };
                AppCenterHelper.TrackEvent("book_saved", keyValuePairs);

                return rowsInserted > 0;
            }


            //try
            //{
            //    await client.GetTable<Book>().InsertAsync(this);
            //    return true;
            //}
            //catch(MobileServiceInvalidOperationException msioe)
            //{
            //    var response = await msioe.Response.Content.ReadAsStringAsync();
            //    return false;
            //}
            //catch (Exception ex)
            //{
            //    return false;
            //}
        }
Пример #2
0
        public bool SaveBook()
        {
            // save to some db
            Dictionary <string, string> keyValuePairs = new Dictionary <string, string>
            {
                { "book_info", ToString() },
                { "network", "Cellular" }
            };

            AppCenterHelper.TrackEvent("book_saved", keyValuePairs);
            return(true);
        }
 async void LoginButton_Clicked(object sender, System.EventArgs e)
 {
     try
     {
         //TODO: adding login
         Dictionary <string, string> keyValuePairs = new Dictionary <string, string>
         {
             { "user", "*****@*****.**" },
             { "network", "WiFi" }
         };
         AppCenterHelper.TrackEvent("logged_in", keyValuePairs);
         await Navigation.PopModalAsync(true);
     }
     catch (Exception ex)
     {
         Dictionary <string, string> keyValuePairs = new Dictionary <string, string>
         {
             { "Signal", "Strong" },
             { "NewUser", "False" },
             { "WiFi", "On" }
         };
         AppCenterHelper.TrackError(ex, keyValuePairs);
     }
 }
Пример #4
0
 async void AddNewBook_Clicked(object sender, System.EventArgs e)
 {
     AppCenterHelper.TrackEvent("add_book_intent");
     await Navigation.PushAsync(new NewBookPage());
 }
Пример #5
0
 async void LoginButton_Clicked(object sender, System.EventArgs e)
 {
     AppCenterHelper.TrackEvent("login_intent");
     await Navigation.PushModalAsync(new LoginPage());
 }