Пример #1
0
        /// <exception cref="ConfigurationErrorsException">Could not find connectionString Attribute for SQLiteNicknameResolver in NicknameResolver-Config Xml-Node.</exception>
        /// <exception cref="ConfigurationErrorsException">connectionString Attribute for SQLiteNicknameResolver in NicknameResolver-Config Xml-Node is empty.</exception>
        public override void ReadConfigSettings(XElement configElement)
        {
            XAttribute connectionStringAttribute = configElement.Attribute("connectionString");

            if (connectionStringAttribute == null)
            {
                throw new ConfigurationErrorsException("Could not find connectionString Attribute for SQLiteNicknameResolver in NicknameResolver-Config Xml-Node.", (Exception)null);
            }

            if (connectionStringAttribute.Value.IsNullOrTimmedEmpty())
            {
                throw new ConfigurationErrorsException("connectionString Attribute for SQLiteNicknameResolver in NicknameResolver-Config Xml-Node is empty.", (Exception)null);
            }

            try
            {
                new SQLiteConnectionStringBuilder(connectionStringAttribute.Value.Trim());
            }
            catch (Exception ex)
            {
                throw new ConfigurationErrorsException("connectionString Attribute for SQLiteNicknameResolver in NicknameResolver-Config Xml-Node has a wrong format.", ex);
            }

            ConnectionManager = new ConnectionManager(connectionStringAttribute.Value.Trim(), false);
            PlayerAdapter     = new PlayerAdapter(ConnectionManager);
        }
Пример #2
0
        public IPlayerAdapter GetPlayerAdapter(IBaseAdapter adapterToCopyContextFrom)
        {
            IPlayerAdapter adapter = new PlayerAdapter();

            adapter.SetContextFrom(adapterToCopyContextFrom);

            return(adapter);
        }