private void Export()
        {
            try
            {
                if (string.IsNullOrEmpty(SavePath))
                {
                    throw new Exception("Save path not defined.");
                }
                else if (string.IsNullOrEmpty(SelectedExporter))
                {
                    throw new Exception("No exporter selected.");
                }
                else if (SelectedBook == null)
                {
                    throw new Exception("No book selected.");
                }

                if (File.Exists(SavePath) &&
                    !MessageBoxFactory.ShowConfirmAsBool("Overwrite existing file?", "File Exists"))
                {
                    return;
                }

                BaseExporter exporter = GetExporter();
                exporter.Export(SelectedBook, SavePath);

                MessageBoxFactory.ShowInfo("Book has been exported to: " + SavePath, "Book Exported");
            }
            catch (Exception e)
            {
                MessageBoxFactory.ShowError(e);
            }
        }
        private void Move()
        {
            try
            {
                if (string.IsNullOrEmpty(Destination))
                {
                    throw new Exception("The destination cannot be empty.");
                }
                else if (!Directory.Exists(Destination))
                {
                    throw new Exception("The destination does not exist.");
                }

                var selected = Results.Where(x => x.Selected);

                int ctr = 0;

                foreach (var s in selected)
                {
                    FileInfo f        = new FileInfo(s.Path);
                    string   fullPath = Path.Combine(Destination, f.Name);

                    if (DoCopy)
                    {
                        f.CopyTo(fullPath);
                    }
                    else
                    {
                        f.MoveTo(fullPath);
                    }

                    ctr++;
                }

                ClearResults();

                RecentListUtil.Upsert(RecentDestinations, Destination);
                SaveRecentDestinations();


                //Open Folder
                if (Settings.OpenDestinationFolder)
                {
                    Process.Start(Destination);
                }

                MessageBoxFactory.ShowInfo(ctr + " files were moved to " + Destination, "Moved Successfully");
            }
            catch (Exception e)
            {
                MessageBoxFactory.ShowError(e);
            }
        }
        private void CheckWin()
        {
            if (!InGame)
            {
                return;
            }

            if (actualMinesLeft == 0 && minesLeft == 0 && CellsLeft == 0)
            {
                InGame = false;

                MessageBoxFactory.ShowInfo("You Win" + (triggeredMines == 0 ?
                                                        "!" :
                                                        ("... after triggering " + triggeredMines + " mines... :(")), "You Win");
            }
        }
示例#4
0
        private void DeleteTasks()
        {
            foreach (TaskItemViewModel t in tasks)
            {
                DB.Tasks.Remove(t.Data);
            }

            DB.SaveChanges();

            RaisePropertyChanged("StartDate");
            SelectedDate = StartDate;

            shouldReload = true;

            MessageBoxFactory.ShowInfo(TasksCount + " tasks deleted.", "Tasks Deleted");
        }
示例#5
0
        public void Export()
        {
            try
            {
                if (string.IsNullOrEmpty(ExportPath))
                {
                    throw new Exception("Path cannot be empty.");
                }

                EXP.Export(ExportPath);

                MessageBoxFactory.ShowInfo("Database exported to: " + ExportPath, "Exported");
            }
            catch (Exception e)
            {
                MessageBoxFactory.ShowError(e);
            }
        }
示例#6
0
        public void Import()
        {
            try
            {
                if (string.IsNullOrEmpty(importPath) || !File.Exists(ImportPath))
                {
                    throw new Exception("File not found.");
                }

                Bundle bundle = Bundle.Deserialize(importPath);
                ds.Import(bundle);

                MessageBoxFactory.ShowInfo("Database has been imported.", "Imported");
            }
            catch (Exception e)
            {
                MessageBoxFactory.ShowError(e);
            }
        }
示例#7
0
        public void Import()
        {
            try
            {
                if (string.IsNullOrEmpty(importPath) || !File.Exists(ImportPath))
                {
                    throw new Exception("File not found.");
                }

                EXP.Import(importPath);

                MessageBoxFactory.ShowInfo("Database has been imported.", "Imported");

                DatabaseUpdated = true;
            }
            catch (Exception e)
            {
                MessageBoxFactory.ShowError(e);
            }
        }
 private void ShowMessage(string list)
 {
     MessageBoxFactory.ShowInfo(list + " were cleared.", "Recent History Cleared");
 }
示例#9
0
        private async void Test()
        {
            var profile = await GetProfile();

            MessageBoxFactory.ShowInfo(profile.Skills, "Test");
        }
示例#10
0
 private void ShowRefreshStatus(RefreshResults result, string title = "Refreshed")
 {
     MessageBoxFactory.ShowInfo(mainWindow, result.GetSummary(), title);
 }