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


C# FormInfo.RemoveFields方法代码示例

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


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

示例1: CopyCustomFields

    /// <summary>
    /// Copies custom fields from old version of form definition to the new form definition.
    /// </summary>
    /// <param name="oldVersionFi">Old version form definition</param>
    /// <param name="newVersionFi">New version form definition</param>
    /// <param name="overwrite">Indicates whether existing fields should be overwritten. Alternative form fields need to be overwritten due to the combination with upgraded class form.</param>
    private static void CopyCustomFields(FormInfo oldVersionFi, FormInfo newVersionFi, bool overwrite)
    {
        // Remove all system fields from old definition to get only custom fields
        oldVersionFi.RemoveFields(f => f.System);

        // Combine forms so that custom fields from old definition are appended to the new definition
        newVersionFi.CombineWithForm(oldVersionFi, new CombineWithFormSettings
        {
            IncludeCategories = false,
            RemoveEmptyCategories = true,
            OverwriteExisting = overwrite
        });
    }
开发者ID:arvind-web-developer,项目名称:csharp-projects-Jemena-Kentico-CMS,代码行数:19,代码来源:UpgradeProcedure.cs

示例2: CopyCustomFields

    /// <summary>
    /// Copies custom fields from old version of form definition to the new form definition.
    /// </summary>
    /// <param name="oldVersionFi">Old version form definition</param>
    /// <param name="newVersionFi">New version form definition</param>
    /// <param name="overwrite">Indicates whether existing fields should be overwritten. Alternative form fields need to be overwritten due to the combination with upgraded class form.</param>
    /// <param name="isSystemTable">Indicates whether the class is customizable.</param>
    private static void CopyCustomFields(FormInfo oldVersionFi, FormInfo newVersionFi, bool overwrite, bool isSystemTable)
    {
        // Remove all system fields from old definition to get only custom fields
        // Remove all dummy fields from old definition for non-customizable classes (Since v9 is condition f => f.System sufficient because dummy fields created in development mode are system)
        // * Dummy field in alternative forms are not marked as system in version < v9 and should be updated. Without this condition the old version of dummy field was used instead of new one.
        // * Dummy field is not removed from customizable classes due to possible customization.
        oldVersionFi.RemoveFields(f => f.System || (f.IsDummyField && !isSystemTable));

        // Combine forms so that custom fields from old definition are appended to the new definition
        newVersionFi.CombineWithForm(oldVersionFi, new CombineWithFormSettings
        {
            IncludeCategories = false,
            RemoveEmptyCategories = true,
            OverwriteExisting = overwrite
        });
    }
开发者ID:kbuck21991,项目名称:kentico-blank-project,代码行数:23,代码来源:UpgradeProcedure.cs


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