本文整理汇总了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;
}
//.........这里部分代码省略.........
示例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;
}