• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Tabs.TabController类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DotNetNuke.Entities.Tabs.TabController的典型用法代码示例。如果您正苦于以下问题:C# TabController类的具体用法?C# TabController怎么用?C# TabController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TabController类属于DotNetNuke.Entities.Tabs命名空间,在下文中一共展示了TabController类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: LoadSettings

        public override void LoadSettings()
        {
            try
            {

                if (!Page.IsPostBack)
                {
                    TabController tabCtrl = new TabController();
                    var currentTab = tabCtrl.GetTab(TabId, PortalId, true);
                    foreach (var module in currentTab.ChildModules)
                    {
                        var modInfo = module.Value as ModuleInfo;
                        if (modInfo.ModuleDefinition.DefinitionName == "QuickDocsPro")
                        {
                            ddlQDPModule.Items.Add(new ListItem(modInfo.ModuleControl.ControlTitle, modInfo.ModuleID.ToString()));
                        }
                    }

                    if ((string)TabModuleSettings["QDPModule"] != null)
                    {
                        ddlQDPModule.Items.FindByValue((string)TabModuleSettings["QDPModule"].ToString()).Selected = true;
                    }
                }
            }
            catch (Exception exc)
            {
                //Module failed to load
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
开发者ID:heitkea,项目名称:DNN_DEV_7_2,代码行数:30,代码来源:ExplorerSettings.ascx.cs


示例2: GetUrls

        /// <summary>
        ///   Includes page urls on the sitemap
        /// </summary>
        /// <remarks>
        ///   Pages that are included:
        ///   - are not deleted
        ///   - are not disabled
        ///   - are normal pages (not links,...)
        ///   - are visible (based on date and permissions)
        /// </remarks>
        public override List<SitemapUrl> GetUrls(int portalId, PortalSettings ps, string version)
        {
            var objTabs = new TabController();
            SitemapUrl pageUrl = null;
            var urls = new List<SitemapUrl>();

            useLevelBasedPagePriority = bool.Parse(PortalController.GetPortalSetting("SitemapLevelMode", portalId, "False"));
            minPagePriority = float.Parse(PortalController.GetPortalSetting("SitemapMinPriority", portalId, "0.1"), CultureInfo.InvariantCulture);
            includeHiddenPages = bool.Parse(PortalController.GetPortalSetting("SitemapIncludeHidden", portalId, "True"));

            this.ps = ps;

            foreach (TabInfo objTab in objTabs.GetTabsByPortal(portalId).Values)
            {
                if (!objTab.IsDeleted && !objTab.DisableLink && objTab.TabType == TabType.Normal && (Null.IsNull(objTab.StartDate) || objTab.StartDate < DateTime.Now) &&
                    (Null.IsNull(objTab.EndDate) || objTab.EndDate > DateTime.Now) && IsTabPublic(objTab.TabPermissions))
                {
                    if (includeHiddenPages || objTab.IsVisible)
                    {
                        pageUrl = GetPageUrl(objTab, (ps.ContentLocalizationEnabled) ? objTab.CultureCode : null);
                        urls.Add(pageUrl);
                    }
                }
            }


            return urls;
        }
开发者ID:ryanmalone,项目名称:BGDNNWEB,代码行数:38,代码来源:CoreSitemapProvider.cs


示例3: FormatCrossPortalTabUrl

        public static string FormatCrossPortalTabUrl (IModuleControl module, int tabId, bool trackClicks)
        {
            try {
                // get tab info by tabId
                var tab = new TabController ().GetTab (tabId, Null.NullInteger, false);

                // check if this tab belongs to another portal
                if (tab.PortalID != module.ModuleContext.PortalId) {
                    // get portal alias, primary first (we don't know exactly,
                    // which portal aliases are globally-available, and which are not)
                    var portalAlias = PortalAliasController.Instance.GetPortalAliasesByPortalId (tab.PortalID)
                        .OrderBy (pa => !pa.IsPrimary).First ();

                    // target portal URL (let target portal use right protocol and do URL rewriting)
                    return "http://" + portalAlias.HTTPAlias + (trackClicks ?
                        string.Format ("/LinkClick.aspx?link={0}&tabid={1}", tabId, module.ModuleContext.TabId) :
                        string.Format ("/Default.aspx?tabid={0}", tabId));
                }

                // tab is on same portal
                return FormatURL (module, tabId.ToString (), trackClicks);
            }
            catch {
                return string.Empty;
            }
        }
开发者ID:roman-yagodin,项目名称:R7.University,代码行数:26,代码来源:UniversityUrlHelper.cs


示例4: TestFixtureSetUp

        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();

            var tc = new TabController();
            var tab = tc.GetTabByName(_aboutUsPageName, PortalId);
            _tabId = tab.TabID;

            //Add Portal Aliases
            var aliasController = new PortalAliasController();
            TestUtil.ReadStream(String.Format("{0}", "Aliases"), (line, header) =>
                        {
                            string[] fields = line.Split(',');
                            var alias = aliasController.GetPortalAlias(fields[0], PortalId);
                            if (alias == null)
                            {
                                alias = new PortalAliasInfo
                                                {
                                                    HTTPAlias = fields[0],
                                                    PortalID = PortalId
                                                };
                                TestablePortalAliasController.Instance.AddPortalAlias(alias);
                            }
                        });
            TestUtil.ReadStream(String.Format("{0}", "Users"), (line, header) =>
                        {
                            string[] fields = line.Split(',');

                            TestUtil.AddUser(PortalId, fields[0].Trim(), fields[1].Trim(), fields[2].Trim());
                        });
        }
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:31,代码来源:FriendlyUrlTests.cs


示例5: UpgradeModule

        /// <summary>
        /// Upgrades the module.
        /// </summary>
        /// <param name="Version">The version.</param>
        /// <returns>System.String.</returns>
        public string UpgradeModule(string Version)
        {
            TabController tabs = new TabController();
            foreach (PortalInfo p in new PortalController().GetPortals())
            {
                TabInfo tabInfo = tabs.GetTabByName("Vanity Urls", p.PortalID);
                if (tabInfo == null)
                {

                    tabInfo = new TabInfo();
                    tabInfo.TabID = -1;
                    tabInfo.ParentId = tabs.GetTabByName("Admin", p.PortalID).TabID;
                    tabInfo.PortalID = p.PortalID;
                    tabInfo.TabName = "Vanity Urls";
                    try
                    {
                        int tabId = tabs.AddTab(tabInfo);
                        AddModuleToPage(p.PortalID, tabId);
                        return "Vanity Urls page added";
                    }
                    catch (Exception ex)
                    {
                        DotNetNuke.Services.Exceptions.Exceptions.LogException(ex);
                    }
                }
            }

            return "";
        }
开发者ID:jsheely,项目名称:DotNetNuke-VanityUrls,代码行数:34,代码来源:DNNController.cs


示例6: GetDnnHttpHandler

        public IHttpHandler GetDnnHttpHandler(RequestContext requestContext, int portal, int tab, string[] passThrough)
        {
            PortalController pcontroller = new PortalController();
            PortalInfo pinfo = pcontroller.GetPortal(portal);
            PortalAliasController pacontroller = new PortalAliasController();
            PortalAliasCollection pacollection = pacontroller.GetPortalAliasByPortalID(portal);
            //pacollection.
            //PortalSettings psettings = new PortalSettings(pinfo);
            PortalSettings psettings = new PortalSettings(tab, portal);               // 64 is the stats tab. TODO: get by page name and not hardcoded id
            foreach (string key in pacollection.Keys)
            {
                psettings.PortalAlias = pacollection[key];
            }
            TabController tcontroller = new TabController();
            // psettings.ActiveTab = tcontroller.GetTab(57, 0, true);                  // 57 is the profile tab.
            requestContext.HttpContext.Items["PortalSettings"] = psettings;

            requestContext.HttpContext.Items["UrlRewrite:OriginalUrl"] = requestContext.HttpContext.Request.RawUrl;
            //UserInfo uinfo = requestContext.HttpContext.User == null ? new UserInfo() : UserController.GetUserByName(psettings.PortalId, requestContext.HttpContext.User.Identity.Name);
            UserInfo uinfo = requestContext.HttpContext.User == null ? new UserInfo() : UserController.GetCachedUser(psettings.PortalId, requestContext.HttpContext.User.Identity.Name);
            requestContext.HttpContext.Items["UserInfo"] = uinfo;
            foreach (string s in passThrough)
            {
                requestContext.HttpContext.Items[s] = requestContext.RouteData.Values[s];
            }
            IHttpHandler page = BuildManager.CreateInstanceFromVirtualPath(VirtualPath, typeof(DotNetNuke.Framework.PageBase)) as IHttpHandler;
            return page;
        }
开发者ID:huaminglee,项目名称:FlexFWD,代码行数:28,代码来源:RouteHandler.cs


示例7: UrlForTabFriendly

        public static string UrlForTabFriendly(int tabId, string csvParams, string friendlyPagePath)
        {
            string tabUrl = Globals.ApplicationURL(tabId);
            TabInfo tabInfo = new TabController().GetTab(tabId, PortalSettings.PortalId, false);
            string tabUrlWithParams = tabUrl + ConvertCsvParamsToAmpersandParams(csvParams);

                try
                {
                    if (!string.IsNullOrEmpty(friendlyPagePath))
                    {
                        string pageName = friendlyPagePath.Trim();

                        // trim leading and trailing "/"
                        pageName = pageName.TrimStart('/').TrimEnd('/');

                        pageName = StringHelper.FormatForUrl(pageName, true);

                        if(!pageName.EndsWith(".aspx"))
                        {
                            pageName += ".aspx";
                        }
                        //string pageName = FormatForUrl(cityStateZip) + "/" + FormatForUrl(member.BusinessName) + ".aspx";

                        return Globals.FriendlyUrl(tabInfo, tabUrlWithParams, pageName, PortalSettings);
                    }
                }
                catch (Exception ex)
                {
                    Exceptions.LogException(ex);

                    return Globals.FriendlyUrl(tabInfo, tabUrlWithParams, PortalSettings);
                }
                return Globals.FriendlyUrl(tabInfo, tabUrlWithParams, PortalSettings);
        }
开发者ID:trantruong2007,项目名称:angeldnn,代码行数:34,代码来源:UrlHelper.cs


示例8: FindMessageTab

        //This method is copied from user skin object
        private int FindMessageTab()
        {
            var tabController = new TabController();
            var moduleController = new ModuleController();

            //On brand new install the new Message Center Module is on the child page of User Profile Page 
            //On Upgrade to 6.2.0, the Message Center module is on the User Profile Page
            var profileTab = tabController.GetTab(PortalSettings.UserTabId, PortalSettings.PortalId, false);
            if (profileTab != null)
            {
                var childTabs = tabController.GetTabsByPortal(profileTab.PortalID).DescendentsOf(profileTab.TabID);
                foreach (TabInfo tab in childTabs)
                {
                    foreach (KeyValuePair<int, ModuleInfo> kvp in moduleController.GetTabModules(tab.TabID))
                    {
                        var module = kvp.Value;
                        if (module.DesktopModule.FriendlyName == "Message Center")
                        {
                            return tab.TabID;                            
                        }
                    }
                }
            }

            //default to User Profile Page
            return PortalSettings.UserTabId;            
        }        
开发者ID:heitkea,项目名称:DNN_DEV_7_2,代码行数:28,代码来源:Toast.ascx.cs


示例9: BindData

        private void BindData()
        {
            using (var dt = new DataTable())
            {
                dt.Columns.Add(new DataColumn("TabId", typeof (Int32)));
                dt.Columns.Add(new DataColumn("ContentKey", typeof (String)));
                dt.Columns.Add(new DataColumn("Title", typeof (String)));
                dt.Columns.Add(new DataColumn("Description", typeof (String)));
                dt.Columns.Add(new DataColumn("PubDate", typeof (DateTime)));

                var results = new ContentController().GetContentItemsByTerm(_tagQuery).ToList();
                var tabController = new TabController();

                if (_tagQuery.Length > 0)
                {
                    foreach (var item in results)
                    {
                        var dr = dt.NewRow();
                        dr["TabId"] = item.TabID;
                        dr["ContentKey"] = item.ContentKey;
                        dr["Title"] = item.Content;

                        //get tab info and use the tab description, if tab is deleted then ignore the item.
                        var tab = tabController.GetTab(item.TabID, PortalId, false);
                        if(tab != null)
                        {
							if (tab.IsDeleted)
							{
								continue;
							}

							dr["Title"] = string.IsNullOrEmpty(tab.Title) ? tab.TabName : tab.Title;
                            dr["Description"] = tab.Description;
                        }
                        else
                        {
                            dr["Description"] = item.Content.Length > 1000 ? item.Content.Substring(0, 1000) : item.Content;
                        }

                        dr["PubDate"] = item.CreatedOnDate;
                        dt.Rows.Add(dr);
                    }
                }

                //Bind Search Results Grid
                var dv = new DataView(dt);
                dgResults.DataSource = dv;
                dgResults.DataBind();
              
                if (results.Count == 0)
                {
                    dgResults.Visible = false;
                    lblMessage.Text = string.Format(Localization.GetString("NoResults", LocalResourceFile), _tagQuery);
                }
                else
                {
                    lblMessage.Text = string.Format(Localization.GetString("Results", LocalResourceFile), _tagQuery);
                }
            }
        }
开发者ID:RichardHowells,项目名称:dnnextensions,代码行数:60,代码来源:ContentList.ascx.cs


示例10: AddCoursePage

        public TabInfo AddCoursePage(string tabName, string tabTitle)
        {
            PortalSettings portalSettings = new PortalSettings();
            int portalId = portalSettings.PortalId;

            TabController tabController = new TabController();
            TabInfo getTab = tabController.GetTabByName(tabName, portalId);
            if (getTab != null)
                throw new Exception("Cannot create Page. Page with this PageName already exists");

            TabInfo newTab = new TabInfo();
            newTab.PortalID = portalId;
            newTab.TabName = tabName;
            newTab.Title = tabTitle;
            newTab.SkinSrc = "[G]Skins/20047-UnlimitedColorPack-033/CoursePage.ascx";
            newTab.ContainerSrc = portalSettings.DefaultPortalContainer;
            CommonTabSettings(newTab);
            AddViewPermissions(newTab);

            int tabId = tabController.AddTab(newTab, true);
            DotNetNuke.Common.Utilities.DataCache.ClearModuleCache(tabId);

            AddTabURL(newTab); //Makes the URL of Page /4 or /C4

            // add modules to new page

            AddModuleToPage(newTab, ModuleType.DisplayCourse);

            AddModuleToPage(newTab, ModuleType.Rating);

            AddModuleToPage(newTab, ModuleType.Comments);

            return newTab;
        }
开发者ID:Jochumzen,项目名称:DisplayPluggOld,代码行数:34,代码来源:DNN.cs


示例11: OnLoad

 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     var controller = new TabController();
     lblHomePage.Text = controller.GetTab(ModuleContext.PortalSettings.HomeTabId, ModuleContext.PortalId,false).TabName;
     
     if (!IsPostBack) BindSettingControls();
 }
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:8,代码来源:SimpleSettingsView.ascx.cs


