GetBooleanSetting() public static method

Gets the given setting as a bool, or defaultValue if the setting hasn't been set.
or are null
public static GetBooleanSetting ( IDictionary settings, string settingName, bool defaultValue ) : bool
settings IDictionary The settings collection.
settingName string Name of the setting.
defaultValue bool The default value.
return bool
        /// <summary>LoadSettings loads the settings from the Database and displays them</summary>
        public override void LoadSettings()
        {
            try
            {
                if (this.IsPostBack)
                {
                    return;
                }

                this.SiteUrlTextBox.Text              = Utility.GetStringSetting(this.Settings, "SiteUrl", string.Empty);
                this.ShowMessageCheckBox.Checked      = Utility.GetBooleanSetting(this.Settings, "ShowMessage", true);
                this.ShowModalCheckBox.Checked        = Utility.GetBooleanSetting(this.Settings, "ShowModal", false);
                this.CarbonCopyTextBox.Text           = Utility.GetStringSetting(this.Settings, "CarbonCopy", string.Empty);
                this.BlindCarbonCopyTextBox.Text      = Utility.GetStringSetting(this.Settings, "BlindCarbonCopy", string.Empty);
                this.FromTextBox.Text                 = Utility.GetStringSetting(this.Settings, "From", string.Empty);
                this.SubjectTextBox.Text              = Utility.GetStringSetting(this.Settings, "Subject", string.Empty);
                this.BodyTextBox.Text                 = Utility.GetStringSetting(this.Settings, "Body", string.Empty);
                this.InvisibleCaptchaCheckBox.Checked = Utility.GetBooleanSetting(this.Settings, "InvisibleCaptcha", true);
                this.TimedCaptchaCheckBox.Checked     = Utility.GetBooleanSetting(this.Settings, "TimedCaptcha", true);
                this.StandardCaptchaCheckBox.Checked  = Utility.GetBooleanSetting(this.Settings, "StandardCaptcha", false);

                this.SetEmailValidation();
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Ejemplo n.º 2
0
 /// <summary>Loads the settings.</summary>
 private void LoadSettings()
 {
     this.ShowInModal         = Utility.GetBooleanSetting(this.Settings, "ShowModal", this.ShowInModal);
     this.Url                 = Utility.GetStringSetting(this.Settings, "SiteUrl", this.Url);
     this.ShowMessage         = Utility.GetBooleanSetting(this.Settings, "ShowMessage", this.ShowMessage);
     this.UseInvisibleCaptcha = Utility.GetBooleanSetting(this.Settings, "InvisibleCaptcha", this.UseInvisibleCaptcha);
     this.UseTimedCaptcha     = Utility.GetBooleanSetting(this.Settings, "TimedCaptcha", this.UseTimedCaptcha);
     this.UseStandardCaptcha  = Utility.GetBooleanSetting(this.Settings, "StandardCaptcha", this.UseStandardCaptcha);
 }