private void GetSettingsInfo()
        {
            bool bTestExchangeConnection=false;
            try
            {
                LogManager.WriteLog("Getting Exchange Connection String" , LogManager.enumLogLevel.Debug);

                if (ValidateText(txtexchangeServer, "Server"))
                {
                    if (ValidateText(txtexchangeUsername, "UserName"))
                    {
                        if (ValidateText(txtexchangePassword, "Password"))
                        {
                            if (ValidateText(txtexchangeTimeOut, "Connection Timeout"))
                            {
                                bTestExchangeConnection = TestConnection(txtexchangeServer.Text, txtexchangeUsername.Text, txtexchangePassword.Text, txtexchangeTimeOut.Text, txtexchangeInstance.Text, 'E');
                            }
                        }
                    }
                }
                  if (bTestExchangeConnection == true)
                  {
                      if (!string.IsNullOrEmpty(ReturnConnectionString))
                          DataBaseServiceHandler.ConnectionString = ReturnConnectionString;
                  }
                //DataBaseServiceHandler.ConnectionString = RegistrySettings.ExchangeConnectionString();

                LogManager.WriteLog("Exchange Connection String" + DataBaseServiceHandler.ConnectionString.Length.ToString(),LogManager.enumLogLevel.Debug);
                SettingsTable = new DataTable();
                DataBaseServiceHandler.Fill(QueryType.Text, "Select [ID] = Setting_ID , [Name] = Setting_Name, [Value] = Isnull(Setting_Value,'') From Setting", SettingsTable);
                PropertyBag pbSetting = new PropertyBag();

                if (SettingsTable != null && SettingsTable.Rows.Count > 0)
                {
                    LogManager.WriteLog("Setting Table Rows Count   " + SettingsTable.Rows.Count.ToString(),LogManager.enumLogLevel.Debug);
                }
                else
                {
                    LogManager.WriteLog("Could not populate Settings Table", LogManager.enumLogLevel.Debug);
                }

                pbSetting.GetValue += new PropertySpecEventHandler(pbSetting_GetValue);
                pbSetting.SetValue += new PropertySpecEventHandler(pbSetting_SetValue);

                foreach (DataRow dr in SettingsTable.Rows)
                {
                    if (BMC.Common.Utilities.Common.GetRowValue<string>(dr, "Value").ToUpper() == "TRUE" || BMC.Common.Utilities.Common.GetRowValue<string>(dr, "Value").ToUpper() == "FALSE")
                        if (BMC.Common.Utilities.Common.GetRowValue<string>(dr, "Value").ToUpper() == "TRUE")
                            pbSetting.Properties.Add(new PropertySpec(BMC.Common.Utilities.Common.GetRowValue<string>(dr, "Name"), typeof(bool), "BMC Category", null, true));
                        else
                            pbSetting.Properties.Add(new PropertySpec(BMC.Common.Utilities.Common.GetRowValue<string>(dr, "Name"), typeof(bool), "BMC Category", null, false));
                    else
                        pbSetting.Properties.Add(new PropertySpec(BMC.Common.Utilities.Common.GetRowValue<string>(dr, "Name"), typeof(string), "BMC Category", null, BMC.Common.Utilities.Common.GetRowValue<string>(dr, "Value")));

                }
                if (pbSetting != null && pbSetting.Properties.Count > 0)
                {
                    LogManager.WriteLog("PBSetting Properties Count    " + pbSetting.Properties.Count.ToString(), LogManager.enumLogLevel.Debug);
                }
                //propertyGridBag1.PropertyGridContorl.SelectedObject = pbSetting;
            }
            catch (Exception ex)
            {
                LogManager.WriteLog("GetSettingsInfo" + ex.Message.ToString() + ex.Source.ToString(), LogManager.enumLogLevel.Error);
                ExceptionManager.Publish(ex);
            }
        }
 public PropertySpecDescriptor(PropertySpec item, PropertyBag bag, string name, Attribute[] attrs)
     :
     base(name, attrs)
 {
     this.bag = bag;
     this.item = item;
 }