/// <summary>
 /// Adds the numeric textbox.
 /// </summary>
 /// <param name="id">The activity control identifier.</param>
 /// <param name="displayName">The display name of the control.</param>
 /// <param name="description">The description of the control.</param>
 /// <param name="required">if set to true, the control is required. Otherwise not required.</param>
 /// <param name="visible">if set to true, the control is visible. Otherwise not visible.</param>
 /// <returns>The <see cref="ActivityTextBoxNumeric"/> object.</returns>
 private ActivityTextBoxNumeric AddTextBoxNumeric(string id, string displayName, string description, bool required, bool visible)
 {
     ActivityTextBoxNumeric control = new ActivityTextBoxNumeric(id, displayName, description, required, visible);
     this.AddActivityControl(control);
     return control;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="GenerateUniqueValueForm"/> class.
        /// </summary>
        public GenerateUniqueValueForm()
        {
            Logger.Instance.WriteMethodEntry();

            try
            {
                // Add the standard controls to the form via the activity form controller
                this.activityDisplayName = this.controller.AddDisplayNameTextBox(ActivitySettings.ActivityDisplayName);
                this.activityExecutionCondition = this.controller.AddTextBox(ActivitySettings.ActivityExecutionCondition, ActivitySettings.ConditionHelpText, false, true);
                this.publicationTarget = this.controller.AddTextBox(ActivitySettings.TargetForGeneratedValue, ActivitySettings.TargetForGeneratedValueHelpText, true);
                this.conflictFilter = this.controller.AddTextBox(ActivitySettings.ConflictFilter, ActivitySettings.ConflictFilterHelpText, true);
                this.queryLdap = this.controller.AddCheckBox(ActivitySettings.QueryLdapForConflicts, ActivitySettings.QueryLdapForConflictsHelpText);

                // Create a new instance of the definitions controller to capture ldap query definitions
                // The visibility of the queries control will be governed by the Query LDAP checkbox
                this.ldapQueries = new DefinitionsController("LDAPQueries", 250, 330, 0)
                {
                    DisplayName = ActivitySettings.LdapQueries,
                    Description = ActivitySettings.LdapQueriesHelpText,
                    LeftHeader = ActivitySettings.LdapQueriesLeftHeader,
                    RightHeader = ActivitySettings.LdapQueriesRightHeader
                };
                this.ldapQueries.HeaderRow.Visible = false;
                this.ldapQueries.TableRow.Visible = false;
                this.controller.ActivityControlTable.Rows.Add(this.ldapQueries.HeaderRow);
                this.controller.ActivityControlTable.Rows.Add(this.ldapQueries.TableRow);
                this.uniquenessSeed = this.controller.AddTextBoxNumeric(ActivitySettings.UniquenessKeySeed, ActivitySettings.UniquenessKeySeedHelpText, true);
                this.uniquenessSeed.DisplayZeroValue = true;

                // Create a new definitions controller to allow for the specification
                // of value expressions
                this.valueExpressions = new DefinitionsController("ValueExpressions", 500, 0, 0)
                {
                    DisplayName = ActivitySettings.ValueExpressions,
                    Description = ActivitySettings.ValueExpressionsHelpText,
                    LeftHeader = ActivitySettings.ValueExpressionsLeftHeader
                };
                this.controller.ActivityControlTable.Rows.Add(this.valueExpressions.HeaderRow);
                this.controller.ActivityControlTable.Rows.Add(this.valueExpressions.TableRow);

                this.queryLdap.CheckBoxControl.CheckedChanged += this.QueryLdap_CheckedChanged;
                this.queryLdap.CheckBoxControl.AutoPostBack = true;
                this.conflictFilter.TextBoxControl.Width = 300;
                this.uniquenessSeed.Value = 2;
            }
            catch (Exception e)
            {
                Logger.Instance.ReportError(e);
                throw;
            }
            finally
            {
                Logger.Instance.WriteMethodExit();
            }
        }