Пример #1
0
 protected void NotifyContextServiceListeners(object sender, NotifyContextServiceListenersEventArgs e)
 {
     if (OnNotifyContextServiceListeners != null)
     OnNotifyContextServiceListeners(sender, e);
 }
Пример #2
0
        public void ContextChanged(object sender, NotifyContextServiceListenersEventArgs e)
        {
            if (sender == Registration)
              {
            Device.Location = (TPadLocation)e.NewObject;
              }
              if (sender == GlyphDetection)
              {
            List<GlyphEvent> events = new List<GlyphEvent>();
            List<Glyph> glyphs = (List<Glyph>)e.NewObject;

            foreach (Glyph glyph in glyphs)
            {
              if (currentGlyphs.Exists(tmp => tmp == glyph))
            continue;
              events.Add(new GlyphEvent() { Glyph = glyph, Status = GlyphStatus.Entered });
            }

            foreach (Glyph glyph in currentGlyphs)
            {
              if (glyphs.Exists(tmp => tmp == glyph))
            continue;
              events.Add(new GlyphEvent() { Glyph = glyph, Status = GlyphStatus.Left });
            }

            currentGlyphs = glyphs;
            if (GlyphsChanged != null)
              GlyphsChanged(this, new GlyphsEventArgs() { GlyphEvents = events });
              }
        }