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


C# FormInfo.GetCategoryNames方法代码示例

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


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

示例1: InitForm

    /// <summary>
    /// Initializes the form.
    /// </summary>
    /// <param name="basicForm">Form</param>
    /// <param name="dr">Data row with the data</param>
    /// <param name="fi">Form info</param>
    private void InitForm(BasicForm basicForm, DataRow dr, FormInfo fi)
    {
        if (basicForm != null)
        {
            basicForm.DataRow = dr;
            if (webPartInstance != null)
            {
                basicForm.MacroTable = webPartInstance.MacroTable;
            }
            else
            {
                basicForm.MacroTable = new Hashtable(StringComparer.InvariantCultureIgnoreCase);
            }

            if (!RequestHelper.IsPostBack() && (webPartInstance != null))
            {
                fi = new FormInfo(fi.GetXmlDefinition());

                // Load the collapsed/un-collapsed state of categories
                var categories = fi.GetCategoryNames();
                foreach (string category in categories)
                {
                    FormCategoryInfo fci = fi.GetFormCategory(category);
                    if (ValidationHelper.GetBoolean(fci.GetPropertyValue(FormCategoryPropertyEnum.Collapsible, basicForm.ContextResolver), false) && ValidationHelper.GetBoolean(fci.GetPropertyValue(FormCategoryPropertyEnum.CollapsedByDefault, basicForm.ContextResolver), false) && ValidationHelper.GetBoolean(webPartInstance.GetValue("cat_open_" + category), false))
                    {
                        fci.SetPropertyValue(FormCategoryPropertyEnum.CollapsedByDefault, "false");
                    }
                }
            }

            basicForm.SubmitButton.Visible = false;
            basicForm.SiteName = SiteContext.CurrentSiteName;
            basicForm.FormInformation = fi;
            basicForm.ShowPrivateFields = true;
            basicForm.OnItemValidation += formElem_OnItemValidation;
            basicForm.ReloadData();
        }
    }
开发者ID:dlnuckolls,项目名称:pfh-paypalintegration,代码行数:44,代码来源:WebpartProperties.ascx.cs

示例2: InitForm

    /// <summary>
    /// Initializes the form.
    /// </summary>
    /// <param name="form">Form</param>
    /// <param name="dr">Data row with the data</param>
    /// <param name="fi">Form info</param>
    private void InitForm(BasicForm form, DataRow dr, FormInfo fi)
    {
        if (form != null)
        {
            form.DataRow = dr;
            if (webPartInstance != null)
            {
                form.MacroTable = webPartInstance.MacroTable;
            }
            else
            {
                form.MacroTable = new Hashtable();
            }

            if (!RequestHelper.IsPostBack() && (webPartInstance != null))
            {
                fi = new FormInfo(fi.GetXmlDefinition());

                // Load the collapsed/un-collapsed state of categories
                var categories = fi.GetCategoryNames();
                foreach (string category in categories)
                {
                    FormCategoryInfo fci = fi.GetFormCategory(category);
                    if (fci.CategoryCollapsible && fci.CategoryCollapsedByDefault && ValidationHelper.GetBoolean(webPartInstance.GetValue("cat_open_" + category), false))
                    {
                        fci.CategoryCollapsedByDefault = false;
                    }
                }
            }

            form.SubmitButton.Visible = false;
            form.SiteName = CMSContext.CurrentSiteName;
            form.FormInformation = fi;
            form.ShowPrivateFields = true;
            form.OnItemValidation += formElem_OnItemValidation;
            form.ReloadData();
        }
    }
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:44,代码来源:WebpartProperties.ascx.cs


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