public async Task Initialize(ICamera camera, IStorage storage) { this.camera = camera; this.storage = storage; var cacheFolder = KnownFolders.PicturesLibrary; this.dropFolder = await cacheFolder.GetFolderAsync("securitysystem-cameradrop"); this.dropFolderWatcher = dropFolder.CreateFileQuery(); var images = await this.dropFolderWatcher.GetFilesAsync(); var orderedImages = images.OrderByDescending(x => x.DateCreated); this.newestImage = orderedImages.FirstOrDefault(); this.dropFolderWatcher.ContentsChanged += DropFolderWatcher_ContentsChanged; this.allJoynBusAttachment = new AllJoynBusAttachment(); this.producer = new SecuritySystemProducer(this.allJoynBusAttachment); this.allJoynBusAttachment.AboutData.DefaultAppName = Package.Current.DisplayName; this.allJoynBusAttachment.AboutData.DefaultDescription = Package.Current.Description; this.allJoynBusAttachment.AboutData.DefaultManufacturer = Package.Current.Id.Publisher; this.allJoynBusAttachment.AboutData.SoftwareVersion = Package.Current.Id.Version.ToString(); this.allJoynBusAttachment.AboutData.IsEnabled = true; this.producer.Service = this; this.producer.Start(); }
// Set functionality for the folder public async Task SetFolder(StorageFolder folder) { //unhook the old contents changed event if applicable if (_queryResult != null) { _queryResult.ContentsChanged -= QueryResult_ContentsChanged; } // Initialize the query and register for changes _folder = folder; QueryOptions options = new QueryOptions(); // options.IndexerOption = IndexerOption.DoNotUseIndexer; _queryResult = _folder.CreateFileQueryWithOptions(options); _queryResult.ContentsChanged += QueryResult_ContentsChanged; await UpdateCount(); }
public WatchedFolder(StorageFolder folder) { _folder = folder; _fileQueryResult = _folder.CreateFileQueryWithOptions(_queryOptions); _fileQueryResult.ContentsChanged += _fileQueryResult_ContentsChanged; }
public StorageFileQueryResultEvents(StorageFileQueryResult This) { this.This = This; }