Ejemplo n.º 1
0
        void InitializeSignalR()
        {
            IoC.RegisterType <IEventSignalR, EventSignalR>(true);
            IoC.RegisterType <ISignalRFactory, SignalRFactory>(true);

            SignalRFactory.Initialization(IoC.Resolve <IEventSignalR>());

            //TODO : Service connect or disconnect
            SignalRFactory.OnConnected += (sender, args) =>
            {
                TraceManager.TraceDebug("API connected.");
            };
            SignalRFactory.OnDisconnected += (sender, args) =>
            {
                TraceManager.TraceDebug("API disconnected.");
            };
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Arrête le contrôleur
        /// </summary>
        protected override async Task OnStop()
        {
            SaveSettings();

            SignalRFactory.Dispose();

            if (!_shutdown)
            {
                await ServiceBus.Get <ISharedDatabasePresentationService>().ReleaseLock();
            }

            await base.OnStop();

            if (Application.Current != null)
            {
                Application.Current.Shutdown();
            }
        }