当前位置: 首页>>代码示例>>C#>>正文


C# ModuleController.ClearCache方法代码示例

本文整理汇总了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);

        }
开发者ID:hassangas2003,项目名称:DotNetNuke.R7,代码行数:10,代码来源:IModuleControlExtensions.cs

示例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);
        }
开发者ID:rickfox,项目名称:Steves,代码行数:24,代码来源:ModuleLocalization.ascx.cs

示例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);
        }
开发者ID:rickfox,项目名称:Steves,代码行数:39,代码来源:ModuleLocalization.ascx.cs

示例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();
        }
开发者ID:rcedev,项目名称:evans-software-solutions,代码行数:11,代码来源:Tabs.ascx.cs

示例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);
            }
        }
开发者ID:rajeshvar,项目名称:Dnn.Platform,代码行数:45,代码来源:ModuleController.cs


注:本文中的DotNetNuke.Entities.Modules.ModuleController.ClearCache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。