示例12: ResolvePageLink

        private string ResolvePageLink(int linkId, string defaultValue)
        {
            var tabController = new TabController();
            var tabInfo = tabController.GetTab(linkId);
            if (tabInfo == null)
                return defaultValue;

            return tabInfo.TabPath;
        }
开发者ID:BravoSierra,项目名称:2sxc,代码行数:9,代码来源:SexyContentValueConverter.cs


示例13: LoadSettings

        public override void LoadSettings()
        {
            try
            {
                if (Page.IsPostBack == false)
                {
                    var portalTabs = TabController.GetPortalTabs(PortalId, Null.NullInteger, false, true);

                    //Add host tabs
                    if (UserInfo != null && UserInfo.IsSuperUser)
                    {
                        var hostTabs = new TabController().GetTabsByPortal(Null.NullInteger);
                        portalTabs.AddRange(hostTabs.Values);
                    }
                    ParentTab.Items.Clear();
                    foreach (var t in portalTabs)
                    {
                        if ((TabPermissionController.CanViewPage(t)))
                        {
                            ParentTab.Items.Add(new ListItem(t.IndentedTabName, t.TabID.ToString()));
                        }
                    }
                    ParentTab.Items.Insert(0, "");
                    SelectDropDownListItem(ref ParentTab, "ParentTabID");
                    foreach (string val in ConsoleController.GetSizeValues())
                    {
                        DefaultSize.Items.Add(new ListItem(Localization.GetString(val, LocalResourceFile), val));
                    }
                    SelectDropDownListItem(ref DefaultSize, "DefaultSize");
                    if (Settings.ContainsKey("AllowSizeChange"))
                    {
                        AllowResize.Checked = Convert.ToBoolean(Settings["AllowSizeChange"]);
                    }
                    foreach (var val in ConsoleController.GetViewValues())
                    {
                        DefaultView.Items.Add(new ListItem(Localization.GetString(val, LocalResourceFile), val));
                    }
                    SelectDropDownListItem(ref DefaultView, "DefaultView");
                    if (Settings.ContainsKey("AllowViewChange"))
                    {
                        AllowViewChange.Checked = Convert.ToBoolean(Settings["AllowViewChange"]);
                    }
                    if (Settings.ContainsKey("ShowTooltip"))
                    {
                        ShowTooltip.Checked = Convert.ToBoolean(Settings["ShowTooltip"]);
                    }
                    if (Settings.ContainsKey("ConsoleWidth"))
                    {
                        ConsoleWidth.Text = Convert.ToString(Settings["ConsoleWidth"]);
                    }
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
开发者ID:sunsiz,项目名称:dnn6-chinese-language-pack,代码行数:57,代码来源:Settings.ascx.cs


示例14: MustNotHavePage

        private void MustNotHavePage(string pageName)
        {
            var controller = new TabController();
            TabInfo page = controller.GetTabByName(pageName, 0);

            if (page != null)
            {
                controller.DeleteTab(page.TabID, page.PortalID);
            }
        }
开发者ID:ryanmalone,项目名称:BGDNNWEB,代码行数:10,代码来源:BasePageSteps.cs


示例15: PageDesignersMustNotExist

 public void PageDesignersMustNotExist()
 {
     var tabController = new TabController();
     var tab = tabController.GetTabByName("Designers", 0);
     if (tab != null)
     {
         tabController.DeleteTab(tab.TabID, 0);
         Config.Touch();
     }
 }
开发者ID:biganth,项目名称:Curt,代码行数:10,代码来源:PageSteps.cs


示例16: CmdAddPageClick

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

            int selectedTabID = Int32.Parse(PageLst.SelectedValue);
            TabInfo selectedTab = tabCtrl.GetTab(selectedTabID, PortalSettings.ActiveTab.PortalID, false);
            var tabLocation = (TabRelativeLocation) Enum.Parse(typeof (TabRelativeLocation), LocationLst.SelectedValue);
            TabInfo newTab = RibbonBarManager.InitTabInfoObject(selectedTab, tabLocation);

            string templateFile = string.Empty;
            if ((!string.IsNullOrEmpty(TemplateLst.SelectedValue)))
            {
                templateFile = Path.Combine(PortalSettings.HomeDirectoryMapPath, "Templates\\" + TemplateLst.SelectedValue);
            }

            newTab.TabName = Name.Text;
            newTab.IsVisible = IncludeInMenu.Checked;

            string errMsg = string.Empty;
            try
            {
                RibbonBarManager.SaveTabInfoObject(newTab, selectedTab, tabLocation, templateFile);
            }
            catch (DotNetNukeException ex)
            {
                Exceptions.LogException(ex);
                errMsg = (ex.ErrorCode != DotNetNukeErrorCode.NotSet) ? GetString("Err." + ex.ErrorCode) : ex.Message;
            }
            catch (Exception ex)
            {
                Exceptions.LogException(ex);
                errMsg = ex.Message;
            }

            //Clear the Tab's Cached modules
            DataCache.ClearModuleCache(PortalSettings.ActiveTab.TabID);

            //Update Cached Tabs as TabPath may be needed before cache is cleared
            TabInfo tempTab;
            if (new TabController().GetTabsByPortal(PortalSettings.ActiveTab.PortalID).TryGetValue(newTab.TabID, out tempTab))
            {
                tempTab.TabPath = newTab.TabPath;
            }

            if ((string.IsNullOrEmpty(errMsg)))
            {
                Response.Redirect(Globals.NavigateURL(newTab.TabID));
            }
            else
            {
                errMsg = string.Format("<p>{0}</p><p>{1}</p>", GetString("Err.Header"), errMsg);
                Web.UI.Utilities.RegisterAlertOnPageLoad(this, new MessageWindowParameters(errMsg) { Title = GetString("Err.Title")});
            }
        }
开发者ID:goedings,项目名称:VendorLink,代码行数:54,代码来源:AddPage.ascx.cs


示例17: AddAdminPage

        /// <summary>
        /// AddAdminPage adds an Admin Tab Page
        /// </summary>
        ///	<param name="Portal">The Portal</param>
        ///	<param name="TabName">The Name to give this new Tab</param>
        ///	<param name="TabIconFile">The Icon for this new Tab</param>
        ///	<param name="IsVisible">A flag indicating whether the tab is visible</param>
        private static TabInfo AddAdminPage(PortalInfo Portal, string TabName, string TabIconFile, bool IsVisible)
        {
            TabController objTabController = new TabController();
            TabInfo AdminPage = objTabController.GetTab(Portal.AdminTabId, Portal.PortalID, false);

            TabPermissionCollection objTabPermissions = new TabPermissionCollection();
            AddPagePermission(ref objTabPermissions, "View", Convert.ToInt32(Portal.AdministratorRoleId));

            //Call AddPage with parentTab = AdminPage & RoleId = AdministratorRoleId
            return AddPage(AdminPage, TabName, TabIconFile, IsVisible, objTabPermissions, true);
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:18,代码来源:Upgrade.cs


示例18: GivenThereIsAPageCalled

        public void GivenThereIsAPageCalled(string pageName, Table permissions)
        {
            var reset = false;
            var tabController = new TabController();
            var tab = tabController.GetTabByName(pageName, PortalId);
            if (tab == null)
            {
                tab = new TabInfo
                {
                    TabName = pageName,
                    PortalID = 0
                };
                tab.TabID = tabController.AddTab(tab);
                foreach (var row in permissions.Rows)
                {
                    var roleId = -1;
                    var roleController = new RoleController();
                    if (row[0] == "All Users")
                    {
                        roleId = -1;
                    }
                    else
                    {
                        var role = roleController.GetRoleByName(PortalId, row[0]);
                        if (role == null)
                        {
                            if (roleController.GetRoleByName(Null.NullInteger, row[0]) == null)
                            {
                                role = new RoleInfo { RoleName = row[0], RoleGroupID = Null.NullInteger };
                                roleId = roleController.AddRole(role);
                            }
                        }
                    }
                    var permissionController = new PermissionController();
                    var permission = permissionController.GetPermissionByCodeAndKey("SYSTEM_TAB", row[1]);
                    var tabPermission = new TabPermissionInfo
                    {
                        PermissionID = 3,
                        TabID = tab.TabID,
                        AllowAccess = true,
                        RoleID = roleId
                    };
                    tab.TabPermissions.Add(tabPermission);
                }

                tabController.UpdateTab(tab);
                reset = true;
            }
            Page = tab;
            if (reset)
            {
                Config.Touch();
            }
        }
开发者ID:biganth,项目名称:Curt,代码行数:54,代码来源:PageSteps.cs


示例19: MustHaveTestPageAdded

 public void MustHaveTestPageAdded()
 {
     //Create a tabInfo obj, then use TabController AddTab Method?
     TabInfo newPage = new TabInfo();
     newPage.TabName = "Test Page";
     newPage.PortalID = 0;
     newPage.SkinSrc = "[G]Skins/Aphelia/twoColumn-rightAside.ascx";
     newPage.ContainerSrc = "[G]Containers/Aphelia/Title.ascx";
     TabController tabController = new TabController();
     var tab = tabController.GetTabByName("Test Page", 0);
     if (tab == null)
     {
         try
         {
             tabController.AddTab(newPage);
         }
         catch (Exception exc)
         {
             Assert.IsTrue(false, "Add Tab result: " + exc.Message);
         }
         //tabController.AddTab(newPage);
         newPage = tabController.GetTabByName("Test Page", 0);
         TabPermissionInfo tabPermission = new TabPermissionInfo();
         tabPermission.PermissionID = 3;
         tabPermission.TabID = newPage.TabID;
         tabPermission.AllowAccess = true;
         tabPermission.RoleID = 0;
         newPage.TabPermissions.Add(tabPermission);
         try
         {
             tabController.UpdateTab(newPage);
         }
         catch (Exception exc)
         {
             Assert.IsTrue(false, "Update Tab result: " + exc.Message);
         }
         newPage = tabController.GetTabByName("Test Page", 0);
         tabPermission.RoleID = 0;
         tabPermission.PermissionID = 4;
         tabPermission.TabID = newPage.TabID;
         tabPermission.AllowAccess = true;
         newPage.TabPermissions.Add(tabPermission);
         try
         {
             tabController.UpdateTab(newPage);
         }
         catch (Exception exc)
         {
             Assert.IsTrue(false, "Update Tab Permissions result: " + exc.Message);
         }
         Thread.Sleep(1500);
     }
 }
开发者ID:ryanmalone,项目名称:BGDNNWEB,代码行数:53,代码来源:BasePageSteps.cs


示例20: UpgradeModule

        public string UpgradeModule(string version)
        {
            PackageInfo package = PackageController.GetPackageByName(ModuleName);
            IDictionary<int, TabInfo> moduleTabs = new TabController().GetTabsByPackageID(-1, package.PackageID, false);

            if (moduleTabs.Count > 0)
                return string.Empty;

            AddClientResourceAdminHostPage();

            return Localization.GetString("SuccessMessage", ResourceFileRelativePath);
        }
开发者ID:irobinson,项目名称:ClientResourceAdmin,代码行数:12,代码来源:DnnFeatureController.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Tabs.TabInfo类代码示例发布时间:2022-05-24
下一篇:
C# Portals.PortalSettings类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap