本文整理汇总了C#中DotNetNuke.Entities.Modules.ModuleController.ClearCache方法的典型用法代码示例。如果您正苦于以下问题:C# ModuleController.ClearCache方法的具体用法?C# ModuleController.ClearCache怎么用?C# ModuleController.ClearCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotNetNuke.Entities.Modules.ModuleController
的用法示例。
在下文中一共展示了ModuleController.ClearCache方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SynchronizeModuleHack
public static void SynchronizeModuleHack (this IModuleControl module)
{
ModuleController.SynchronizeModule (module.ModuleContext.ModuleId);
// NOTE: update module cache (temporary fix before 7.2.0)?
// more info: https://github.com/dnnsoftware/Dnn.Platform/pull/21
var moduleController = new ModuleController ();
moduleController.ClearCache (module.ModuleContext.TabId);
}
示例2: MarkTranslatedSelectedItems
public void MarkTranslatedSelectedItems(bool translated)
{
var moduleCtrl = new ModuleController();
foreach (GridDataItem row in localizedModulesGrid.SelectedItems)
{
var localizedModuleId = (int)row.OwnerTableView.DataKeyValues[row.ItemIndex]["ModuleId"];
var localizedTabId = (int)row.OwnerTableView.DataKeyValues[row.ItemIndex]["TabId"];
ModuleInfo sourceModule = moduleCtrl.GetModule(localizedModuleId, localizedTabId, false);
if (sourceModule.IsLocalized)
{
moduleCtrl.UpdateTranslationStatus(sourceModule, translated);
}
}
moduleCtrl.ClearCache(TabId);
//Rebind localized Modules
DataBind();
//Raise Changed event
OnModuleLocalizationChanged(EventArgs.Empty);
}
示例3: LocalizeSelectedItems
public void LocalizeSelectedItems(bool localize)
{
var moduleCtrl = new ModuleController();
foreach (GridDataItem row in localizedModulesGrid.SelectedItems)
{
var localizedModuleId = (int)row.OwnerTableView.DataKeyValues[row.ItemIndex]["ModuleId"];
var localizedTabId = (int)row.OwnerTableView.DataKeyValues[row.ItemIndex]["TabId"];
ModuleInfo sourceModule = moduleCtrl.GetModule(localizedModuleId, localizedTabId, false);
if (sourceModule != null)
{
if (sourceModule.DefaultLanguageModule != null)
{
if (localize)
{
//Localize
moduleCtrl.LocalizeModule(sourceModule, LocaleController.Instance.GetLocale(sourceModule.CultureCode));
}
else
{
//Delocalize
moduleCtrl.DeLocalizeModule(sourceModule);
//Mark module as Not Translated
moduleCtrl.UpdateTranslationStatus(sourceModule, false);
}
}
}
}
moduleCtrl.ClearCache(TabId);
//Rebind localized Modules
DataBind();
//Raise Changed event
OnModuleLocalizationChanged(EventArgs.Empty);
}
示例4: CmdDeleteModuleClick
protected void CmdDeleteModuleClick(object sender, EventArgs e)
{
var moduleId = Convert.ToInt32(((ImageButton)sender).CommandArgument);
var tabId = Convert.ToInt32(ctlPages.SelectedNode.Value);
var moduleController = new ModuleController();
moduleController.DeleteTabModule(tabId, moduleId, true);
moduleController.ClearCache(tabId);
grdModules.Rebind();
}
示例5: SynchronizeModule
/// <summary>
/// Synchronizes the module content between cache and database.
/// </summary>
/// <param name="moduleID">The module ID.</param>
public static void SynchronizeModule(int moduleID)
{
var moduleController = new ModuleController();
ArrayList modules = moduleController.GetModuleTabs(moduleID);
var tabController = new TabController();
foreach (ModuleInfo module in modules)
{
Hashtable tabSettings = tabController.GetTabSettings(module.TabID);
if (tabSettings["CacheProvider"] != null && tabSettings["CacheProvider"].ToString().Length > 0)
{
var outputProvider = OutputCachingProvider.Instance(tabSettings["CacheProvider"].ToString());
if (outputProvider != null)
{
outputProvider.Remove(module.TabID);
}
}
if (module.CacheTime > 0)
{
var moduleProvider = ModuleCachingProvider.Instance(module.GetEffectiveCacheMethod());
if (moduleProvider != null)
{
moduleProvider.Remove(module.TabModuleID);
}
}
//Synchronize module is called when a module needs to indicate that the content
//has changed and the cache's should be refreshed. So we can update the Version
//and also the LastContentModificationDate
UpdateTabModuleVersion(module.TabModuleID);
dataProvider.UpdateModuleLastContentModifiedOnDate(module.ModuleID);
//We should also indicate that the Transalation Status has changed
if (PortalController.GetPortalSettingAsBoolean("ContentLocalizationEnabled", module.PortalID, false))
{
moduleController.UpdateTranslationStatus(module, false);
}
// and clear the cache
moduleController.ClearCache(module.TabID);
}
}