Exemple #1
0
        /// <summary>
        /// Create a new folder in the current folder
        /// </summary>
        /// <param name="folder">Destination folder where to create the new folder</param>
        /// <returns>Task to support await of async call.</returns>
        public static async Task NewFolderAsync(OneDriveStorageFolder folder)
        {
            if (folder != null)
            {
                Shell.Current.DisplayWaitRing = true;
                try
                {
                    string newFolderName = await OneDriveSampleHelpers.InputTextDialogAsync("New Folder Name");

                    if (!string.IsNullOrEmpty(newFolderName))
                    {
                        await folder.CreateFolderAsync(newFolderName);
                    }
                }
                catch (ServiceException ex)
                {
                    await OneDriveSampleHelpers.DisplayOneDriveServiceExceptionAsync(ex);
                }
                finally
                {
                    Shell.Current.DisplayWaitRing = false;
                }
            }
        }