Ejemplo n.º 1
0
        /// <summary>
        /// Message server error event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void _messageServer_OnError(object sender, Shared.Communication.ErrorEventArgs e)
        {
            Shared.EventLog.Add(String.Format("TCP Client error: {0}", e.Error.Message));

            if (e.Error.StackTrace != null)
            {
                Shared.EventLog.Add(e.Error.StackTrace.ToString());
            }

            e.Continue          = false;
            _messageServerError = true;
        }
Ejemplo n.º 2
0
        void _client_OnError(object sender, Shared.Communication.ErrorEventArgs e)
        {
#if DEBUG
            Shared.EventLog.Debug("Sync " + System.Reflection.MethodBase.GetCurrentMethod().Name);
            Shared.EventLog.Debug(e.Error.Message);
#endif
            Shared.EventLog.Add(e.Error, "Console");

            e.Continue = true;
            try
            {
                if (this.Disposing)
                {
                    return;
                }

                if (this.InvokeRequired)
                {
                    Shared.Communication.ErrorEventHandler mreh = new Shared.Communication.ErrorEventHandler(_client_OnError);
                    this.Invoke(mreh, new object[] { sender, e });
                }
                else
                {
                    lstReplicationMessages.Items.Add(e.Error.Message);
                    int idx = lstReplicationMessages.Items.Add(e.Error.StackTrace.ToString());

                    if (cbAutoScroll.Checked && lstReplicationMessages.Items != null)
                    {
                        lstReplicationMessages.SelectedIndex = idx;
                    }
                }
            }
            catch (Exception err)
            {
                Shared.EventLog.Add(err);
            }
        }