예제 #1
0
 public void Remove(HKHConnectionStringElement element)
 {
     if (base.BaseIndexOf(element) >= 0)
     {
         base.BaseRemove(element.Key);
     }
 }
예제 #2
0
        static DataBaseConfigurationManager()
        {
            _connectionStrings = (HKHConnectionStringsSection)ConfigurationManager.GetSection(HKHConnectionStringsSection.TagName);

            if (_connectionStrings.ConnectionStrings.Count > 0)
            {
                foreach (HKHConnectionStringElement config in _connectionStrings.ConnectionStrings)
                {
                    if (config.IsDefault)
                    {
                        _defaultConnectionString = config;
                        break;
                    }
                }

                //set the first one is default if no any config is marked as defaut explicitly.
                if (_defaultConnectionString == null)
                {
                    _defaultConnectionString = _connectionStrings.ConnectionStrings[0];
                    //_defaultConnectionString.IsDefault = true;
                }
            }
            else
            {
                throw new HKH.Data.DataBaseConfigurationException("No availiable connectionstring!");
            }
        }
예제 #3
0
 public void BaseAdd(int index, HKHConnectionStringElement element)
 {
     if (index == -1)
     {
         base.BaseAdd(element, false);
     }
     else
     {
         base.BaseAdd(index, element);
     }
 }
예제 #4
0
 public int IndexOf(HKHConnectionStringElement element)
 {
     return(base.BaseIndexOf(element));
 }
예제 #5
0
 public void Add(HKHConnectionStringElement element)
 {
     this.BaseAdd(element);
 }