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