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