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


C# ModuleController.GetModules方法代码示例

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


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

示例1: UpdateWorkflow

        /// -----------------------------------------------------------------------------
        /// <summary>
        ///   UpdateWorkFlow updates the currently active Workflow
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="WorkFlowType">The type of workflow (Module | Page | Site)</param>
        /// <param name = "WorkflowID">The ID of the Workflow</param>
        /// <param name="ObjectID">The ID of the object to apply the update to (depends on WorkFlowType)</param>
        /// <param name="ReplaceExistingSettings">Should existing settings be overwritten?</param>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public void UpdateWorkflow(int ObjectID, string WorkFlowType, int WorkflowID, bool ReplaceExistingSettings)
        {
            var tabController = new TabController();
            var moduleController = new ModuleController();

            switch (WorkFlowType)
            {
                case "Module":
                    moduleController.UpdateModuleSetting(ObjectID, "WorkflowID", WorkflowID.ToString());
                    break;
                case "Page":
                    tabController.UpdateTabSetting(ObjectID, "WorkflowID", WorkflowID.ToString());
                    if (ReplaceExistingSettings)
                    {
                        //Get All Modules on the current Tab
                        foreach (var kvp in moduleController.GetTabModules(ObjectID))
                        {
                            ClearModuleSettings(kvp.Value);
                        }
                    }
                    break;
                case "Site":
                    PortalController.UpdatePortalSetting(ObjectID, "WorkflowID", WorkflowID.ToString());
                    if (ReplaceExistingSettings)
                    {
                        //Get All Tabs aon the Site
                        foreach (var kvp in tabController.GetTabsByPortal(ObjectID))
                        {
                            tabController.DeleteTabSetting(kvp.Value.TabID, "WorkFlowID");
                        }
                        //Get All Modules in the current Site
                        foreach (ModuleInfo objModule in moduleController.GetModules(ObjectID))
                        {
                            ClearModuleSettings(objModule);
                        }
                    }
                    break;
            }
        }
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:52,代码来源:HtmlTextController.cs

示例2: BindPages

        private void BindPages() {
            ModuleController mc = new ModuleController();
            TabController tc = new TabController();
            TabInfo tabInfo;
            foreach (ModuleInfo moduleInfo in mc.GetModules(PortalId)) {

                if (moduleInfo.DesktopModule.ModuleName.Contains("Social Groups") && moduleInfo.IsDeleted == false) {
                    tabInfo = tc.GetTab(moduleInfo.TabID, PortalId, false);
                    if (tabInfo != null) {
                        if (tabInfo.IsDeleted == false) {

                            foreach (KeyValuePair<string, ModuleDefinitionInfo> def in moduleInfo.DesktopModule.ModuleDefinitions) {
                                if (moduleInfo.ModuleDefinition.FriendlyName == def.Key) {
                                    
                                        if (drpGroupViewPage.Items.FindByValue(tabInfo.TabID.ToString()) == null) {
                                            drpGroupViewPage.Items.Add(new ListItem(tabInfo.TabName + " - " + def.Key, tabInfo.TabID.ToString()));
                                        }
                                                             

                                    }

                                }
                            }



                        }
                    }
                }
            }
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:30,代码来源:ListSettings.ascx.cs

示例3: ClearPortalCacheInternal

        private void ClearPortalCacheInternal(int portalId, bool cascade, bool clearRuntime)
        {
            RemoveFormattedCacheKey(DataCache.PortalSettingsCacheKey, clearRuntime, portalId);

            Dictionary<string, Locale> locales = LocaleController.Instance.GetLocales(portalId);
            if (locales == null || locales.Count == 0)
            {
                //At least attempt to remove default locale
                string defaultLocale = PortalController.GetPortalDefaultLanguage(portalId);
                RemoveCacheKey(String.Format(DataCache.PortalCacheKey, portalId, defaultLocale), clearRuntime);
            }
            else
            {
                foreach (Locale portalLocale in LocaleController.Instance.GetLocales(portalId).Values)
                {
                    RemoveCacheKey(String.Format(DataCache.PortalCacheKey, portalId, portalLocale.Code), clearRuntime);
                }
            }
            if (cascade)
            {
                var objTabs = new TabController();
                foreach (KeyValuePair<int, TabInfo> tabPair in objTabs.GetTabsByPortal(portalId))
                {
                    ClearModuleCacheInternal(tabPair.Value.TabID, clearRuntime);
                }
                var moduleController = new ModuleController();
                foreach (ModuleInfo moduleInfo in moduleController.GetModules(portalId))
                {
                    RemoveCacheKey("GetModuleSettings" + moduleInfo.ModuleID, clearRuntime);
                }
            }
			
            //Clear "portal keys" for Portal
            ClearFolderCacheInternal(portalId, clearRuntime);
            ClearCacheKeysByPortalInternal(portalId, clearRuntime);
            ClearDesktopModuleCacheInternal(portalId, clearRuntime);
            ClearTabCacheInternal(portalId, clearRuntime);

            RemoveCacheKey(String.Format(DataCache.RolesCacheKey, portalId), clearRuntime);
        }
