private async void Lamp_Added(LampWatcher sender, AllJoynServiceInfo args)
        {
            LampJoinSessionResult joinSessionResult = await LampConsumer.JoinSessionAsync(args, sender);

            if (joinSessionResult.Status == AllJoynStatus.Ok)
            {
                m_Lamps.Add(joinSessionResult.Consumer);
                joinSessionResult.Consumer.SessionLost += Consumer_SessionLost;
            }
        }
Пример #2
0
        private async void Lamp_Added(LampWatcher sender, AllJoynServiceInfo args)
        {
            LampJoinSessionResult joinSessionResult = await LampConsumer.JoinSessionAsync(args, sender);

            if (joinSessionResult.Status == AllJoynStatus.Ok)
            {
                LampConsumer lampConsumer = joinSessionResult.Consumer;

                // Create ViewModel object from LampConsumer and add to the Lamps collection
                // Using args.ObjectPath for the name of the device. One could use args.UniqueId for an
                // Id property for lamps lookup from a dictionary.
                Lamp lamp = new Lamp(args.ObjectPath, lampConsumer);
                Lamps.Add(lamp);

                lamp.SessionLost += Lamp_SessionLost;
            }
        }