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


C# ModuleController.GetTabModule方法代码示例

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


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

示例1: Remove

        public override void Remove(int tabModuleId)
        {
            var controller = new ModuleController();
            ModuleInfo tabModule = controller.GetTabModule(tabModuleId);

            int portalId = tabModule.PortalID;
            if (portalId == Null.NullInteger)
            {
                portalId = PortalSettings.Current.PortalId;
            }

            string cacheFolder = GetCacheFolder(portalId);
            var filesNotDeleted = new StringBuilder();
            int i = 0;
            foreach (string File in Directory.GetFiles(cacheFolder, tabModuleId + "_*.*"))
            {
                if (!FileSystemUtils.DeleteFileWithWait(File, 100, 200))
                {
                    filesNotDeleted.Append(File + ";");
                }
                else
                {
                    i += 1;
                }
            }
            if (filesNotDeleted.Length > 0)
            {
                throw new IOException("Deleted " + i + " files, however, some files are locked.  Could not delete the following files: " + filesNotDeleted);
            }
        }
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:30,代码来源:FileProvider.cs

示例2: DoAddNewModule

        private int DoAddNewModule(string title, int desktopModuleId, string paneName, int position, int permissionType, string align)
        {
            var objModules = new ModuleController();
            try
            {
                DesktopModuleInfo desktopModule;
                if (!DesktopModuleController.GetDesktopModules(PortalSettings.Current.PortalId).TryGetValue(desktopModuleId, out desktopModule))
                {
                    throw new ArgumentException("desktopModuleId");
                }
            }
            catch (Exception ex)
            {
                Exceptions.LogException(ex);
            }

	        var tabModuleId = Null.NullInteger;
            foreach (ModuleDefinitionInfo objModuleDefinition in
                ModuleDefinitionController.GetModuleDefinitionsByDesktopModuleID(desktopModuleId).Values)
            {
                var objModule = new ModuleInfo();
                objModule.Initialize(PortalSettings.Current.ActiveTab.PortalID);

                objModule.PortalID = PortalSettings.Current.ActiveTab.PortalID;
                objModule.TabID = PortalSettings.Current.ActiveTab.TabID;
                objModule.ModuleOrder = position;
                objModule.ModuleTitle = string.IsNullOrEmpty(title) ? objModuleDefinition.FriendlyName : title;
                objModule.PaneName = paneName;
                objModule.ModuleDefID = objModuleDefinition.ModuleDefID;
                if (objModuleDefinition.DefaultCacheTime > 0)
                {
                    objModule.CacheTime = objModuleDefinition.DefaultCacheTime;
                    if (PortalSettings.Current.DefaultModuleId > Null.NullInteger && PortalSettings.Current.DefaultTabId > Null.NullInteger)
                    {
                        ModuleInfo defaultModule = objModules.GetModule(PortalSettings.Current.DefaultModuleId, PortalSettings.Current.DefaultTabId, true);
                        if ((defaultModule != null))
                        {
                            objModule.CacheTime = defaultModule.CacheTime;
                        }
                    }
                }

				objModules.InitialModulePermission(objModule, objModule.TabID, permissionType);

                if (PortalSettings.Current.ContentLocalizationEnabled)
                {
                    Locale defaultLocale = LocaleController.Instance.GetDefaultLocale(PortalSettings.Current.PortalId);
                    //set the culture of the module to that of the tab
                    var tabInfo = new TabController().GetTab(objModule.TabID, PortalSettings.Current.PortalId, false);
                    objModule.CultureCode = tabInfo != null ? tabInfo.CultureCode : defaultLocale.Code;
                }
                else
                {
                    objModule.CultureCode = Null.NullString;
                }
                objModule.AllTabs = false;
                objModule.Alignment = align;

                objModules.AddModule(objModule);

				if (tabModuleId == Null.NullInteger)
				{
					tabModuleId = objModule.ModuleID;
				}
				//update the position to let later modules with add after previous one.
	            position = objModules.GetTabModule(objModule.TabModuleID).ModuleOrder + 1;
            }

			return tabModuleId;
        }
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:70,代码来源:ControlBarController.cs


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