Example #1
0
        internal ContextChannelRequestReceivedEventArgs(ContextChannelRequestType requestType,
                                                        ContextChannelRequest request)
            : base()
        {
            Debug.Assert(request != null);

            m_request     = request;
            m_requestType = requestType;
        }
Example #2
0
        private void ProcessRequest(requestType request)
        {
            Debug.Assert(request != null);

            ContextChannelRequestReceivedEventArgs eventArgs = null;
            ContextChannelRequest contextChannelRequest      = null;

            MonitoringChannel mChannel = m_monitoringChannel;

            if (!string.IsNullOrEmpty(request.sessionId) &&
                mChannel != null &&
                mChannel.Id.Equals(request.sessionId, StringComparison.OrdinalIgnoreCase))
            {
                mChannel.ProcessRequest(request);
            }
            else
            {
                if (request.startmonitoringsession != null)
                {
                    m_monitoringChannel = new MonitoringChannel(request.startmonitoringsession.sessionId,
                                                                new Uri(request.startmonitoringsession.uri), this);

                    contextChannelRequest = new MonitoringRequest(request, ContextChannelRequestType.StartMonitoring, m_monitoringChannel);
                }
                else if (request.terminatemonitoringsession != null)
                {
                    MonitoringChannel monitoringChannel = m_monitoringChannel;

                    if (monitoringChannel != null &&
                        String.Equals(request.terminatemonitoringsession.sessionId, monitoringChannel.Id, StringComparison.OrdinalIgnoreCase))
                    {
                        contextChannelRequest = new MonitoringRequest(request, ContextChannelRequestType.StopMonitoring, monitoringChannel);
                    }
                }
                else
                {
                    //TODO:Log and ignore
                }

                if (contextChannelRequest != null)
                {
                    eventArgs = new ContextChannelRequestReceivedEventArgs(contextChannelRequest.RequestType, contextChannelRequest);

                    EventHandler <ContextChannelRequestReceivedEventArgs> eventHandler = this.RequestReceived;
                    if (eventHandler != null)
                    {
                        eventHandler.Invoke(this, eventArgs);
                    }
                }
            }
        }
Example #3
0
        internal void ProcessRequest(requestType request)
        {
            Debug.Assert(request != null);

            ContextChannelRequestReceivedEventArgs eventArgs = null;
            ContextChannelRequest contextChannelRequest      = null;

            if (request.bargein != null)
            {
                contextChannelRequest = new ContextChannelRequest(request,
                                                                  ContextChannelRequestType.BargeIn,
                                                                  m_supervisorChannel.InnerChannel);
            }
            else if (request.whisper != null)
            {
                contextChannelRequest = new WhisperRequest(request,
                                                           m_supervisorChannel.InnerChannel);
            }
            //else if (request.terminatemonitoringsession != null)
            //{
            //    contextChannelRequest = new ContextChannelRequest(request,
            //        ContextChannelRequestType.Hold,
            //        m_innerChannel);
            //}
            else
            {
                //TODO:Log and ignore
            }

            eventArgs = new ContextChannelRequestReceivedEventArgs(contextChannelRequest.RequestType, contextChannelRequest);

            EventHandler <ContextChannelRequestReceivedEventArgs> eventHandler = this.RequestReceived;

            if (eventHandler != null)
            {
                eventHandler.Invoke(this, eventArgs);
            }
        }
Example #4
0
        private void ProcessRequest(requestType request)
        {
            Debug.Assert(request != null);

            ContextChannelRequestReceivedEventArgs eventArgs = null;
            ContextChannelRequest contextChannelRequest      = null;

            if (request.hold != null)
            {
                contextChannelRequest = new ContextChannelRequest(request,
                                                                  ContextChannelRequestType.Hold,
                                                                  m_innerChannel);
            }
            else if (request.escalate != null)
            {
                contextChannelRequest = new EscalateRequest(request,
                                                            m_innerChannel);
            }
            else if (request.retrieve != null)
            {
                contextChannelRequest = new ContextChannelRequest(request,
                                                                  ContextChannelRequestType.Retrieve,
                                                                  m_innerChannel);
            }
            else
            {
                //TODO:Log and ignore
            }

            eventArgs = new ContextChannelRequestReceivedEventArgs(contextChannelRequest.RequestType, contextChannelRequest);

            EventHandler <ContextChannelRequestReceivedEventArgs> eventHandler = this.RequestReceived;

            if (eventHandler != null)
            {
                eventHandler.Invoke(this, eventArgs);
            }
        }