public static void DisposeService(CoreServiceInfo csi) { if (csi == null) { return; } csi.ToConsole("Disposing..."); if (!csi.Disposed) { if (csi.DisposeSupported) { TryCatch(csi.GetDisposeHandler(), csi.ToConsole); } TryCatch(csi.OnDisposed, csi.ToConsole); if (OnServiceDisposed != null) { TryCatch(() => OnServiceDisposed(csi), csi.ToConsole); } csi.ToConsole("Done."); } else { csi.ToConsole("Already disposed, no action taken."); } }
public static void SaveService(CoreServiceInfo csi) { if (csi == null) { return; } csi.ToConsole("Saving..."); TryCatch(csi.SaveOptions, csi.ToConsole); if (csi.SaveSupported) { TryCatch(csi.GetSaveHandler(), csi.ToConsole); } TryCatch(csi.OnSaved, csi.ToConsole); if (OnServiceSaved != null) { TryCatch(() => OnServiceSaved(csi), csi.ToConsole); } csi.ToConsole("Done."); }
public static void LoadService(CoreServiceInfo csi) { if (csi == null) { return; } csi.ToConsole("Loading..."); TryCatch(csi.LoadOptions, csi.ToConsole); if (csi.LoadSupported) { TryCatch(csi.GetLoadHandler(), csi.ToConsole); } TryCatch(csi.OnLoaded, csi.ToConsole); if (OnServiceLoaded != null) { TryCatch(() => OnServiceLoaded(csi), csi.ToConsole); } csi.ToConsole("Done."); }
public static void ConfigureService(CoreServiceInfo csi) { if (csi == null) { return; } csi.ToConsole("Configuring..."); if (!csi.Configured) { if (csi.ConfigSupported) { TryCatch(csi.GetConfigHandler(), csi.ToConsole); } TryCatch(csi.OnConfigured, csi.ToConsole); if (OnServiceConfigured != null) { TryCatch(() => OnServiceConfigured(csi), csi.ToConsole); } csi.ToConsole("Done."); } else { csi.ToConsole("Already configured, no action taken."); } }
public static void InvokeService(CoreServiceInfo csi) { if (csi == null) { return; } csi.ToConsole("Invoking..."); if (!csi.Invoked) { if (csi.InvokeSupported) { TryCatch(csi.GetInvokeHandler(), csi.ToConsole); } TryCatch(csi.OnInvoked, csi.ToConsole); if (OnServiceInvoked != null) { TryCatch(() => OnServiceInvoked(csi), csi.ToConsole); } csi.ToConsole("Done."); } else { csi.ToConsole("Already invoked, no action taken."); } }