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


C# TabItem类代码示例

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


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

示例1: TabItemIsEnabledPropertyUpdateTest

        public void TabItemIsEnabledPropertyUpdateTest()
        {
            TabControl tabControl = new TabControl();

            TabItem tabItem1 = new TabItem();
            TabItem tabItem2 = new TabItem();

            tabControl.Items.Add(tabItem1);
            tabControl.Items.Add(tabItem2);

            CreateAsyncTask(tabControl,
                () => Assert.IsTrue(tabControl.IsEnabled),
                () => Assert.IsTrue(tabItem1.IsEnabled),
                () => Assert.IsTrue(tabItem2.IsEnabled),

                () => tabItem1.IsEnabled = false,
                () => tabControl.IsEnabled = false,
                () => Assert.IsFalse(tabItem1.IsEnabled),
                () => Assert.IsFalse(tabItem2.IsEnabled),

                () => tabControl.IsEnabled = true,
                () => Assert.IsFalse(tabItem1.IsEnabled),
                () => Assert.IsTrue(tabItem2.IsEnabled)
            );

            EnqueueTestComplete();
        }
开发者ID:dfr0,项目名称:moon,代码行数:27,代码来源:TabControlTest.cs

示例2: CMSDesk_Default_OnTabCreated

    protected TabItem CMSDesk_Default_OnTabCreated(UIElementInfo element, TabItem tab, int tabIndex)
    {
        // Ensure additional permissions to 'Content' tab
        if (element.ElementName.ToLowerCSafe() == "content")
        {
            if (!IsUserAuthorizedPerContent())
            {
                exploreTreePermissionMissing = true;
                return null;
            }
        }
        else if (element.ElementName.ToLowerCSafe() == "ecommerce")
        {
            if (!LicenseHelper.IsFeatureAvailableInUI(FeatureEnum.Ecommerce, ModuleEntry.ECOMMERCE))
            {
                return null;
            }
        }
        else if (element.ElementName.ToLowerCSafe() == "onlinemarketing")
        {
            if (!ModuleEntry.IsModuleLoaded(ModuleEntry.ONLINEMARKETING))
            {
                return null;
            }
        }

        return tab;
    }
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:28,代码来源:Default.aspx.cs

示例3: Tabs_OnTabCreated

    protected TabItem Tabs_OnTabCreated(UIElementInfo element, TabItem tab, int tabIndex)
    {
        switch (element.ElementName.ToLowerCSafe())
        {
            case "customers.customfields":

                // Check if customer has any custom fields
                FormInfo formInfo = FormHelper.GetFormInfo("ecommerce.customer", false);
                if (!formInfo.GetFormElements(true, false, true).Any())
                {
                    return null;
                }
                break;

            case "customers.newsletters":
                if (!ModuleEntry.IsModuleLoaded(ModuleEntry.NEWSLETTER))
                {
                    return null;
                }
                break;

            case "customers.credit":
                // Hide Credit tab for anonymous customer
                if ((customerInfoObj == null) || !customerInfoObj.CustomerIsRegistered)
                {
                    return null;
                }
                break;
        }

        return tab;
    }
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:32,代码来源:Customer_Edit_Header.aspx.cs

示例4: First_Tab_Should_Be_Selected_By_Default

        public void First_Tab_Should_Be_Selected_By_Default()
        {
            TabItem selected;
            var target = new TabControl
            {
                Template = new FuncControlTemplate<TabControl>(CreateTabControlTemplate),
                Items = new[]
                {
                    (selected = new TabItem
                    {
                        Name = "first",
                        Content = "foo",
                    }),
                    new TabItem
                    {
                        Name = "second",
                        Content = "bar",
                    },
                }
            };

            target.ApplyTemplate();

            Assert.Equal(0, target.SelectedIndex);
            Assert.Equal(selected, target.SelectedItem);
        }
开发者ID:abdelkarim,项目名称:Perspex,代码行数:26,代码来源:TabControlTests.cs

示例5: tabControl_OnTabCreated

    public TabItem tabControl_OnTabCreated(UIElementInfo uiElement, TabItem tab, int tabIndex)
    {
        switch (uiElement.ElementName.ToLowerCSafe())
        {
            case "tools":
                // Hide "Tools" tab if none of modules is available (E-commerce or Contact management)
                bool toolsAvailable = LicenseHelper.IsFeatureAvailableInUI(FeatureEnum.Ecommerce, ModuleEntry.ECOMMERCE) || LicenseHelper.IsFeatureAvailableInUI(FeatureEnum.ContactManagement, ModuleEntry.ONLINEMARKETING);
                if (!toolsAvailable)
                {
                    return null;
                }
                break;

            case "buy":
                if (!LicenseKeyInfoProvider.OnlyTrialLicenseKeys)
                {
                    return null;
                }
                break;

            case "dashboard":
                // Add hash to url
                tab.RedirectUrl = URLHelper.ResolveUrl(URLHelper.EnsureHashToQueryParameters(uiElement.ElementTargetURL));
                break;
        }

        return tab;
    }
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:28,代码来源:Default.aspx.cs

