Ejemplo n.º 1
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            m_Attachment = new AllJoynBusAttachment();
            m_Attachment.Connect();

            m_Watcher        = new ShadesWatcher(m_Attachment);
            m_Watcher.Added += Watcher_Added;
        }
        private async void Shade_Added(ShadesWatcher sender, AllJoynServiceInfo args)
        {
            ShadesJoinSessionResult joinSessionResult = await ShadesConsumer.JoinSessionAsync(args, sender);

            if (joinSessionResult.Status == AllJoynStatus.Ok)
            {
                m_Shades.Add(joinSessionResult.Consumer);
                joinSessionResult.Consumer.SessionLost += Consumer_SessionLost;
            }
        }
        public VoiceCommandHandler()
        {
            m_Shades = new List <ShadesConsumer>();

            m_Attachment = new AllJoynBusAttachment();
            m_Attachment.Connect();

            m_Watcher        = new ShadesWatcher(m_Attachment);
            m_Watcher.Added += Shade_Added;
        }
Ejemplo n.º 4
0
        private async void Watcher_Added(ShadesWatcher sender, AllJoynServiceInfo args)
        {
            ShadesJoinSessionResult joinSessionResult = await ShadesConsumer.JoinSessionAsync(args, sender);

            if (joinSessionResult.Status == AllJoynStatus.Ok)
            {
                var shade = new Shade(System.IO.Path.GetDirectoryName(args.ObjectPath), joinSessionResult.Consumer);
                Shades.Add(shade);
                shade.SessionLost += Shade_SessionLost;
            }
        }