예제 #1
0
        private async void CreateFolderOnClick(object sender, RoutedEventArgs routedEventArgs)
        {
            string text = await DesignUtil.InputTextDialogAsync("Name");

            FileUtil.CreateFolder(App.sub + "\\" + currentPath + "\\" + text);
            InitListAsync(currentPath);
        }
예제 #2
0
        private async void ShareOnClick(object sender, RoutedEventArgs routedEventArgs)
        {
            if (listView1.SelectedItems.Count <= 0)
            {
                ContentDialog noWifiDialog = new ContentDialog
                {
                    Title           = "Error",
                    Content         = "Please select file.",
                    CloseButtonText = "Ok"
                };
                ContentDialogResult result = await noWifiDialog.ShowAsync();
            }
            else
            {
                string text = await DesignUtil.InputTextDialogAsync("Email:");

                string text2 = "  ";

                if (String.IsNullOrEmpty(text) == true || String.IsNullOrEmpty(text2) == true)
                {
                    await new MessageDialog("Email or folder text is empty!", "Error").ShowAsync();
                }
                else
                {
                    try
                    {
                        File f        = (File)listView1.SelectedItems[0];
                        var  basePath = f.FilePath.Split(App.sub).First();
                        text2 = await DesignUtil.InputTextDialogAsync("Folder Name:",
                                                                      basePath + App.sub + "\\Shared\\");

                        string       destPath = App.sub + "\\Shared\\" + text2;
                        SettingsPage sp       = new SettingsPage();
                        await sp.sendEmailAsync(
                            App.given_name + " is sharing with you: " + basePath + App.sub + "\\Shared\\" + text2,
                            text);

                        FileUtil.CreateFolder(destPath);
                        FileUtil.ShareFiles(f.FilePath, destPath);
                    }
                    catch
                    {
                        // ignored
                    }
                }
            }
        }