private SmartGlassClient( Device device, ConnectResponseMessage connectResponse, CryptoContext cryptoContext) { _messageTransport = new MessageTransport(device.Address.ToString(), cryptoContext); _sessionMessageTransport = new SessionMessageTransport( _messageTransport, new SessionInfo() { ParticipantId = connectResponse.ParticipantId }); _sessionMessageTransport.MessageReceived += (s, e) => { var consoleStatusMessage = e.Message as ConsoleStatusMessage; if (consoleStatusMessage != null) { CurrentConsoleStatus = new ConsoleStatus() { Configuration = consoleStatusMessage.Configuration, ActiveTitles = consoleStatusMessage.ActiveTitles }; ConsoleStatusChanged?.Invoke(this, new ConsoleStatusChangedEventArgs( CurrentConsoleStatus )); } }; _sessionMessageTransport.SendAsync(new LocalJoinMessage()); _inputChannel = new DisposableAsyncLazy <InputChannel>(async() => { return(new InputChannel(await StartChannelAsync(ServiceType.SystemInput))); }); _mediaChannel = new DisposableAsyncLazy <MediaChannel>(async() => { return(new MediaChannel(await StartChannelAsync(ServiceType.SystemMedia))); }); _broadcastChannel = new DisposableAsyncLazy <BroadcastChannel>(async() => { var broadcastChannel = new BroadcastChannel(await StartChannelAsync(ServiceType.SystemBroadcast)); await broadcastChannel.WaitForEnabledAsync(); return(broadcastChannel); }); }