internal static void Load(FirLibApplicationLoader loader) { if (s_current != null) { throw new FirLibException($"{nameof(FirLibApplication)} is already loaded!"); } s_currentLoader = loader; s_current = new FirLibApplication(loader.GetContext()); }
internal static void Unload(FirLibApplicationLoader loader) { if (s_current == null) { throw new FirLibException($"{nameof(FirLibApplication)} is already unloaded!"); } if (s_currentLoader != loader) { throw new FirLibException($"{nameof(FirLibApplication)} was loaded by another loader!"); } s_current.UnloadInternal(); s_current = null; s_currentLoader = null; }