开发者ID:biganth,项目名称:Curt,代码行数:40,代码来源:CachingProvider.cs

示例4: LoadData

        private void LoadData()
        {
            var moduleController = new ModuleController();
            var tabController = new TabController();
            var currentLocale = LocaleController.Instance.GetCurrentLocale(PortalId);

            TabCollection tabsList = modeButtonList.SelectedValue == "ALL"
                             ? tabController.GetTabsByPortal(PortalId)
                             : tabController.GetTabsByPortal(PortalId).WithCulture(currentLocale.Code, true);

            DeletedTabs = tabsList.Values.Where(tab => tab.IsDeleted)
                                            .OrderBy(tab => tab.TabPath)
                                            .ToList();

            DeletedModules = moduleController.GetModules(PortalId)
                                                .Cast<ModuleInfo>()
                                                .Where(module => module.IsDeleted && (modeButtonList.SelectedValue == "ALL" || module.CultureCode == currentLocale.Code))
                                                .ToList();
        }
开发者ID:rcedev,项目名称:evans-software-solutions,代码行数:19,代码来源:RecycleBin.ascx.cs

示例5: BindData

		/// <summary>
		/// Loads deleted tabs and modules into the lists 
		/// </summary>
		/// <remarks>
		/// </remarks>
		/// <history>
		/// 	[VMasanas]	18/08/2004	
		///   [VMasanas]  20/08/2004  Update display information for deleted modules to:
		///               ModuleFriendlyName: ModuleTitle - Tab: TabName
		/// </history>
		private void BindData()
		{
			var objModules = new ModuleController();
			var objTabs = new TabController();
			TabInfo objTab;
			ModuleInfo objModule;
			int intModule;

			lstModules.Items.Clear();
			lstTabs.Items.Clear();

			var currentLocale = LocaleController.Instance.GetCurrentLocale(PortalId);

			var arrDeletedTabs = new ArrayList();
			TabCollection tabsList;
			if (modeButtonList.SelectedValue == "ALL")
			{
				tabsList = objTabs.GetTabsByPortal(PortalId);
			}
			else
			{
				tabsList = objTabs.GetTabsByPortal(PortalId).WithCulture(currentLocale.Code, true);
			}

			foreach (var tab in tabsList.Values)
			{
				if (tab.IsDeleted)
				{
					arrDeletedTabs.Add(tab);
				}
			}

			var arrModules = objModules.GetModules(PortalId);
			for (intModule = 0; intModule <= arrModules.Count - 1; intModule++)
			{
				objModule = (ModuleInfo) arrModules[intModule];
				if (objModule.IsDeleted && (modeButtonList.SelectedValue == "ALL" || objModule.CultureCode == currentLocale.Code))
				{
					if (String.IsNullOrEmpty(objModule.ModuleTitle))
					{
						objModule.ModuleTitle = objModule.DesktopModule.FriendlyName;
					}
					var locale = LocaleController.Instance.GetLocale(objModule.CultureCode);
					if (locale != null)
					{
						objTab = objTabs.GetTabByCulture(objModule.TabID, PortalId, locale);
					}
					else
					{
						objTab = objTabs.GetTab(objModule.TabID, PortalId, false);
					}

					if (objTab == null)
					{
						lstModules.Items.Add(new ListItem(objModule.ModuleTitle, objModule.TabID + "-" + objModule.ModuleID));
					}
					else if (objTab.TabID == objModule.TabID)
					{
						lstModules.Items.Add(new ListItem(objTab.TabName + " - " + objModule.ModuleTitle, objModule.TabID + "-" + objModule.ModuleID));
					}
				}
			}
			lstTabs.DataSource = arrDeletedTabs;
			lstTabs.DataBind();

			cmdRestoreTab.Enabled = (arrDeletedTabs.Count > 0);
			cmdDeleteTab.Enabled = (arrDeletedTabs.Count > 0);

			cmdRestoreModule.Enabled = (lstModules.Items.Count > 0);
			cmdDeleteModule.Enabled = (lstModules.Items.Count > 0);

			cmdEmpty.Enabled = arrDeletedTabs.Count > 0 || lstModules.Items.Count > 0;
		}
