Esempio n. 1
0
        public static void Loop()
        {
            bool loop = true;

            while (loop)
            {
                if (Console.KeyAvailable)
                {
                    ConsoleKeyInfo key = Console.ReadKey(true);
                    switch (key.Key)
                    {
                    case ConsoleKey.N:;
                        Console.Write("\ngrab new url: ");
                        Tools.DownloadURL(Tools.GetSiteURLs(Console.ReadLine(), extensions.ToArray()));;
                        Console.WriteLine("finished");
                        break;

                    case ConsoleKey.R:
                        Console.WriteLine("\nchange save folder.\ncurrent save folder: \"{0}\"", savePath);
                        Console.Write("input new folder path (should exist), or ~ for default: ");
                        savePath = Console.ReadLine();
                        if (savePath.CompareTo("~") == 0)
                        {
                            savePath = @"..\..\grabbed\";
                            Console.WriteLine("path set to default.");
                        }
                        else
                        {
                            // check for last slash (otherwise directory name is added to file name)
                            if (savePath[savePath.Length - 1] != '\\')
                            {
                                savePath += '\\';
                            }

                            Console.WriteLine("path edited.");
                        }
                        break;

                    case ConsoleKey.X:
                        VisualTools.ExtensionMenu();
                        //bool innerLoop = true;
                        //while (innerLoop)
                        //{

                        //}
                        break;

                    case ConsoleKey.M:
                        VisualTools.MainMenu();
                        break;

                    case ConsoleKey.Escape:
                        loop = false;
                        break;
                    }
                }
            }
        }
Esempio n. 2
0
 public static void Main()
 {
     Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-GB");
     Console.OutputEncoding = Encoding.UTF8;
     Console.Title          = "Image Downloader -WIP-";
     VisualTools.ResizeConsole(100, 30);
     VisualTools.MainMenu();
     Loop();
 }