Dispose() public static method

public static Dispose ( ) : void
return void
Beispiel #1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            Bootstrap = new Bootstrap();
            Shell     = new Shell();
            var unprocessed = Shell.ProcessArguments(args, Bootstrap.Container, typeof(TopLevelCommands));

            if (unprocessed.Length > 0)
            {
                log.Warn("Unprocessed arguments: " + string.Join(", ", unprocessed));
            }

            //simple console wait
            if (args.Length == 0)
            {
                InitComponents();
                ProcessLock.LockByKey();
                DisposeComponents();
            }
            else if (Shell.IsShellEnabled)
            {
                InitComponents();
                Shell.StartLineEditor();
                DisposeComponents();
            }
            Bootstrap.Dispose();
        }
 /// <summary>
 /// 清理所有正在使用的资源。
 /// </summary>
 /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
 protected override void Dispose(bool disposing)
 {
     if (disposing && (components != null))
     {
         components.Dispose();
     }
     Bootstrap.Dispose();
     base.Dispose(disposing);
 }
        public void CanBootstrapTheIocProject()
        {
            //arrange
            var container = new Container();
            var registrar = new StructuremapRegistrar();
            var logger    = new Logger <BootStrappingTest>();

            //act
            var bootstrapper = new Bootstrap()
                               .WithContainer(container)
                               .WithRegistrar(registrar)
                               .WithLogger(logger)
                               .Start();

            bootstrapper.Dispose();

            //assert
            container.AssertConfigurationIsValid();
        }
Beispiel #4
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            Bootstrap = new Bootstrap();
            Shell     = new Shell();
            var unprocessed = Shell.ProcessArguments(args, Bootstrap.Container, typeof(TopLevelCommands));

            if (unprocessed.Length > 0)
            {
                //var noServiceFlag = unprocessed.Where(x => x.Contains("no"));
                //if (noServiceFlag.Count()>0)
                //{
                //    unprocessed = unprocessed.Where(x => !noServiceFlag.Contains(x)).ToArray();
                //}
                if (unprocessed.Length > 0)
                {
                    log.Warn("Unprocessed arguments: " + string.Join(", ", unprocessed));
                }
            }

            //Bootstrap.Container.Resolve<PerformanceCountersTracker>().Start(
            //    TimeSpan.FromSeconds(10), "Performance");

            //simple console wait));)
            if (args.Length == 0)
            {
                InitComponents();
                ProcessLock.LockByKey();
                DisposeComponents();
            }
            else if (Shell.IsShellEnabled)
            {
                Shell.StartLineEditor();
            }
            Bootstrap.Dispose();

            //ProcessLock.LockByLine();
        }
 public void DisposeBootstrap()
 {
     Container.Dispose();
     bootstrap.Dispose();
     Container = null;
 }
 public void TearDown()
 {
     Repository.Clear();
     Bootstrapper.Dispose();
 }
Beispiel #7
0
        private static async Task Shutdown()
        {
            await CurrentIocManager.Resolve <IMicroHost>().Stop();

            Bootstrap.Dispose();
        }
 protected void Application_End()
 {
     _bootstrapper.Dispose();
 }