Пример #1
0
        public void StopObject(Type type)
        {
            if (!hash.ContainsKey(type))
            {
                return;
            }

            RegisteredItem reg = hash [type];

            reg.Item.Stop(false);
        }
Пример #2
0
        void OnDomainUnload(object sender, EventArgs args)
        {
            Manager.RemoveHost(AppID);
            ICollection <RegisteredItem> values = hash.Values;

            RegisteredItem [] objects = new RegisteredItem [hash.Count];
            values.CopyTo(objects, 0);

            foreach (RegisteredItem reg in objects)
            {
                try {
                    reg.Item.Stop(true);                      // Stop should call Unregister. It's ok if not.
                } catch {
                    // Ignore or throw?
                }
            }
            hash.Clear();
        }
Пример #3
0
		void OnDomainUnload (object sender, EventArgs args)
		{
			Manager.RemoveHost (AppID);
			ICollection<RegisteredItem> values = hash.Values;
			RegisteredItem [] objects = new RegisteredItem [hash.Count];
			values.CopyTo (objects, 0);

			foreach (RegisteredItem reg in objects) {
				try {
					reg.Item.Stop (true); // Stop should call Unregister. It's ok if not.
				} catch {
					// Ignore or throw?
				}
			}
			hash.Clear ();
		}