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


C# UIElementInfo类代码示例

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


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

示例1: 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

示例2: 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

示例3: uiGuide_OnGuideItemCreated

    protected List<string> uiGuide_OnGuideItemCreated(UIElementInfo uiElement, List<string> defaultItem)
    {
        switch (uiElement.ElementName.ToLowerCSafe())
        {
            case "tools.ecommerce":
                if (!LicenseHelper.IsFeatureAvailableInUI(FeatureEnum.Ecommerce, ModuleEntry.ECOMMERCE))
                {
                    return null;
                }
                break;

            case "tools.onlinemarketing":
            case "onlinemarketing.contactmanagement":
                if (!LicenseHelper.IsFeatureAvailableInUI(FeatureEnum.ContactManagement, ModuleEntry.ONLINEMARKETING))
                {
                    return null;
                }
                break;

            case "onlinemarketing.automationprocess":
                if (!WorkflowInfoProvider.IsMarketingAutomationAllowed())
                {
                    return null;
                }
                break;
        }

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

示例4: 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

示例5: ucUIToolbar_OnButtonFiltered

    /// <summary>
    /// On button filtered handler.
    /// </summary>
    bool ucUIToolbar_OnButtonFiltered(UIElementInfo uiElement)
    {
        bool moduleOnSite = true;
        string siteName = CMSContext.CurrentSiteName;

        // Check whether modules are assigned to current site
        switch (uiElement.ElementName.ToLower())
        {
            case "myfriends":
                moduleOnSite = ResourceSiteInfoProvider.IsResourceOnSite("CMS.Friends", siteName);
                break;

            case "mymessages":
                moduleOnSite = ResourceSiteInfoProvider.IsResourceOnSite("CMS.Messaging", siteName);
                break;

            case "myblogs":
                moduleOnSite = ResourceSiteInfoProvider.IsResourceOnSite("CMS.Blog", siteName);
                break;

            case "myprojects":
                moduleOnSite = ResourceSiteInfoProvider.IsResourceOnSite("CMS.ProjectManagement", siteName);
                break;
        }

        // Check whether separable modules are loaded
        return moduleOnSite && IsMyDeskUIElementAvailable(uiElement.ElementName);
    }
开发者ID:puentepr,项目名称:kentico-site-example,代码行数:31,代码来源:mainmenu.aspx.cs

示例6: uiGuide_OnGuideItemCreated

    protected List<string> uiGuide_OnGuideItemCreated(UIElementInfo uiElement, List<string> defaultItem)
    {
        switch (uiElement.ElementName.ToLowerCSafe())
        {
            case "development.notifications":
                if (!LicenseHelper.IsFeatureAvailableInUI(FeatureEnum.Notifications, ModuleEntry.NOTIFICATIONS))
                {
                    return null;
                }
                break;

            case "development.customtables":
                if (!LicenseHelper.IsFeatureAvailableInUI(FeatureEnum.CustomTables))
                {
                    return null;
                }
                break;

            case "development.translationservices":
                if (!LicenseHelper.IsFeatureAvailableInUI(FeatureEnum.TranslationServices, ModuleEntry.TRANSLATIONSERVICES))
                {
                    return null;
                }
                break;

            case "development.workflows":
                if (!LicenseHelper.IsFeatureAvailableInUI(FeatureEnum.WorkflowVersioning))
                {
                    return null;
                }
                break;
        }

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

示例7: 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

示例8: guide_OnGuideItemCreated

 object[] guide_OnGuideItemCreated(UIElementInfo uiElement, object[] defaultItem)
 {
     if (!IsMyDeskUIElementAvailable(uiElement.ElementName))
     {
         return null;
     }
     return defaultItem;
 }
开发者ID:puentepr,项目名称:kentico-site-example,代码行数:8,代码来源:MyDesk.aspx.cs

示例9: guide_OnGuideItemCreated

 object[] guide_OnGuideItemCreated(UIElementInfo uiElement, object[] defaultItem)
 {
     if (!IsAdministrationUIElementAvailable(uiElement))
     {
         return null;
     }
     return defaultItem;
 }
开发者ID:puentepr,项目名称:kentico-site-example,代码行数:8,代码来源:Administration.aspx.cs

示例10: guide_OnGuideItemCreated

 private List<string> guide_OnGuideItemCreated(UIElementInfo uiElement, List<string> defaultItem)
 {
     if (!IsAdministrationUIElementAvailable(uiElement))
     {
         return null;
     }
     return defaultItem;
 }
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:8,代码来源:Administration.aspx.cs

示例11: guide_OnGuideItemCreated

 private List<string> guide_OnGuideItemCreated(UIElementInfo uiElement, List<string> defaultItem)
 {
     if (!IsMyDeskUIElementAvailable(uiElement.ElementName))
     {
         return null;
     }
     return defaultItem;
 }
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:8,代码来源:MyDesk.aspx.cs

示例12: btnOK_Click

    /// <summary>
    /// Handles btnOK's OnClick event - Update resource info.
    /// </summary>
    protected void btnOK_Click(object sender, EventArgs e)
    {
        // Finds whether required fields are not empty
        string result = new Validator().NotEmpty(tbModuleDisplayName.Text.Trim(), GetString("Administration-Module_New.ErrorEmptyModuleDisplayName")).NotEmpty(tbModuleCodeName.Text, GetString("Administration-Module_New.ErrorEmptyModuleCodeName"))
            .IsCodeName(tbModuleCodeName.Text, GetString("general.invalidcodename"))
            .Result;

        if (result == "")
        {
            // Check unique name
            ResourceInfo ri = ResourceInfoProvider.GetResourceInfo(tbModuleCodeName.Text);
            if ((ri == null) || (ri.ResourceId == moduleId))
            {
                // Get object
                if (ri == null)
                {
                    ri = ResourceInfoProvider.GetResourceInfo(moduleId);
                    if (ri == null)
                    {
                        ri = new ResourceInfo();
                    }
                }

                // Update resource info
                ri.ResourceId = moduleId;
                ri.ResourceName = tbModuleCodeName.Text;
                ri.ResourceDescription = txtModuleDescription.Text.Trim();
                ri.ResourceDisplayName = tbModuleDisplayName.Text.Trim();

                ResourceInfoProvider.SetResourceInfo(ri);

                // Update root UIElementInfo of the module
                UIElementInfo elemInfo = UIElementInfoProvider.GetRootUIElementInfo(ri.ResourceId);
                if (elemInfo == null)
                {
                    elemInfo = new UIElementInfo();
                }
                elemInfo.ElementResourceID = ri.ResourceId;
                elemInfo.ElementDisplayName = ri.ResourceDisplayName;
                elemInfo.ElementName = ri.ResourceName.ToLowerCSafe().Replace(".", "");
                elemInfo.ElementIsCustom = false;
                UIElementInfoProvider.SetUIElementInfo(elemInfo);

                // Show message
                ShowChangesSaved();
            }
            else
            {
                // Show error message
                ShowError(GetString("Administration-Module_New.UniqueCodeName"));
            }
        }
        else
        {
            // Show error message
            ShowError(result);
        }
    }
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:61,代码来源:Module_Edit_General.aspx.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


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