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


C# ModuleController.UpdateTranslationStatus方法代码示例

本文整理汇总了C#中DotNetNuke.Entities.Modules.ModuleController.UpdateTranslationStatus方法的典型用法代码示例。如果您正苦于以下问题:C# ModuleController.UpdateTranslationStatus方法的具体用法?C# ModuleController.UpdateTranslationStatus怎么用?C# ModuleController.UpdateTranslationStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DotNetNuke.Entities.Modules.ModuleController的用法示例。


在下文中一共展示了ModuleController.UpdateTranslationStatus方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例2: 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

示例3: 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

示例4: publishPageButton_Click

        protected void publishPageButton_Click(object sender, EventArgs e)
        {
            var tabCtrl = new TabController();
            var modCtrl = new ModuleController();

            //First mark all modules as translated
            foreach (ModuleInfo m in modCtrl.GetTabModules(Tab.TabID).Values)
            {
                modCtrl.UpdateTranslationStatus(m, true);
            }

            //First mark tab as translated
            tabCtrl.UpdateTranslationStatus(Tab, true);

            //Next publish Tab (update Permissions)
            tabCtrl.PublishTab(Tab);

            //Redirect to refresh page (and skinobjects)
            Response.Redirect(Request.RawUrl, true);
        }
开发者ID:smkkstudios,项目名称:BlackandWhiteReporting,代码行数:20,代码来源:ManageTabs.ascx.cs

示例5: Translate

        private void Translate(ModuleAction Command)
        {
            var moduleCtrl = new ModuleController();
            ModuleInfo sourceModule = moduleCtrl.GetModule(ModuleContext.ModuleId, ModuleContext.TabId, false);
            switch (Command.CommandName)
            {
                case ModuleActionType.TranslateModule:
                    moduleCtrl.UpdateTranslationStatus(sourceModule, true);
                    break;
                case ModuleActionType.UnTranslateModule:
                    moduleCtrl.UpdateTranslationStatus(sourceModule, false);
                    break;
            }

            // Redirect to the same page to pick up changes
            Response.Redirect(Request.RawUrl, true);
        }
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:17,代码来源:ActionManager.cs


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