Inheritance: System.ComponentModel.AsyncCompletedEventArgs, INativeEventObjectWrapper
Esempio n. 1
0
        void messageSender_SendCompleted(object sender, SendCompletedEventArgs e)
        {
            string incoming = e.Response;
            if (string.IsNullOrEmpty(incoming)) return;

            string payload, hdr;
            hdr = IPCHelper.ParseResponse(incoming, out payload);
            //MessageBox.Show(payload);

            System.Diagnostics.Debug.Assert(hdr.Equals(IPCHelper.MSGHDR_DATA));

            if (hdr.Equals(IPCHelper.MSGHDR_DATA))
            {
                //MessageBox.Show("Inside if condition");

                    try
                    {
                        AlertsDataTransfer alerts = BCheck.Data.AlertsDataTransfer.Deserialize(payload);
                        Application.Current.Resources.Remove("AlertsDataTransferDataSource");
                        Application.Current.Resources.Add ("AlertsDataTransferDataSource", alerts);
                        Stub sdata = new Stub();//using an intermediate Stub to provide design time data
                        sdata.Alerts = alerts;
                        pageMain.DataContext = sdata;
                        pageMain.AlertsDisplayControl.Visibility = Visibility.Visible;  
                    }
                
                    catch (Exception ex)
                    {
#if DEBUG
                        MessageBox.Show(ex.ToString ());
#endif
                    }
                
            }
        }
		void _sender_SendCompleted(object sender, SendCompletedEventArgs e)
		{
			if (e.Message == "heartbeat")
			{
				if (e.Error != null)
				{
					Connected = false;
					_sender.SendCompleted -= new EventHandler<SendCompletedEventArgs>(_sender_SendCompleted);
					_sender = null;
				}
				else
				{
					Connected = true;
				}
			}
			if (SendCompleted != null)
			{
				SendCompleted(this, e);
			}
		}
Esempio n. 3
0
 void msgSender_SendCompleted(object sender, SendCompletedEventArgs e)
 {
     MessageBox.Show(e.Response);
 }