开发者ID:marceltoben,项目名称:evandrix.github.com,代码行数:83,代码来源:RecycleBin.ascx.cs

示例6: BindData

        private void BindData()
        {
            LocalizeModule();

            // load the pages that have social group modules on them
            var mc = new ModuleController();
            var tc = new TabController();
            TabInfo tabInfo;

            foreach (ModuleInfo moduleInfo in mc.GetModules(PortalId))
            {

                if (moduleInfo.DesktopModule.ModuleName.Contains("Social Groups") && moduleInfo.IsDeleted == false)
                {
                    tabInfo = tc.GetTab(moduleInfo.TabID, PortalId, false);
                    if (tabInfo != null)
                    {
                        if (tabInfo.IsDeleted == false)
                        {

                            foreach (KeyValuePair<string, ModuleDefinitionInfo> def in moduleInfo.DesktopModule.ModuleDefinitions)
                            {
                                if (moduleInfo.ModuleDefinition.FriendlyName == def.Key)
                                {

                                    if (ddlGroupViewPage.Items.FindByValue(tabInfo.TabID.ToString()) == null)
                                    {
                                        ddlGroupViewPage.Items.Add(new ListItem(tabInfo.TabName + " - " + def.Key, tabInfo.TabID.ToString()));
                                    }

                                }

                            }
                        }

                    }
                }
            }

            // insert a default choice for usability
            ddlGroupViewPage.Items.Insert(0, new ListItem(GetLocalizedString("ddlGroupViewPage.Items.Default")));

            // if there is more than one item in the dropdown list, enable it
            ToggleGroupDetailsList((ddlGroupViewPage.Items.Count == 1));
        }
开发者ID:nvisionative,项目名称:dnnextensions,代码行数:45,代码来源:Settings.ascx.cs

示例7: BindData

        //tasks

        /// <summary>
        /// Loads deleted tabs and modules into the lists
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// 	[VMasanas]	18/08/2004
        ///   [VMasanas]  20/08/2004  Update display information for deleted modules to:
        ///               ModuleFriendlyName: ModuleTitle - Tab: TabName
        /// </history>
        private void BindData()
        {
            int intTab;
            ArrayList arrDeletedTabs = new ArrayList();
            TabController objTabs = new TabController();
            TabInfo objTab;

            ArrayList arrTabs = objTabs.GetTabs( PortalId );
            for( intTab = 0; intTab <= arrTabs.Count - 1; intTab++ )
            {
                objTab = (TabInfo)arrTabs[intTab];
                if( objTab.IsDeleted == true )
                {
                    arrDeletedTabs.Add( objTab );
                }
            }

            ModuleController objModules = new ModuleController();
            ModuleInfo objModule;
            int intModule;
            ArrayList arrDeletedModules = new ArrayList();

            ArrayList arrModules = objModules.GetModules( PortalId );
            for( intModule = 0; intModule <= arrModules.Count - 1; intModule++ )
            {
                objModule = (ModuleInfo)arrModules[intModule];
                if( objModule.IsDeleted == true )
                {
                    if( objModule.ModuleTitle == "" )
                    {
                        objModule.ModuleTitle = objModule.FriendlyName;
                    }
                    arrDeletedModules.Add( objModule );
                }
            }

            lstTabs.DataSource = arrDeletedTabs;
            lstTabs.DataBind();

            lstModules.DataSource = arrDeletedModules;
            lstModules.DataBind();

            cboTab.DataSource = Globals.GetPortalTabs(PortalSettings.DesktopTabs, -1, false, true, false, false, true);
            cboTab.DataBind();
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:57,代码来源:RecycleBin.ascx.cs


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