コード例 #1
0
ファイル: MainForm.cs プロジェクト: itsbth/DoIt
 public MainForm()
 {
     InitializeComponent();
     catalog = (Catalog)(new XmlSerializer(typeof(Catalog)).Deserialize(new FileStream("Catalog.xml", FileMode.Open)));
     searcher = new CatalogSearcher(catalog);
     images = new ImageList();
 }
コード例 #2
0
ファイル: DoItManager.cs プロジェクト: itsbth/DoIt
 public DoItManager(bool loadCatalog)
 {
     if (loadCatalog)
     {
         try
         {
             LoadCatalog();
         }
         catch (Exception)
         {
             RebuildCatalog();
         }
         _searcher = new CatalogSearcher(_catalog);
     }
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: itsbth/DoIt
        static void Main(string[] args)
        {
            Console.WindowWidth = 100;

            Indexer indexer = new Indexer(new string[]{ Environment.GetFolderPath(Environment.SpecialFolder.StartMenu), @"C:\ProgramData\Microsoft\Windows\Start Menu" });
            Catalog catalog = (Catalog)(new XmlSerializer(typeof(Catalog)).Deserialize(new FileStream("Catalog.xml", FileMode.Open)));
            string search;
            do
            {
                search = Console.ReadLine();
                IOrderedEnumerable<CatalogItem> list = new CatalogSearcher(catalog).Search(search);
                foreach (CatalogItem item in list.Take(5))
                {
                    Console.WriteLine(item.Name);
                }
                //list.First().IncreaseCount(search);
            } while (search != "quit");
            {

            }
        }