Beispiel #1
0
 /// <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)
     {
         BlogEngine.Core.DataStore.ExtensionSettings xs = new BlogEngine.Core.DataStore.ExtensionSettings(ext.Name);
         xs.SaveSettings(ext);
     }
     return(true);
 }
Beispiel #2
0
    /// <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;
                BlogEngine.Core.DataStore.ExtensionSettings xs = new BlogEngine.Core.DataStore.ExtensionSettings(x.Name);
                xs.SaveSettings(x);
                SaveToCache();

                string ConfigPath = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + "Web.Config";
                File.SetLastWriteTimeUtc(ConfigPath, DateTime.UtcNow);
                break;
            }
        }
    }
Beispiel #3
0
    /// <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;
        BlogEngine.Core.DataStore.ExtensionSettings xs = new BlogEngine.Core.DataStore.ExtensionSettings(x.Name);
        xs.SaveSettings(x);
        SaveToCache();

        string ConfigPath = HttpContext.Current.Request.PhysicalApplicationPath + "web.config";
        System.IO.File.SetLastWriteTimeUtc(ConfigPath, DateTime.UtcNow);
        break;
          }
        }
    }
Beispiel #4
0
    /// <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;
                BlogEngine.Core.DataStore.ExtensionSettings xs = new BlogEngine.Core.DataStore.ExtensionSettings(x.Name);
                xs.SaveSettings(x);
                SaveToCache();

                string ConfigPath = HttpContext.Current.Request.PhysicalApplicationPath + "web.config";
                System.IO.File.SetLastWriteTimeUtc(ConfigPath, DateTime.UtcNow);
                break;
            }
        }
    }
Beispiel #5
0
    /// <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;
        BlogEngine.Core.DataStore.ExtensionSettings xs = new BlogEngine.Core.DataStore.ExtensionSettings(x.Name);
        xs.SaveSettings(x);
        SaveToCache();

        string ConfigPath = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + "Web.Config";
        File.SetLastWriteTimeUtc(ConfigPath, DateTime.UtcNow);
        break;
          }
        }
    }
Beispiel #6
0
 /// <summary>
 /// Save individual extension to storage
 /// </summary>
 /// <param name="ext">Extension</param>
 /// <returns>True if saved</returns>
 public static bool SaveToStorage(ManagedExtension ext)
 {
     BlogEngine.Core.DataStore.ExtensionSettings xs = new BlogEngine.Core.DataStore.ExtensionSettings(ext.Name);
     xs.SaveSettings(ext);
     return true;
 }