/// <summary> /// Saves ext. manager object to XML file /// or database table using provider model /// </summary> /// <returns>True if successful</returns> public static bool SaveToStorage() { foreach (ManagedExtension ext in _extensions) { TrainEngine.Core.DataStore.ExtensionSettings xs = new TrainEngine.Core.DataStore.ExtensionSettings(ext.Name); xs.SaveSettings(ext); } return(true); }
/// <summary> /// Method to change extension status /// </summary> /// <param name="extension">Extensio Name</param> /// <param name="enabled">If true, enables extension</param> public static void ChangeStatus(string extension, bool enabled) { foreach (ManagedExtension x in _extensions) { if (x.Name == extension) { x.Enabled = enabled; TrainEngine.Core.DataStore.ExtensionSettings xs = new TrainEngine.Core.DataStore.ExtensionSettings(x.Name); xs.SaveSettings(x); SaveToCache(); string ConfigPath = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + "Web.Config"; File.SetLastWriteTimeUtc(ConfigPath, DateTime.UtcNow); break; } } }
/// <summary> /// Method to change extension status /// </summary> /// <param name="extension">Extensio Name</param> /// <param name="enabled">If true, enables extension</param> public static void ChangeStatus(string extension, bool enabled) { foreach (ManagedExtension x in _extensions) { if (x.Name == extension) { x.Enabled = enabled; TrainEngine.Core.DataStore.ExtensionSettings xs = new TrainEngine.Core.DataStore.ExtensionSettings(x.Name); xs.SaveSettings(x); SaveToCache(); string ConfigPath = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + "Web.Config"; File.SetLastWriteTimeUtc(ConfigPath, DateTime.UtcNow); break; } } }
/// <summary> /// Save individual extension to storage /// </summary> /// <param name="ext">Extension</param> /// <returns>True if saved</returns> public static bool SaveToStorage(ManagedExtension ext) { TrainEngine.Core.DataStore.ExtensionSettings xs = new TrainEngine.Core.DataStore.ExtensionSettings(ext.Name); xs.SaveSettings(ext); return true; }