상속: System.MarshalByRefObject, IDisposable
예제 #1
0
        public IsolatedApplicationRunner()
        {
            var setup = new AppDomainSetup
            {
                ApplicationBase = AppDomain.CurrentDomain.SetupInformation.ApplicationBase,
                ApplicationName = "Net IDE"
            };

            var appDomain = AppDomain.CreateDomain(
                setup.ApplicationName,
                AppDomain.CurrentDomain.Evidence,
                setup
            );

            try
            {
                _application = (ApplicationRunner)appDomain.CreateInstanceAndUnwrap(
                    typeof(ApplicationRunner).Assembly.FullName,
                    typeof(ApplicationRunner).FullName
                );

                _appDomain = appDomain;
            }
            catch
            {
                AppDomain.Unload(appDomain);

                throw;
            }
        }
예제 #2
0
        public IsolatedApplicationRunner()
        {
            var setup = new AppDomainSetup
            {
                ApplicationBase = AppDomain.CurrentDomain.SetupInformation.ApplicationBase,
                ApplicationName = "Net IDE"
            };

            var appDomain = AppDomain.CreateDomain(
                setup.ApplicationName,
                AppDomain.CurrentDomain.Evidence,
                setup
                );

            try
            {
                _application = (ApplicationRunner)appDomain.CreateInstanceAndUnwrap(
                    typeof(ApplicationRunner).Assembly.FullName,
                    typeof(ApplicationRunner).FullName
                    );

                _appDomain = appDomain;
            }
            catch
            {
                AppDomain.Unload(appDomain);

                throw;
            }
        }
예제 #3
0
        public void Dispose()
        {
            if (!_disposed)
            {
                if (_application != null)
                {
                    _application.Dispose();
                    _application = null;
                }

                if (_appDomain != null)
                {
                    AppDomain.Unload(_appDomain);
                    _appDomain = null;
                }

                _disposed = true;
            }
        }
예제 #4
0
        public void Dispose()
        {
            if (!_disposed)
            {
                if (_application != null)
                {
                    _application.Dispose();
                    _application = null;
                }

                if (_appDomain != null)
                {
                    AppDomain.Unload(_appDomain);
                    _appDomain = null;
                }

                _disposed = true;
            }
        }