示例#1
0
        public void UnSubscribe()
        {
            MonitoringMessageEvent = null;

            try
            {
                _monitoredAppMessageCalls.PublishUnsubscribeMessage();
            }
            catch (Exception ex)
            {
                try
                {
                    _monitorMessageCalls.ErrorOccured($"An error occured in the MonitoringWindowsService:\n{ex.Message}");
                }
                catch (Exception exc)
                {
                    // log the exception.
                }
            }
        }
示例#2
0
        public void Subscribe()
        {
            _monitorMessageCalls      = OperationContext.Current.GetCallbackChannel <IPubSubMonitoringContract>();
            _subscribedMonitorHandler = new MethodRanEventHandler(PublishMethodRanHandler);
            MonitoringMessageEvent    = _subscribedMonitorHandler;

            try
            {
                _monitoredAppMessageCalls.PublishSubscribeMessage();
            }
            catch (Exception ex)
            {
                try
                {
                    _monitorMessageCalls.ErrorOccured($"An error occured in the MonitoringWindowsService:\n{ex.Message}");
                }
                catch (Exception exc)
                {
                    // log the exception.
                }
            }
        }