示例#1
0
        public void TestDirectoryScanning()
        {
            LocalStorageScanner scanner = new LocalStorageScanner();

            WatchSource source = new WatchSource();

            source.SourceUri = new Uri("C:\\娱乐\\书籍");
            scanner.Scanning(source, null);
        }
示例#2
0
        public void Scanning(WatchSource target, FindBookEventHandler handler)
        {
            this.Target = target;

            findBookEvents += handler;

            FindFile(Target.SourceUri.OriginalString);

            findBookEvents -= handler;
        }
示例#3
0
        public void Running()
        {
            lock (_gate)
            {
                WatchSource source = _changedSourceQueue.Dequeue();

                List <IBookScanner> scanners = _serviceHost.GetFunctionExtensions <IBookScanner>(ExtensionCategory.ScanningExtension);

                foreach (IBookScanner scanner in scanners)
                {
                    if (scanner.IsAcceptedSource(source))
                    {
                        scanner.Scanning(source, this.MonitorFindBookEventHandler);
                        break;
                    }
                }
                ;
            }
        }
 public SourceChangedEventArgs(WatchSource changedUri)
 {
     this.ChangedUri = changedUri;
 }
示例#5
0
 public bool IsAcceptedSource(WatchSource target)
 {
     return(true);
 }