/// <summary> /// Unloads the <see cref="IAddon"/> and properly shuts down the remote <see cref="System.AppDomain"/>. /// </summary> public void Unload() { if (_Factory != null) { Addon = null; _Factory.Unload(); _Factory = null; } }
/// <summary> /// Loads and returns the <see cref="IAddon"/>, which will be created in a separate <see cref="System.AppDomain"/> with automatic lifetime sponsorship management. /// </summary> /// <returns>The loaded <see cref="IAddon"/>.</returns> /// <seealso cref="dodSON.Core.AppDomain"/> /// <seealso cref="dodSON.Core.AppDomain.TypeProxyFactory{T}"/> /// <seealso cref="dodSON.Core.AppDomain.ITypeProxySponsorHelper"/> public IAddon Load() { if (Addon == null) { _Factory = new AppDomain.TypeProxyFactory <IAddon>(_Settings); Addon = _Factory.Instance; } return(Addon); }