示例6: AddTab_Click

        //*******************************************************
        //
        // The AddTab_Click server event handler is used to add
        // a new security tab for this portal
        //
        //*******************************************************
        protected void AddTab_Click(Object Sender, EventArgs e)
        {
            // Obtain PortalSettings from Current Context
            PortalSettings portalSettings = (PortalSettings) Context.Items["PortalSettings"];

            // New tabs go to the end of the list
            TabItem t = new TabItem();
            t.TabName = "New Tab";
            t.TabId = -1;
            t.TabOrder = 999;
            portalTabs.Add(t);

            // write tab to database
            Configuration config = new Configuration();
            t.TabId = config.AddTab(portalSettings.PortalId, t.TabName, t.TabOrder);

            // reload the _portalSettings from the database
            HttpContext.Current.Items["PortalSettings"] = new PortalSettings(portalSettings.PortalId, t.TabId);

            // Reset the order numbers for the tabs within the list
            OrderTabs();

            // Redirect to edit page
            Response.Redirect("~/Admin/TabLayout.aspx?tabid=" + t.TabId);
        }
开发者ID:pdckxd,项目名称:bugtrackingsystem,代码行数:31,代码来源:Tabs.ascx.cs

示例7: AddPage

    public static void AddPage(TabControl tabControl, string tapName, Page page, bool maxSize = true)
    {
        if (maxSize)
        {
            page.Width = double.NaN;
            page.Height = double.NaN;
            page.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            page.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
        }

        Frame frame = new Frame();
        if (maxSize)
        {
            frame.Width = double.NaN;
            frame.Height = double.NaN;
            frame.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            frame.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
        }

        frame.Content = page;
        TabItem tabItem = new TabItem();
        tabItem.Header = tapName;
        tabItem.Content = frame;
        tabControl.Items.Add(tabItem);
    }
开发者ID:vesteksoftware,项目名称:VT8642,代码行数:25,代码来源:UIUtility.cs

示例8: AddPages

    public static void AddPages(TabControl tabControl, string tabName, bool maxSize, params Page[] pages)
    {
        Grid grid = new Grid();
        grid.Width = double.NaN;
        grid.Height = double.NaN;
        grid.Margin = new Thickness(0);
        grid.VerticalAlignment = VerticalAlignment.Top;

        if (maxSize)
        {
            grid.HorizontalAlignment = HorizontalAlignment.Stretch;
            grid.VerticalAlignment = VerticalAlignment.Stretch;
        }

        int index = 0;
        foreach (var item in pages)
        {
            ColumnDefinition col = new ColumnDefinition();
            col.Width = GridLength.Auto;
            grid.ColumnDefinitions.Add(col);
            SetPageToGrid(item, grid, 0, index);
            index++;
        }

        TabItem tabItem = new TabItem();
        tabItem.Header = tabName;
        tabItem.Content = grid;
        tabControl.Items.Add(tabItem);
    }
开发者ID:vesteksoftware,项目名称:Onyang_4L_3rd_Line_VT5080,代码行数:29,代码来源:UIUtility.cs

示例9: InitalizeMenu

    /// <summary>
    /// Initializes workflow edit menu.
    /// </summary>
    protected void InitalizeMenu()
    {
        // General tab
        TabItem general = new TabItem()
                            {
                                Text = GetString("general.general"),
                                RedirectUrl = "Workflow_General.aspx?workflowId=" + WorkflowId,
                                OnClientClick = "SetHelpTopic('helpTopic', 'workflow_general');"
                            };
        SetTab(general);

        // Steps tab
        TabItem steps = new TabItem()
                            {
                                Text = GetString("Development-Workflow_Edit.Steps"),
                                RedirectUrl = CurrentWorkflow.IsBasic ? "Workflow_Steps.aspx?workflowId=" + WorkflowId : "Workflow_Designer.aspx?workflowId=" + WorkflowId,
                                OnClientClick = CurrentWorkflow.IsBasic ? "SetHelpTopic('helpTopic', 'workflow_steps');" : "SetHelpTopic('helpTopic', 'workflow_designer');"
                            };
        SetTab(steps);

        // Display additional tabs for document workflow
        if (CurrentWorkflow.IsDocumentWorkflow)
        {
            // Hide if no site or no running site
            if ((SiteInfoProvider.GetSitesCount() > 0))
            {
                // Scopes tab
                TabItem scopes = new TabItem()
                {
                    Text = GetString("Development-Workflow_Edit.Scopes"),
                    RedirectUrl = "Workflow_Scopes.aspx?workflowId=" + WorkflowId,
                    OnClientClick = "SetHelpTopic('helpTopic', 'workflow_scope');"
                };
                SetTab(scopes);
            }
        }

        // E-mails tab
        TabItem emails = new TabItem()
        {
            Text = GetString("Development-Workflow_Edit.Emails"),
            RedirectUrl = "Workflow_Emails.aspx?workflowId=" + WorkflowId,
            OnClientClick = "SetHelpTopic('helpTopic', 'workflow_emails');"
        };
        SetTab(emails);

        // Display additional tabs for document workflow
        if (CurrentWorkflow.IsDocumentWorkflow)
        {
            // Documents tab
            TabItem docs = new TabItem()
            {
                Text = GetString("general.documents"),
                RedirectUrl = "Workflow_Documents.aspx?workflowId=" + WorkflowId,
                OnClientClick = "SetHelpTopic('helpTopic', 'workflow_documents');"
            };
            SetTab(docs);
        }
    }
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:62,代码来源:Workflow_Header.aspx.cs

