/// <summary>
 /// Close content window.
 /// </summary>
 public void Finish()
 {
     DataReceivedEvent    -= _viewModel.OnDataReceived;
     ContentReceivedEvent -= _viewModel.OnContentReceived;
     ContentRefreshEvent  -= _viewModel.OnDataRefresh;
     _viewModel.RaiseDataReceiveFinishedEvent(null);
 }
 /// <summary>
 /// Open content window.
 /// </summary>
 public void Start()
 {
     _viewModel = new ContentWindowViewModel()
     {
         Title = ViewTitle
     };
     DataReceivedEvent    += _viewModel.OnDataReceived;
     ContentReceivedEvent += _viewModel.OnContentReceived;
     ContentRefreshEvent  += _viewModel.OnDataRefresh;
     _view = new CountrySideEngineer.ContentWindow.View.ContentWindowView()
     {
         DataContext = _viewModel
     };
     _viewModel.RaiseDataReceiveStartEvent(null);
 }
Ejemplo n.º 3
0
        private async Task ContentReceived(MqttContent Content)
        {
            ContentReceivedEventHandler h = this.OnContentReceived;

            if (h != null)
            {
                try
                {
                    await h(this, Content);
                }
                catch (Exception ex)
                {
                    this.Exception(ex);
                    Log.Critical(ex);
                }
            }
        }
Ejemplo n.º 4
0
        private void ContentReceived(MqttContent Content)
        {
            ContentReceivedEventHandler h = this.OnContentReceived;

            if (!(h is null))
            {
                try
                {
                    h(this, Content);
                }
                catch (Exception ex)
                {
#if LineListener
                    LLOut(ex.Message, Color.Yellow, Color.DarkRed);
#endif
                }
            }
        }