Exemplo n.º 1
0
 public Shade(string name, ShadesConsumer consumer)
 {
     State                             = ShadeState.Unknown;
     Name                              = name;
     m_Consumer                        = consumer;
     m_Consumer.SessionLost           += Consumer_SessionLost;
     m_Consumer.Signals.ErrorReceived += Signals_ErrorReceived;
 }
        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;
            }
        }
Exemplo n.º 3
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;
            }
        }
 private void Consumer_SessionLost(ShadesConsumer sender, AllJoynSessionLostEventArgs args)
 {
     m_Shades.Remove(sender);
 }
Exemplo n.º 5
0
 private void Consumer_SessionLost(ShadesConsumer sender, AllJoynSessionLostEventArgs args)
 {
     SessionLost?.Invoke(this, new EventArgs());
 }