public static void DisposeModule(CoreModuleInfo cmi) { if (cmi == null) { return; } cmi.ToConsole("Disposing..."); if (!cmi.Disposed) { if (cmi.DisposeSupported) { TryCatch(cmi.GetDisposeHandler(), cmi.ToConsole); } TryCatch(cmi.OnDisposed, cmi.ToConsole); if (OnModuleDisposed != null) { TryCatch(() => OnModuleDisposed(cmi), cmi.ToConsole); } cmi.ToConsole("Done."); } else { cmi.ToConsole("Already disposed, no action taken."); } }
public static void SaveModule(CoreModuleInfo cmi) { if (cmi == null || !cmi.Enabled) { return; } cmi.ToConsole("Saving..."); TryCatch(cmi.SaveOptions, cmi.ToConsole); if (cmi.SaveSupported) { TryCatch(cmi.GetSaveHandler(), cmi.ToConsole); } TryCatch(cmi.OnSaved, cmi.ToConsole); if (OnModuleSaved != null) { TryCatch(() => OnModuleSaved(cmi), cmi.ToConsole); } cmi.ToConsole("Done."); }
public static void LoadModule(CoreModuleInfo cmi) { if (cmi == null || !cmi.Enabled) { return; } cmi.ToConsole("Loading..."); TryCatch(cmi.LoadOptions, cmi.ToConsole); if (cmi.LoadSupported) { TryCatch(cmi.GetLoadHandler(), cmi.ToConsole); } TryCatch(cmi.OnLoaded, cmi.ToConsole); if (OnModuleLoaded != null) { TryCatch(() => OnModuleLoaded(cmi), cmi.ToConsole); } cmi.ToConsole("Done."); }
public static void ConfigureModule(CoreModuleInfo cmi) { if (cmi == null || !cmi.Enabled) { return; } cmi.ToConsole("Configuring..."); if (!cmi.Configured) { if (cmi.ConfigSupported) { TryCatch(cmi.GetConfigHandler(), cmi.ToConsole); } TryCatch(cmi.OnConfigured, cmi.ToConsole); if (OnModuleConfigured != null) { TryCatch(() => OnModuleConfigured(cmi), cmi.ToConsole); } cmi.ToConsole("Done."); } else { cmi.ToConsole("Already configured, no action taken."); } }
public static void InvokeModule(CoreModuleInfo cmi) { if (cmi == null || !cmi.Enabled) { return; } cmi.ToConsole("Invoking..."); if (!cmi.Invoked) { if (cmi.InvokeSupported) { TryCatch(cmi.GetInvokeHandler(), cmi.ToConsole); } TryCatch(cmi.OnInvoked, cmi.ToConsole); if (OnModuleInvoked != null) { TryCatch(() => OnModuleInvoked(cmi), cmi.ToConsole); } cmi.ToConsole("Done."); } else { cmi.ToConsole("Already invoked, no action taken."); } }