예제 #1
0
        private void ShowUntagged_Click(object sender, RoutedEventArgs e)
        {
            using (var ctx = AkyuuContext.Create()) {
                var tagged = (from t in ctx.ScreenshotTags
                              select t.File).Distinct();

                var files = Utils.ListImageFiles(Config.Current.ScreenshotPath).Except(tagged);

                if (cxSortDesc.IsChecked is true)
                {
                    files = from t in files
                            orderby t descending
                            select t;
                }
                else
                {
                    files = from t in files
                            orderby t ascending
                            select t;
                }

                lsBrowser.ItemsSource = from t in files.ToList()
                                        select Screenshot.FromFile(t);
            }
        }
예제 #2
0
        private void TagSearch_Click(object sender, RoutedEventArgs e)
        {
            var tagName = from t in allTags
                          where t.Selected
                          select t.Name;
            int tagCount = tagName.Count();

            using (var ctx = AkyuuContext.Create()) {
                var files = from t in ctx.ScreenshotTags
                            where tagName.Contains(t.TagName)
                            group t by t.File into g
                            where g.Count() >= tagCount
                            select g.Key;

                if (cxSortDesc.IsChecked is true)
                {
                    files = from t in files
                            orderby t descending
                            select t;
                }
                else
                {
                    files = from t in files
                            orderby t ascending
                            select t;
                }

                lsBrowser.ItemsSource = from t in files.ToList()
                                        select Screenshot.FromFile(t);
            }
        }
예제 #3
0
        public BrowsePage()
        {
            InitializeComponent();
            DataContext = this;

            allFiles = from t in Utils.ListImageFiles(Config.Current.ScreenshotPath)
                       select Screenshot.FromFile(t);

            lsFiles.ItemsSource = allFiles;
        }