Esempio n. 1
0
        public void Load(TagQueryCriteria tagQueryCriteria = null, bool newAdditionsOnly = false)
        {
            FileNames.Clear();

            currentQuery = tagQueryCriteria ?? new TagQueryCriteria();
            var sourcePath = PersistanceUtil.RetreiveSetting(Setting.SourceDirectory);

            if (!Directory.Exists(sourcePath))
            {
                sourcePath = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
                PersistanceUtil.RecordSetting(Setting.SourceDirectory, sourcePath);
            }
            if (newAdditionsOnly)
            {
                FileNames.Add(NewFiles);
            }
            else
            {
                FileNames.Add(ImageFileUtil.GetImageFilenames(sourcePath, currentQuery));
            }

            if (currentQuery.orderDirection == OrderDirection.RANDOM)
            {
                FileNames.Shuffle();
            }
            watcher.Path = sourcePath;
            watcher.EnableRaisingEvents = true;
            FilesLoaded(null, new EventArgs());
        }