void OnAdvertise(object sender, RoutedEventArgs args) { if (!this.advertised) { this.advertised = true; IlightbulbService service = !this.IsIoT ? (IlightbulbService)this : new GpioLightbulbService(GPIO_LED_PIN, this.txtRoom.Text); AllJoynBusAttachment busAttachment = new AllJoynBusAttachment(); lightbulbProducer producer = new lightbulbProducer(busAttachment); producer.Service = service; producer.Start(); } }