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


C# FormFieldInfo.Clone方法代码示例

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


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

示例1: FillFormFieldInfoStructure

    /// <summary>
    /// Returns FormFieldInfo structure with form data.
    /// </summary>   
    /// <param name="ffiOriginal">Original field info</param>
    private FormFieldInfo FillFormFieldInfoStructure(FormFieldInfo ffiOriginal)
    {
        string selectedType = string.Empty;
        DataRow settingsData = null;
        FormFieldInfo formFieldInfo;

        if (ffiOriginal != null)
        {
            // Field info with original information
            formFieldInfo = (FormFieldInfo)ffiOriginal.Clone();

            if (chkDisplayInForm.Checked)
            {
                // Reset control settings (hidden field's settings are preserved)
                formFieldInfo.Settings.Clear();
                formFieldInfo.SettingsMacroTable.Clear();
            }
        }
        else
        {
            formFieldInfo = new FormFieldInfo();
        }

        formFieldInfo.IsDummyField = IsDummyField;
        formFieldInfo.IsDummyFieldFromMainForm = IsDummyFieldFromMainForm;
        formFieldInfo.IsExtraField = IsExtraField;

        // Load FormFieldInfo with data from database configuration section
        databaseConfiguration.FieldInfo = formFieldInfo;
        databaseConfiguration.Save();

        // Do not save aditional field settings if field is hidden
        if (chkDisplayInForm.Checked)
        {
            // Field appearance section
            fieldAppearance.FieldInfo = formFieldInfo;
            fieldAppearance.Save();
            selectedType = fieldAppearance.FieldType;

            // Validation section
            validationSettings.FieldInfo = formFieldInfo;
            validationSettings.Save();

            // Design section
            cssSettings.FieldInfo = formFieldInfo;
            cssSettings.Save();

            // HtmlEnvelope section
            htmlEnvelope.FieldInfo = formFieldInfo;
            htmlEnvelope.Save();

            // Field advanced section
            formFieldInfo.SetPropertyValue(FormFieldPropertyEnum.VisibleMacro, fieldAdvancedSettings.VisibleMacro, true);
            formFieldInfo.SetPropertyValue(FormFieldPropertyEnum.EnabledMacro, fieldAdvancedSettings.EnabledMacro, true);
            formFieldInfo.DisplayInSimpleMode = fieldAdvancedSettings.DisplayInSimpleMode;
            formFieldInfo.HasDependingFields = fieldAdvancedSettings.HasDependingFields;
            formFieldInfo.DependsOnAnotherField = fieldAdvancedSettings.DependsOnAnotherField;

            // Get control settings data
            settingsData = controlSettings.FormData;

            // Store macro table
            formFieldInfo.SettingsMacroTable = controlSettings.MacroTable;
        }

        // Determine if it is external column
        formFieldInfo.External |= IsSystemFieldSelected;

        if (((Mode == FieldEditorModeEnum.BizFormDefinition) || (Mode == FieldEditorModeEnum.SystemTable) ||
            (Mode == FieldEditorModeEnum.AlternativeBizFormDefinition) || (Mode == FieldEditorModeEnum.AlternativeSystemTable))
            && (databaseConfiguration.AttributeType == FieldDataType.File))
        {
            // Allow to save <guid>.<extension>
            formFieldInfo.DataType = FieldDataType.Text;
            formFieldInfo.Size = 500;
        }
        else if (databaseConfiguration.AttributeType == FieldDataType.DocAttachments)
        {
            formFieldInfo.DataType = FieldDataType.DocAttachments;
            formFieldInfo.Size = 200;
        }
        else
        {
            formFieldInfo.DataType = databaseConfiguration.AttributeType;
            formFieldInfo.Size = ValidationHelper.GetInteger(databaseConfiguration.AttributeSize, 0);
            formFieldInfo.Precision = ValidationHelper.GetInteger(databaseConfiguration.AttributePrecision, -1);
        }

        formFieldInfo.Visible = chkDisplayInForm.Checked;

        formFieldInfo.DisplayIn = String.Empty;
        if (chkDisplayInDashBoard.Checked)
        {
            formFieldInfo.DisplayIn = DisplayIn;
        }

//.........这里部分代码省略.........
开发者ID:dlnuckolls,项目名称:pfh-paypalintegration,代码行数:101,代码来源:FieldEditor.ascx.cs

示例2: FillFormFieldInfoStructure

    /// <summary>
    /// Returns FormFieldInfo structure with form data.
    /// </summary>   
    /// <param name="ffiOriginal">Original field info</param>
    private FormFieldInfo FillFormFieldInfoStructure(FormFieldInfo ffiOriginal)
    {
        FormFieldInfo formFieldInfo;

        if (ffiOriginal != null)
        {
            // Field info with original information
            formFieldInfo = (FormFieldInfo)ffiOriginal.Clone();

            if (chkDisplayInForm.Checked)
            {
                // Reset control settings (hidden field's settings are preserved)
                formFieldInfo.Settings.Clear();
                formFieldInfo.SettingsMacroTable.Clear();
            }
        }
        else
        {
            formFieldInfo = new FormFieldInfo();
        }

        // Set data type first to ensure proper further processing
        SetFieldDataType(formFieldInfo);

        formFieldInfo.IsDummyField = IsDummyField;
        formFieldInfo.IsDummyFieldFromMainForm = IsDummyFieldFromMainForm;
        formFieldInfo.IsExtraField = IsExtraField;

        // Load FormFieldInfo with data from database configuration section
        databaseConfiguration.FieldInfo = formFieldInfo;
        databaseConfiguration.Save();

        SetFieldAppearance(formFieldInfo);

        // Determine if it is external column
        formFieldInfo.External |= IsSystemFieldSelected;

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


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