示例10: Tabs_OnTabCreated

    protected TabItem Tabs_OnTabCreated(UIElementInfo element, TabItem tab, int tabIndex)
    {
        int siteId = SiteID;
        bool splitViewSupported = false;
        string lowerElementName = element.ElementName.ToLowerCSafe();

        // Skip some elements if editing just SKU without document binding
        switch (lowerElementName)
        {
            case "products.relatedproducts":
                if (NodeID <= 0)
                {
                    return null;
                }

                break;

            case "products.documents":
                if ((NodeID <= 0) && DisplayTreeInProducts)
                {
                    if (!CurrentUser.IsGlobalAdministrator || (sku == null) || !sku.IsGlobal)
                    {
                        return null;
                    }
                }

                break;

            case "products.workflow":
            case "products.versions":
                splitViewSupported = true;
                if ((NodeID <= 0) || (DocumentManager.Workflow == null))
                {
                    return null;
                }

                break;
        }

        // Ensure tab preselection
        if (lowerElementName.StartsWithCSafe("products.") && (lowerElementName.Substring("products.".Length) == selectedTab))
        {
            CurrentMaster.Tabs.SelectedTab = tabIndex;
        }

        // Add SiteId parameter to each tab
        if (!string.IsNullOrEmpty(tab.RedirectUrl) && (siteId != CMSContext.CurrentSiteID))
        {
            tab.RedirectUrl = URLHelper.AddParameterToUrl(tab.RedirectUrl, "siteId", siteId.ToString());
        }

        // Ensure split view mode
        if (splitViewSupported && CMSContext.DisplaySplitMode)
        {
            tab.RedirectUrl = GetSplitViewUrl(tab.RedirectUrl);
        }

        return tab;
    }
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:59,代码来源:Product_Edit_Advanced_Header.aspx.cs

示例11: TabItemDefaultValuesTest

        public void TabItemDefaultValuesTest()
        {
            TabItem tabItem = new TabItem();

            Assert.IsNull(tabItem.Header);
            Assert.IsFalse(tabItem.IsSelected);
            Assert.IsNull(tabItem.TestHook.TabControlParent);
        }
开发者ID:dfr0,项目名称:moon,代码行数:8,代码来源:TabItemTest.cs

示例12: SetIsEnabled

 public void SetIsEnabled()
 {
     TabItem tabItem = new TabItem();
     tabItem.IsEnabled = false;
     Assert.IsFalse(tabItem.IsEnabled);
     tabItem.IsEnabled = true;
     Assert.IsTrue(tabItem.IsEnabled);
 }
开发者ID:dfr0,项目名称:moon,代码行数:8,代码来源:TabItemTest.cs

示例13: Tabs_OnTabCreated

 protected TabItem Tabs_OnTabCreated(UIElementInfo element, TabItem tab, int tabIndex)
 {
     // Skip objects tab element if not have proper license
     if ((element.ElementName.ToLowerCSafe() == "myrecyclebin.objects") && !LicenseKeyInfoProvider.IsFeatureAvailable(FeatureEnum.ObjectVersioning))
     {
         return null;
     }
     return tab;
 }
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:9,代码来源:RecycleBin_Header.aspx.cs

示例14: Page_OnTabCreated

 // TODO JaroslavK: Po presunuti prijde odstranit
 protected TabItem Page_OnTabCreated(UIElementInfo element, TabItem tab, int tabIndex)
 {
     // Hide actions tab
     if (element.ElementName.EqualsCSafe("Automation_actions", true) && !CurrentUser.IsGlobalAdministrator)
     {
         return null;
     }
     return tab;
 }
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:10,代码来源:Header.aspx.cs

示例15: Tabs_OnTabCreated

    private TabItem Tabs_OnTabCreated(UIElementInfo element, TabItem tab, int tabIndex)
    {
        // Add SiteId parameter to each tab
        if (!string.IsNullOrEmpty(tab.RedirectUrl))
        {
            tab.RedirectUrl = URLHelper.AddParameterToUrl(tab.RedirectUrl, "siteId", SiteID.ToString());
        }

        return tab;
    }
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:10,代码来源:ShippingOption_Edit_Header.aspx.cs


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