public static async Task <LtPushChannel> Create() { var channel = new LtPushChannel(); await channel.InitializeWpnsChanelAsync(); return(channel); }
private async void InitializePushChannel() { if (_pushChannel != null) { return; } viewSubscribeButton.IsEnabled = false; viewBusyMessage.Text = "подключение к WNS"; viewBusyPanel.Visibility = Visibility.Visible; try { _pushChannel = await LtPushChannel.Create(); _pushChannel.PushReceived += OnPushReceived; viewSubscribeButton.IsEnabled = true; viewPushChanel.Text = _pushChannel.Uri; Debug.WriteLine("New Push chanel registered: {0}", _pushChannel.Uri); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { viewBusyPanel.Visibility = Visibility.Collapsed; } }
public static async Task<LtPushChannel> Create() { var channel = new LtPushChannel(); await channel.InitializeWpnsChanelAsync(); return channel; }
private async void InitializePushChannel() { if(_pushChannel != null) { return; } viewSubscribeButton.IsEnabled = false; viewBusyMessage.Text = "подключение к WNS"; viewBusyPanel.Visibility = Visibility.Visible; try { _pushChannel = await LtPushChannel.Create(); _pushChannel.PushReceived += OnPushReceived; viewSubscribeButton.IsEnabled = true; viewPushChanel.Text = _pushChannel.Uri; Debug.WriteLine("New Push chanel registered: {0}", _pushChannel.Uri); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { viewBusyPanel.Visibility = Visibility.Collapsed; } }