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


C# EntityInfo.GetAttributeInfo方法代码示例

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


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

示例1: CreateMappingPanel

    /// <summary>
    /// Creates and initializes a new instance of the Panel class with the specified Data.com contact mapping, and returns it.
    /// </summary>
    /// <param name="formInfo">The CMS contact form info.</param>
    /// <param name="entityInfo">The Data.com contact entity info.</param>
    /// <param name="mapping">The Data.com contact mapping.</param>
    /// <returns>A new instance of the Panel class initialized with the specified Data.com contact mapping.</returns>
    private Panel CreateMappingPanel(FormInfo formInfo, EntityInfo entityInfo, EntityMapping mapping)
    {
        Panel mappingPanel = new Panel { CssClass = "mapping"};
        HtmlTable mappingTable = new HtmlTable();

        mappingTable.Controls.Add(CreateHeaderPanel());
        mappingPanel.Controls.Add(mappingTable);

        foreach (IDataDefinitionItem formItem in formInfo.ItemsList)
        {
            FormFieldInfo formField = formItem as FormFieldInfo;
            if (formField != null)
            {
                EntityMappingItem mappingItem = mapping.GetItem(formField.Name);
                if (mappingItem != null)
                {
                    EntityAttributeInfo entityAttribute = entityInfo.GetAttributeInfo(mappingItem.EntityAttributeName);
                    if (entityAttribute != null)
                    {
                        HtmlTableRow row = new HtmlTableRow();
                        mappingTable.Controls.Add(row);

                        HtmlTableCell formFieldCell = new HtmlTableCell();
                        formFieldCell.Controls.Add(new Literal { Text = ResHelper.LocalizeString(formField.GetDisplayName(MacroContext.CurrentResolver)) });

                        HtmlTableCell entityAttributeCell = new HtmlTableCell();
                        entityAttributeCell.Controls.Add(new Literal { Text = ResHelper.LocalizeString(entityAttribute.DisplayName) });

                        row.Controls.Add(formFieldCell);
                        row.Controls.Add(entityAttributeCell);
                    }
                }
            }
        }

        return mappingPanel;
    }
开发者ID:kbuck21991,项目名称:kentico-blank-project,代码行数:44,代码来源:ContactMapping.ascx.cs

示例2: CreateMappingPanel

    /// <summary>
    /// Creates and initializes a new instance of the Panel class with the specified Data.com contact mapping, and returns it.
    /// </summary>
    /// <param name="formInfo">The CMS contact form info.</param>
    /// <param name="entityInfo">The Data.com contact entity info.</param>
    /// <param name="mapping">The Data.com contact mapping.</param>
    /// <returns>A new instance of the Panel class initialized with the specified Data.com contact mapping.</returns>
    private Panel CreateMappingPanel(FormInfo formInfo, EntityInfo entityInfo, EntityMapping mapping)
    {
        Panel mappingPanel = new Panel { CssClass = "mapping"};
        mappingPanel.Controls.Add(CreateHeaderPanel());
        foreach (IField formItem in formInfo.ItemsList)
        {
            FormFieldInfo formField = formItem as FormFieldInfo;
            if (formField != null)
            {
                EntityMappingItem mappingItem = mapping.GetItem(formField.Name);
                if (mappingItem != null)
                {
                    EntityAttributeInfo entityAttribute = entityInfo.GetAttributeInfo(mappingItem.EntityAttributeName);
                    if (entityAttribute != null)
                    {
                        Panel row = new Panel { CssClass = "control-group-inline" };
                        mappingPanel.Controls.Add(row);

                        Panel formFieldPanel = new Panel { CssClass = "input-width-60 cms-form-group-text" };
                        row.Controls.Add(formFieldPanel);
                        formFieldPanel.Controls.Add(new Literal { Text = ResHelper.LocalizeString(formField.GetDisplayName(MacroContext.CurrentResolver)) });

                        Panel entityAttributePanel = new Panel { CssClass = "input-width-60 cms-form-group-text" };
                        row.Controls.Add(entityAttributePanel);
                        entityAttributePanel.Controls.Add(new Literal { Text = ResHelper.LocalizeString(entityAttribute.DisplayName) });
                    }
                }
            }
        }

        return mappingPanel;
    }
开发者ID:arvind-web-developer,项目名称:csharp-projects-Jemena-Kentico-CMS,代码行数:39,代码来源:ContactMapping.ascx.cs

示例3: CreateTable

    /// <summary>
    /// Creates and initializes a new instance of the HtmlTable class with the specified Data.com company mapping, and returns it.
    /// </summary>
    /// <param name="formInfo">The CMS account form info.</param>
    /// <param name="entityInfo">The Data.com company entity info.</param>
    /// <param name="mapping">The Data.com company mapping.</param>
    /// <returns>A new instance of the HtmlTable class initialized with the specified Data.com company mapping.</returns>
    private HtmlTable CreateTable(FormInfo formInfo, EntityInfo entityInfo, EntityMapping mapping)
    {
        HtmlTable table = new HtmlTable();
        table.Rows.Add(CreateHeaderRow());
        foreach (IFormItem formItem in formInfo.ItemsList)
        {
            FormFieldInfo formField = formItem as FormFieldInfo;
            if (formField != null)
            {
                EntityMappingItem mappingItem = mapping.GetItem(formField.Name);
                if (mappingItem != null)
                {
                    EntityAttributeInfo entityAttribute = entityInfo.GetAttributeInfo(mappingItem.EntityAttributeName);
                    if (entityAttribute != null)
                    {
                        HtmlTableRow row = new HtmlTableRow();
                        table.Rows.Add(row);
                        HtmlTableCell formFieldCell = new HtmlTableCell();
                        row.Cells.Add(formFieldCell);
                        formFieldCell.InnerText = ResHelper.LocalizeString(formField.Caption);
                        HtmlTableCell entityAttributeCell = new HtmlTableCell();
                        row.Cells.Add(entityAttributeCell);
                        entityAttributeCell.InnerText = ResHelper.LocalizeString(entityAttribute.DisplayName);

                        if (!Enabled)
                        {
                            formFieldCell.Style.Add("color", "#888888");
                            entityAttributeCell.Style.Add("color", "#888888");
                        }
                    }
                }
            }
        }

        return table;
    }
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:43,代码来源:CompanyMapping.ascx.cs


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