예제 #1
0
        private async void AddOnClick(object sender, RoutedEventArgs routedEventArgs)
        {
            // C:\Users\Mykolas\Documents\Repos\Drobox\UWP\bin\x86\Debug\AppX\IsCiaKelti
            try
            {
                var picker = new Windows.Storage.Pickers.FileOpenPicker();
                picker.ViewMode = Windows.Storage.Pickers.PickerViewMode.Thumbnail;
                picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.PicturesLibrary;
                picker.FileTypeFilter.Add("*");
                StorageFile file = await picker.PickSingleFileAsync();

                if (file != null)
                {
                    var filesToSave = new string[1];
                    filesToSave[0] = file.Path;
                    FileUtil.AddFile(filesToSave, currentPath);
                    var c = currentPath;
                    InitListAsync(currentPath);
                }
            }
            catch
            {
                // ignored
            }
        }
예제 #2
0
        private void SavePhotoBtn(object sender, RoutedEventArgs e)
        {
            var imageName = PhotoPath.Split('\\').Last(); // "C:\\Users\\Mykolas\\AppData\\Local\\Packages\\fc57b5b6-58fe-4d9c-b7f6-cdcead7ef616_866atarb4ygr6\\TempState\\CCapture (19).jpg"
            var path      = FileUtil.BaseApiPath + App.sub + "\\" + App.given_name + "\\" + imageName;

            string[] selectedPaths = new string[1];
            selectedPaths[0] = PhotoPath;
            FileUtil.AddFile(selectedPaths, App.given_name + "\\" + imageName);

            ImageInfo info = new ImageInfo(path, App.sub, lokacija.Text, komentaras.Text);

            FileUtil.PostImageInfo(info);
        }
예제 #3
0
        private async void Sync_OnClick(object sender, RoutedEventArgs e)
        {
            StorageFolder installedLocation = Windows.ApplicationModel.Package.Current.InstalledLocation;
            var           path       = installedLocation.Path + "\\Files";
            var           filesInDir = Directory.GetFiles(path, "*.*", SearchOption.TopDirectoryOnly);

            FileUtil.AddFile(filesInDir, currentPath);

            DirectoryInfo di = new DirectoryInfo(path);

            foreach (FileInfo file in di.GetFiles())
            {
                file.Delete();
            }

            ContentDialog noWifiDialog = new ContentDialog
            {
                Title           = "Succes",
                Content         = "Your files successfully synced with cloud.",
                CloseButtonText = "Ok"
            };
            ContentDialogResult result = await noWifiDialog.ShowAsync();
        }