private async Task GetGesture(Windows.Storage.Search.IStorageQueryResultBase sender, object args) { string text = await FileIO.ReadTextAsync(file); lastMessage = lastMessage == default(string) ? text : lastMessage; if (text != lastMessage) { lastMessage = text; Page current = FrameManager.GetCurrentPage(); if (pageEventDico.ContainsKey(current)) { int index = text.IndexOf('-'); if (!isStop && index > 0 && text.Substring(0, index) != EGestures.Stop.ToString()) { NotifyGestureIcone(text.Substring(0, index)); pageEventDico[current].Invoke(new Gesture(text.Substring(0, index))); } else if (text.Substring(0, index) == EGestures.Stop.ToString()) { isStop = !isStop; NotifyGestureIcone(isStop.ToString()); } } } }
private static async void QueryContentsChanged(Windows.Storage.Search.IStorageQueryResultBase sender, object args) { Debug.WriteLine("Change detected"); // Reset index videoIndex = 0; // Read videos storedVideo = null; storedVideo = await queryResult.GetFilesAsync(); // get tumbnails UpdateThumbs(); }
// Ouvre le fichier de communication p2c et lie son contenue private async Task ReadMessageAsync(Windows.Storage.Search.IStorageQueryResultBase sender, object args) { string text = await FileIO.ReadTextAsync(p2cFile); lastMessage = lastMessage == default(string) ? text : lastMessage; if (text != lastMessage) { lastMessage = text; Page current = FrameManager.GetCurrentPage(); if (pageEventDico.ContainsKey(current)) { int index = text.IndexOf('-'); if (index > 0) { pageEventDico[current].Invoke(text.Substring(0, index)); } } } }
private async void FolderContentsChanged(Windows.Storage.Search.IStorageQueryResultBase sender, object args) { // Ignore the first change notification that gets issued when MonitorConfigFile is called if (_bIgnoreFirstChangeNotification) { _bIgnoreFirstChangeNotification = false; return; } // Read the Config file on change var configResult = await ReadConfig(); if (configResult.Item1 == true) { // If something changed in the config file then restart IotOnboarding if (!configResult.Item2.Equals(_ajOnboardingConfig) || !configResult.Item3.Equals(_softAPConfig)) { sender.ContentsChanged -= FolderContentsChanged; Stop(); Start(); } } }
private async void GetGesture(Windows.Storage.Search.IStorageQueryResultBase sender, object args) { string text = await FileIO.ReadTextAsync(file); GestureCollected?.Invoke(text.Replace("\r\n", string.Empty)); }
private async void Query_ContentsChangedAsync(Windows.Storage.Search.IStorageQueryResultBase sender, object args) { await GetGesture(); }