Beispiel #1
0
        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());
                    }
                }
            }
        }
        // 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));
                    }
                }
            }
        }