Пример #1
0
        private Process PromptOpening(string pic)
        {
            Process  p        = null;
            YNAnswer response =
                AskYNQuestion($"Would you like to see {PC.Format("{0}",Path.GetFileName(pic))}? (Y/N)");

            if (response == YNAnswer.Yes)
            {
                p = OpenFileProcess(pic);
            }
            return(p);
        }
Пример #2
0
        private void PromptDeleteFolder()
        {
            PC.FormatWriteLine("Insert the code to {-3}", "delete");
            CatalogCode code     = new CatalogCode(ReadAnswer());
            YNAnswer    response =
                AskYNQuestion($"Are you sure you want to delete the folder {catalog.Get(code).FancifyEntry()}?");

            if (response == YNAnswer.Yes)
            {
                catalog.Delete(code);
                DeleteFolderOfCode(code);
                Save(folder + fileLoc);
            }
        }
Пример #3
0
        private void PromptDeleteFile()
        {
            PC.FormatWriteLine("Insert the code to {-3}", "delete");
            CatalogCode code = new CatalogCode(ReadAnswer());

            if (IsFile(code))
            {
                YNAnswer response =
                    AskYNQuestion($"Are you sure you want to delete {catalog.Get(code).FancifyEntry()}?");
                if (response == YNAnswer.Yes)
                {
                    string path = Directory.EnumerateFiles(folder + storage + FolderFor(code))
                                  .FirstOrDefault(s => s.Contains(code.ToString()));
                    if (path != default)
                    {
                        File.Delete(path);
                    }
                }
            }
        }
Пример #4
0
        private string PromptNewOrOldTitleToEdit(CatalogCode code)
        {
            YNAnswer response = YNAnswer.No;
            string   title    = "";

            if (catalog.Contains(code))
            {
                title = catalog.Get(code).name;
                if (title != "")
                {
                    response = AskYNQuestion($"Would you like to keep the title {PC.Format("{0}",title)}? (Y/N)");
                }
            }

            if (response == YNAnswer.No)
            {
                PC.FormatWriteLine("Insert the title of {0}", code);
                title = ReadAnswer();
            }

            return(title);
        }