Пример #1
0
        static void Main(string[] args)
        {
            if(args.Length < 2)
            {
                Console.WriteLine("usage: createindex input_path output_path");
                return;
            }

            try
            {
                _iv = new ImageSearch(args[1]);
                var files = SetFiles(args[0]);
            }catch(Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            Console.WriteLine("Finished.");
        }
Пример #2
0
 public ImageSearch(string basePath)
 {
     _basePath = ImageSearch.GetDirectory(basePath);
 }
Пример #3
0
		/// <summary>
		/// Loads the image information from index.db.
		/// </summary>
		private async Task LoadImageInfoAsync()
		{
			var fn = NSBundle.MainBundle.PathForResource("index", "db");
			if (!File.Exists(fn))
			{
				ShowAlertOnWindow(
					$"index.db {NSBundle.MainBundle.LocalizedString("ErrorNotFound", "optional")}",
					NSBundle.MainBundle.LocalizedString("LoadFailed", "optional"),
					NSAlertStyle.Critical);
				NSApplication.SharedApplication.Terminate(this);
			}

			try
			{
				imageSearch = new XMImageSearch();
				await imageSearch.LoadFromDbAsync(fn);
			}
			catch
			{
				ShowAlertOnWindow(
					$"index.db {NSBundle.MainBundle.LocalizedString("ErrorCorrupted", "optional")}",
					NSBundle.MainBundle.LocalizedString("LoadFailed", "optional"),
					NSAlertStyle.Critical);
				NSApplication.SharedApplication.Terminate(this);
			}
		}