コード例 #1
0
ファイル: ServerEventMediator.cs プロジェクト: hksonngan/Xian
        public void Initialize(ApplicationStartupParameters appParameters)
        {
            try
            {
                if (_queue == null)
                {
                    _queue = new MessageQueue(DoSend);
                }

                CompositionTarget.Rendering += CompositionTargetRendering;

                _sender = new ServerMessageSender();
                _sender.ApplicationStarted += StartApplicationCompleted;
                _sender.ChannelFaulted     += ChannelFaulted;
                _sender.MessageReceived    += OnServerEventReceived;
                _sender.ChannelOpening     += OnChannelOpening;
                _sender.ChannelOpened      += OnChannelOpened;
                _sender.Intialize();
            }
            catch (Exception ex)
            {
                var args = new ServerChannelFaultEventArgs
                {
                    Error = ex
                };
                ChannelFaulted(this, args);
            }
        }
コード例 #2
0
ファイル: ServerEventMediator.cs プロジェクト: nhannd/Xian
        public void Initialize(ApplicationStartupParameters appParameters)
		{
            try
            {
                if (_queue == null)
                    _queue = new MessageQueue(DoSend);

                CompositionTarget.Rendering += CompositionTargetRendering;
				
                _sender = new ServerMessageSender();
                _sender.ApplicationStarted += StartApplicationCompleted;
                _sender.ChannelFaulted += ChannelFaulted;
                _sender.MessageReceived += OnServerEventReceived;
                _sender.ChannelOpening += OnChannelOpening;
                _sender.ChannelOpened += OnChannelOpened;
                _sender.Intialize();
            }
            catch (Exception ex)
            {
                var args = new ServerChannelFaultEventArgs
                               {
                                   Error = ex
                               };
                ChannelFaulted(this,args);
            }
        }