private async void Button_AddExtension_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                this.Progress.IsActive = true;
                var dictionary = new Dictionary <string, object>();
                dictionary.Add(this.txtExtension.Text, this.txtExtensionValue.Text);
                await UserExtensionHelper.SetExtension(this.txtExtension.Text, dictionary);

                InfoText.Text = "Extension Added Correctly.Get Extensions....";
                var extensionList = await UserExtensionHelper.GetOpenExtensionsForMe();

                var rmyExtension = extensionList.Where(x => x.Display.Equals(this.txtExtension.Text)).First();
                await UserExtensionHelper.DeleteOpenExtensionForMe(this.txtExtension.Text);

                InfoText.Text = $"Extension {rmyExtension.Display} with value {rmyExtension.Properties[rmyExtension.Display].ToString()}  Added";
            }
            catch (Exception ex)
            {
                InfoText.Text = $"OOPS! An error ocurred: {ex.GetMessage()}";
            }
            finally
            {
                this.Progress.IsActive = false;
            }
        }
        private async void Button_Activity_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Progress.IsActive = true;
                await UserExtensionHelper.CreateActivity();

                InfoText.Text = $"Activity Created see Timeline";
            }
            catch (Exception ex)
            {
                InfoText.Text = $"OOPS! An error ocurred: {ex.GetMessage()}";
            }
            finally
            {
                Progress.IsActive = false;
            }
        }
Ejemplo n.º 3
0
        private async Task NavView_Navigate(NavigationViewItem item)
        {
            try
            {
                UserExtensionHelper.PickupWhereYouLeft(item.Tag.ToString());
                switch (item.Tag)
                {
                case "LogIn":
                    await LoginUser();

                    break;

                case "LogOut":
                    AuthenticationHelper.SignOut();
                    login.Visibility           = Visibility.Visible;
                    logout.Visibility          = Visibility.Collapsed;
                    RecentFiles.Visibility     = Visibility.Collapsed;
                    UploadFile.Visibility      = Visibility.Collapsed;
                    DownloadFile.Visibility    = Visibility.Collapsed;
                    ContentFile.Visibility     = Visibility.Collapsed;
                    OutlookContacts.Visibility = Visibility.Collapsed;
                    ScheduleEvent.Visibility   = Visibility.Collapsed;
                    UserExtension.Visibility   = Visibility.Collapsed;
                    SaveAppData.Visibility     = Visibility.Collapsed;
                    Activity.Visibility        = Visibility.Collapsed;
                    break;

                case "RecentFiles":
                    ContentFrame.Navigate(typeof(RecentOneDriveFiles));
                    break;

                case "UploadFile":
                    ContentFrame.Navigate(typeof(UploadFileToOneDrive));
                    break;

                case "DownloadFile":
                    ContentFrame.Navigate(typeof(DownloadOneDriveFile));
                    break;

                case "ContentFile":
                    ContentFrame.Navigate(typeof(ContentFileOneDrive));
                    break;

                case "OutlookContacts":
                    ContentFrame.Navigate(typeof(OutlookContacts));
                    break;

                case "ScheduleEvent":
                    ContentFrame.Navigate(typeof(ScheduleEventOutlook));
                    break;

                case "UserExtension":
                    ContentFrame.Navigate(typeof(UserExtension));
                    break;

                case "SaveAppData":
                    ContentFrame.Navigate(typeof(SaveAppData));
                    break;

                case "Activity":
                    ContentFrame.Navigate(typeof(ActivityGraph));
                    break;
                }
            }
            catch (Exception ex)
            {
                NavView.Header = $"And error ocurred: {ex}";
            }
        }