IsFinalizingForUnload() public method

public IsFinalizingForUnload ( ) : bool
return bool
Beispiel #1
0
        public Sandboxer(AppDomain domain)
        {
            Contract.Requires(domain != null && !domain.IsFinalizingForUnload());

            _Domain   = domain;
            this.Name = _Domain.FriendlyName;
        }
Beispiel #2
0
        private void CheckDomainIsUnloaded(AppDomain domain)
        {
            // HACK: Either the Assert will succeed or the
            // exception should be thrown.
            bool unloaded = false;

            try
            {
                unloaded = domain.IsFinalizingForUnload();
            }
            catch (AppDomainUnloadedException)
            {
                unloaded = true;
            }

            Assert.True(unloaded, "Domain was not unloaded");
        }
Beispiel #3
0
		void UnloadDomain(AppDomain domain)
		{
			if (domain != null && !domain.IsFinalizingForUnload())
			{
				AppDomain.Unload(domain);
			}
		}