Ejemplo n.º 1
0
        private static void Shutdown()
        {
            object sync = UpdatesService.sync;

            lock (sync)
            {
                if (instance != null)
                {
                    instance.Dispose();
                    instance = null;
                }
            }
        }
Ejemplo n.º 2
0
        public static IDisposable Initialize(IUpdatesServiceHost host)
        {
            object sync = UpdatesService.sync;

            lock (sync)
            {
                if (instance != null)
                {
                    ExceptionUtil.ThrowInvalidOperationException("Initialize has already been called");
                }
                instance = new UpdatesService(host);
                return(Disposable.FromAction(delegate {
                    Shutdown();
                }, false));
            }
        }