Пример #1
0
        async private void RemoveResume(object sender, RoutedEventArgs e)
        {
            var resume_list = await AppStorageManager.ListResumes();

            var oldest_resume = resume_list.LastOrDefault();

            var result = await AppStorageManager.
                         DeleteResume(oldest_resume);

            _count--;
            await RefreshUIAsync(result);
        }
Пример #2
0
        async Task RefreshUIAsync(ResumeOperationResult?result = null)
        {
            var app_view    = ApplicationView.GetForCurrentView();
            var resume_list = await AppStorageManager.ListResumes();

            app_view.Title = $"{resume_list.Count} resumes, {(await AppStorageManager.GetTotalStorage())} KB, QUOTA={ApplicationData.Current.RoamingStorageQuota} KB";
            Resumes        = resume_list;
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Resumes"));

            if (result != null)
            {
                if (result == ResumeOperationResult.SuccessOverLimit)
                {
                    app_view.TitleBar.BackgroundColor = Windows.UI.Colors.Red;
                }
                else
                {
                    app_view.TitleBar.BackgroundColor = null;
                }
            }
        }
Пример #3
0
        async private void ImportResume(object sender, RoutedEventArgs e)
        {
            var app_view = ApplicationView.GetForCurrentView();

            FileOpenPicker opener = new FileOpenPicker();

            opener.ViewMode = PickerViewMode.Thumbnail;
            opener.SuggestedStartLocation = PickerLocationId.Desktop;
            opener.CommitButtonText       = "Import the resume";
            opener.FileTypeFilter.Add(".resume");
            var selected_file = await opener.PickSingleFileAsync();

            if (selected_file != null)
            {
                //read and deserialize resume
                var resume = await Resume.FromStorageFileAsync(selected_file);

                if (resume == null)
                {
                    MessageDialog md = new MessageDialog("Cannot read resume data.");
                    await md.ShowAsync();

                    return;
                }

                //name resume
                var new_resume_id         = Guid.NewGuid().ToString();
                int current_storage_count = (await AppStorageManager.ListResumes()).Count;
                resume.Name     = $"resume import [{new_resume_id}]";
                resume.ResumeID = new_resume_id;


                //now store the resume in AppData
                var result = await AppStorageManager.
                             SaveResumeAsync(resume, CreationCollisionOption.GenerateUniqueName);
                await RefreshUIAsync(result);
            }
        }
Пример #4
0
 async private void LandingPage_Loaded(object sender, RoutedEventArgs e)
 {
     _count = (await AppStorageManager.ListResumes()).Count;
     await RefreshUIAsync();
 }
        async private void ResumeFilePicker_Loaded(object sender, RoutedEventArgs e)
        {
            Resumes = await AppStorageManager.ListResumes();

            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Resumes"));
        }