<commit_before>/* Yet Another Forum.NET
 * Copyright (C) 2006-2011 <NAME>
 * http://www.yetanotherforum.net/
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
namespace YAF.Classes
{
    using System;
    using System.Web.Security;

    using YAF.Classes.Pattern;
    using YAF.Types;
    using YAF.Types.Constants;

  /// <summary>
    /// The yaf board settings.
    /// </summary>
    public class YafBoardSettings
    {
        /// <summary>
        /// The _reg.
        /// </summary>
        protected readonly RegistryDictionaryOverride _reg;

        /// <summary>
        /// The _reg board.
        /// </summary>
        protected readonly RegistryDictionary _regBoard;

        /// <summary>
        /// The _board id.
        /// </summary>
        protected object _boardID;

        /// <summary>
        /// The _legacy board settings.
        /// </summary>
        protected YafLegacyBoardSettings _legacyBoardSettings = new YafLegacyBoardSettings();

        /// <summary>
        /// The _membership app name.
        /// </summary>
        protected string _membershipAppName;

        /// <summary>
        /// The _roles app name.
        /// </summary>
        protected string _rolesAppName;

        /// <summary>
        /// Initializes a new instance of the <see cref="YafBoardSettings"/> class.
        /// </summary>
        public YafBoardSettings()
        {
            this._boardID = 0;
            this._reg = new RegistryDictionaryOverride();
            this._regBoard = new RegistryDictionary();

            // set the board dictionary as the override...
            this._reg.OverrideDictionary = this._regBoard;

            this._membershipAppName = Membership.ApplicationName;
            this._rolesAppName = Roles.ApplicationName;
        }

        // Board/Override properties...
        // Future stuff... still in progress.
        /// <summary>
        /// Gets or sets a value indicating whether SetBoardRegistryOnly.
        /// </summary>
        public bool SetBoardRegistryOnly
        {
            get
            {
                return this._reg.DefaultSetOverride;
            }

            set
            {
                this._reg.DefaultSetOverride = value;
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether GetBoardRegistryOverride.
        /// </summary>
        public bool GetBoardRegistryOverride
        {
            get
            {
                return this._reg.DefaultGetOverride;
            }

            set
            {
                this._reg.DefaultGetOverride = value;
            }
        }

        // Provider Settings

        /// <summary>
        /// Gets MembershipAppName.
        /// </summary>
        public string MembershipAppName
        {
            get
            {
                return this._membershipAppName;
            }
        }

        /// <summary>
        /// Gets RolesAppName.
        /// </summary>
        public string RolesAppName
        {
            get
            {
                return this._rolesAppName;
            }
        }

        // individual board settings
        /// <summary>
        /// Gets Name.
        /// </summary>
        public string Name
        {
            get
            {
                return this._legacyBoardSettings.BoardName;
            }
        }

        /// <summary>
        /// Gets a value indicating whether AllowThreaded.
        /// </summary>
        public bool AllowThreaded
        {
            get
            {
                return this._legacyBoardSettings.AllowThreaded;
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether AllowThemedLogo.
        /// </summary>
        public bool AllowThemedLogo
        {
            get
            {
                return this._reg.GetValue<bool>("AllowThemedLogo", false);
            }

            set
            {
                this._reg.SetValue<bool>("AllowThemedLogo", value);
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether User genger icons in user box are enabled.
        /// </summary>
        public bool AllowGenderInUserBox
        {
            get
            {
                return this._reg.GetValue<bool>("AllowGenderInUserBox", true);
            }

            set
            {
                this._reg.SetValue<bool>("AllowGenderInUserBox", value);
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether to enable Display Name.
        /// </summary>
        public bool EnableDisplayName
        {
            get
            {
                return this._reg.GetValue<bool>("EnableDisplayName", false);
            }

            set
            {
                this._reg.SetValue<bool>("EnableDisplayName", value);
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether to enable JqueryUIThemeCDNHosted.
        /// </summary>
        public bool JqueryUIThemeCDNHosted
        {
            get
            {
                return this._reg.GetValue<bool>("JqueryUIThemeCDNHosted", true);
            }

            set
            {
                this._reg.SetValue<bool>("JqueryUIThemeCDNHosted", value);
            }
        }

        /// <summary>
        /// Gets MaxUsers.
        /// </summary>
        public int MaxUsers
        {
            get
            {
                return this._regBoard.GetValue<int>("MaxUsers", 1);
            }
        }

        /// <summary>
        /// Gets MaxUsersWhen.
        /// </summary>
        public DateTime MaxUsersWhen
        {
            get
            {
                return this._regBoard.GetValue<DateTime>("MaxUsersWhen", DateTime.UtcNow);
            }
        }

        /// <summary>
        /// Gets or sets Theme.
        /// </summary>
        public string MobileTheme
        {
            get
            {
                return this._regBoard.GetValue<string>("MobileTheme", string.Empty);
            }

            set
            {
                this._regBoard.SetValue<string>("MobileTheme", value);
            }
        }

        /// <summary>
        /// Gets or sets Jquery UI Theme.
        /// </summary>
        public string JqueryUITheme
        {
            get
            {
                return this._regBoard.GetValue<string>("JqueryUITheme", "smoothness");
            }

            set
            {
                this._regBoard.SetValue<string>("JqueryUITheme", value);
            }
        }

        /// <summary>
        /// Gets or sets Theme.
        /// </summary>
        public string Theme
        {
            get
            {
                return this._regBoard.GetValue<string>("Theme", "cleanSlate.xml");
            }

            set
            {
                this._regBoard.SetValue<string>("Theme", value);
            }
        }

        /// <summary>
        /// Gets or sets Language.
        /// </summary>
        public string Language
        {
            get
            {
                return this._regBoard.GetValue<string>("Language", "english.xml");
            }

            set
            {
                this._regBoard.SetValue<string>("Language", value);
            }
        }

        /// <summary>
        /// Gets or sets Culture.
        /// </summary>
        public string Culture
        {
            get
            {
                return this._regBoard.GetValue<string>("Culture", "en-US");
            }

            set
            {
                this._regBoard.SetValue<string>("Culture", value);
            }
        }

        public UserNotificationSetting DefaultNotificationSetting
        {
            get
            {
                return this._regBoard.GetValue<UserNotificationSetting>("DefaultNotificationSetting", UserNotificationSetting.TopicsIPostToOrSubscribeTo);
            }

            set
            {
                this._regBoard.SetValue<UserNotificationSetting>("DefaultNotificationSetting", value);
            }
        }

        public bool DefaultSendDigestEmail
        {
            get
            {
                return this._regBoard.GetValue<bool>("DefaultSendDigestEmail", false);
            }

            set
            {
                this._regBoard.SetValue<bool>("DefaultSendDigestEmail", value);
            }
        }

        public bool AllowDigestEmail
        {
            get
            {
                return this._regBoard.GetValue<bool>("AllowDigestEmail", false);
            }

            set
            {
                this._regBoard.SetValue<bool>("AllowDigestEmail", value);
            }
        }

        /// <summary>
        /// Gets or sets ShowTopicsDefault.
        /// </summary>
        public int ShowTopicsDefault
        {
            get
            {
                return this._regBoard.GetValue<int>("ShowTopicsDefault", 0);
            }

            set
            {
                this._regBoard.SetValue<int>("ShowTopicsDefault", value);
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether FileExtensionAreAllowed.
        /// </summary>
        public bool FileExtensionAreAllowed
        {
            get
            {
                return this._regBoard.GetValue<bool>("FileExtensionAreAllowed", true);
            }

            set
            {
                this._regBoard.SetValue<bool>("FileExtensionAreAllowed", value);
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether Recapture can have Multiple Instances.
        /// </summary>
        public bool RecaptureMultipleInstances
        {
            get
            {
                return this._regBoard.GetValue<bool>("RecaptureMultipleInstances", true);
            }

            set
            {
                this._regBoard.SetValue<bool>("RecaptureMultipleInstances", value);
            }
        }

        /// <summary>
        /// Gets or sets NotificationOnUserRegisterEmailList.
        /// </summary>
        public string NotificationOnUserRegisterEmailList
        {
            get
            {
                return this._regBoard.GetValue<string>("NotificationOnUserRegisterEmailList", null);
            }

            set
            {
                this._regBoard.SetValue<string>("NotificationOnUserRegisterEmailList", value);
            }
        }

        public bool EmailModeratorsOnModeratedPost
        {
            get
            {
                return this._regBoard.GetValue<bool>("EmailModeratorsOnModeratedPost", true);
            }

            set
            {
                this._regBoard.SetValue<bool>("EmailModeratorsOnModeratedPost", value);
            }
        }

        // didn't know where else to put this :)
        /// <summary>
        /// Gets SQLVersion.
        /// </summary>
        public string SQLVersion
        {
            get
            {
                return this._legacyBoardSettings.SqlVersion;
            }
        }

        #region int settings<commit_msg>Added copyright removal system to the footer with hashed domain key. (pretty simple)<commit_after>/* Yet Another Forum.NET
 * Copyright (C) 2006-2011 <NAME>
 * http://www.yetanotherforum.net/
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
namespace YAF.Classes
{
    using System;
    using System.Web.Security;

    using YAF.Classes.Pattern;
    using YAF.Types;
    using YAF.Types.Constants;

  /// <summary>
    /// The yaf board settings.
    /// </summary>
    public class YafBoardSettings
    {
        /// <summary>
        /// The _reg.
        /// </summary>
        protected readonly RegistryDictionaryOverride _reg;

        /// <summary>
        /// The _reg board.
        /// </summary>
        protected readonly RegistryDictionary _regBoard;

        /// <summary>
        /// The _board id.
        /// </summary>
        protected object _boardID;

        /// <summary>
        /// The _legacy board settings.
        /// </summary>
        protected YafLegacyBoardSettings _legacyBoardSettings = new YafLegacyBoardSettings();

        /// <summary>
        /// The _membership app name.
        /// </summary>
        protected string _membershipAppName;

        /// <summary>
        /// The _roles app name.
        /// </summary>
        protected string _rolesAppName;

        /// <summary>
        /// Initializes a new instance of the <see cref="YafBoardSettings"/> class.
        /// </summary>
        public YafBoardSettings()
        {
            this._boardID = 0;
            this._reg = new RegistryDictionaryOverride();
            this._regBoard = new RegistryDictionary();

            // set the board dictionary as the override...
            this._reg.OverrideDictionary = this._regBoard;

            this._membershipAppName = Membership.ApplicationName;
            this._rolesAppName = Roles.ApplicationName;
        }

        // Board/Override properties...
        // Future stuff... still in progress.
        /// <summary>
        /// Gets or sets a value indicating whether SetBoardRegistryOnly.
        /// </summary>
        public bool SetBoardRegistryOnly
        {
            get
            {
                return this._reg.DefaultSetOverride;
            }

            set
            {
                this._reg.DefaultSetOverride = value;
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether GetBoardRegistryOverride.
        /// </summary>
        public bool GetBoardRegistryOverride
        {
            get
            {
                return this._reg.DefaultGetOverride;
            }

            set
            {
                this._reg.DefaultGetOverride = value;
            }
        }

        // Provider Settings

        /// <summary>
        /// Gets MembershipAppName.
        /// </summary>
        public string MembershipAppName
        {
            get
            {
                return this._membershipAppName;
            }
        }

        /// <summary>
        /// Gets RolesAppName.
        /// </summary>
        public string RolesAppName
        {
            get
            {
                return this._rolesAppName;
            }
        }

        // individual board settings
        /// <summary>
        /// Gets Name.
        /// </summary>
        public string Name
        {
            get
            {
                return this._legacyBoardSettings.BoardName;
            }
        }

        /// <summary>
        /// Gets a value indicating whether AllowThreaded.
        /// </summary>
        public bool AllowThreaded
        {
            get
            {
                return this._legacyBoardSettings.AllowThreaded;
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether AllowThemedLogo.
        /// </summary>
        public bool AllowThemedLogo
        {
            get
            {
                return this._reg.GetValue<bool>("AllowThemedLogo", false);
            }

            set
            {
                this._reg.SetValue<bool>("AllowThemedLogo", value);
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether User genger icons in user box are enabled.
        /// </summary>
        public bool AllowGenderInUserBox
        {
            get
            {
                return this._reg.GetValue<bool>("AllowGenderInUserBox", true);
            }

            set
            {
                this._reg.SetValue<bool>("AllowGenderInUserBox", value);
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether to enable Display Name.
        /// </summary>
        public bool EnableDisplayName
        {
            get
            {
                return this._reg.GetValue<bool>("EnableDisplayName", false);
            }

            set
            {
                this._reg.SetValue<bool>("EnableDisplayName", value);
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether to enable JqueryUIThemeCDNHosted.
        /// </summary>
        public bool JqueryUIThemeCDNHosted
        {
            get
            {
                return this._reg.GetValue<bool>("JqueryUIThemeCDNHosted", true);
            }

            set
            {
                this._reg.SetValue<bool>("JqueryUIThemeCDNHosted", value);
            }
        }

        /// <summary>
        /// Gets MaxUsers.
        /// </summary>
        public int MaxUsers
        {
            get
            {
                return this._regBoard.GetValue<int>("MaxUsers", 1);
            }
        }

        /// <summary>
        /// Gets MaxUsersWhen.
        /// </summary>
        public DateTime MaxUsersWhen
        {
            get
            {
                return this._regBoard.GetValue<DateTime>("MaxUsersWhen", DateTime.UtcNow);
            }
        }

        /// <summary>
        /// Gets or sets Theme.
        /// </summary>
        public string MobileTheme
        {
            get
            {
                return this._regBoard.GetValue<string>("MobileTheme", string.Empty);
            }

            set
            {
                this._regBoard.SetValue<string>("MobileTheme", value);
            }
        }

        /// <summary>
        /// Gets or sets Jquery UI Theme.
        /// </summary>
        public string JqueryUITheme
        {
            get
            {
                return this._regBoard.GetValue<string>("JqueryUITheme", "smoothness");
            }

            set
            {
                this._regBoard.SetValue<string>("JqueryUITheme", value);
            }
        }

        /// <summary>
        /// Gets or sets Theme.
        /// </summary>
        public string Theme
        {
            get
            {
                return this._regBoard.GetValue<string>("Theme", "cleanSlate.xml");
            }

            set
            {
                this._regBoard.SetValue<string>("Theme", value);
            }
        }

        /// <summary>
        /// Gets or sets Language.
        /// </summary>
        public string Language
        {
            get
            {
                return this._regBoard.GetValue<string>("Language", "english.xml");
            }

            set
            {
                this._regBoard.SetValue<string>("Language", value);
            }
        }

        /// <summary>
        /// Gets or sets Culture.
        /// </summary>
        public string Culture
        {
            get
            {
                return this._regBoard.GetValue<string>("Culture", "en-US");
            }

            set
            {
                this._regBoard.SetValue<string>("Culture", value);
            }
        }

        public UserNotificationSetting DefaultNotificationSetting
        {
            get
            {
                return this._regBoard.GetValue<UserNotificationSetting>("DefaultNotificationSetting", UserNotificationSetting.TopicsIPostToOrSubscribeTo);
            }

            set
            {
                this._regBoard.SetValue<UserNotificationSetting>("DefaultNotificationSetting", value);
            }
        }

        public bool DefaultSendDigestEmail
        {
            get
            {
                return this._regBoard.GetValue<bool>("DefaultSendDigestEmail", false);
            }

            set
            {
                this._regBoard.SetValue<bool>("DefaultSendDigestEmail", value);
            }
        }

        public bool AllowDigestEmail
        {
            get
            {
                return this._regBoard.GetValue<bool>("AllowDigestEmail", false);
            }

            set
            {
                this._regBoard.SetValue<bool>("AllowDigestEmail", value);
            }
        }

        /// <summary>
        /// Gets or sets ShowTopicsDefault.
        /// </summary>
        public int ShowTopicsDefault
        {
            get
            {
                return this._regBoard.GetValue<int>("ShowTopicsDefault", 0);
            }

            set
            {
                this._regBoard.SetValue<int>("ShowTopicsDefault", value);
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether FileExtensionAreAllowed.
        /// </summary>
        public bool FileExtensionAreAllowed
        {
            get
            {
                return this._regBoard.GetValue<bool>("FileExtensionAreAllowed", true);
            }

            set
            {
                this._regBoard.SetValue<bool>("FileExtensionAreAllowed", value);
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether Recapture can have Multiple Instances.
        /// </summary>
        public bool RecaptureMultipleInstances
        {
            get
            {
                return this._regBoard.GetValue<bool>("RecaptureMultipleInstances", true);
            }

            set
            {
                this._regBoard.SetValue<bool>("RecaptureMultipleInstances", value);
            }
        }

        /// <summary>
        /// Gets or sets NotificationOnUserRegisterEmailList.
        /// </summary>
        public string NotificationOnUserRegisterEmailList
        {
            get
            {
                return this._regBoard.GetValue<string>("NotificationOnUserRegisterEmailList", null);
            }

            set
            {
                this._regBoard.SetValue<string>("NotificationOnUserRegisterEmailList", value);
            }
        }

        public string CopyrightRemovalDomainKey
        {
          get
          {
            return this._regBoard.GetValue<string>("CopyrightRemovalDomainKey", null);
          }

          set
          {
            this._regBoard.SetValue<string>("CopyrightRemovalDomainKey", value);
          }
        }

        public bool EmailModeratorsOnModeratedPost
        {
            get
            {
                return this._regBoard.GetValue<bool>("EmailModeratorsOnModeratedPost", true);
            }

            set
            {
                this._regBoard.SetValue<bool>("EmailModeratorsOnModeratedPost", value);
            }
        }

        // didn't know where else to put this :)
        /// <summary>
        /// Gets SQLVersion.
        /// </summary>
        public string SQLVersion
        {
            get
            {
                return this._legacyBoardSettings.SqlVersion;
            }
        }

        #region int settings
{'fraction_non_alphanumeric': 0.09538206668047215, 'fraction_numerical': 0.002153655001035411, 'mean_word_length': 1.210362504577078, 'pattern_counts': {'":': 0, '<': 201, '<?xml version=': 0, '>': 201, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2765949', 'n_tokens_mistral': 5965, 'n_tokens_neox': 5755, 'n_words': 1335}