public static bool ChangeConfig(ConfigEntries LoadedConfig, ConfigEntries ConfigToLoad)
        {
            try
            {
                string SourceFile = ConfigToLoad.Path + "\\" + LoadedConfig.FileName;
                string SourceCopyFile = ConfigToLoad.Path + "\\" + LoadedConfig.Name + ".config";
                string TargetFile = LoadedConfig.Path + "\\" + ConfigToLoad.FileName;

                if (copyFileContents(SourceFile, SourceCopyFile))
                    if (copyFileContents(TargetFile, SourceFile))
                    {
                        //LoadedConfig.Name = ConfigToLoad.Name;
                        return true;
                    }
                    else
                        return false;

                else
                    return false;

                //File.Copy(LoadedConfig.FullName, LoadedConfig.Path + "\\" + LoadedConfig.Name + ".config", true);

                //File.Copy(ConfigToLoad.FullName, ConfigToLoad.Path + "\\" + "Config" + ".config", true);
                // NotifyBase pNot = new NotifyBase();
                // invokeEvent();

                //return true;
            }
            catch (Exception ex)
            {
                MessageBox.Show("ChangeConfig:  " + ex.Message);
                return false;

            }
            finally
            {
                //LoadedConfig = null;
                //ConfigToLoad = null;
            }
        }
        public static List<ConfigEntries> GetAllConfigFilesNames(bool includeLoaded)
        {
            List<string> pConfFiles = null;
            List<ConfigEntries> pConfFileNames = null;
            XmlDocument oXml = null;
            XmlNodeList oList = null;
            ConfigEntries confEn = null;
            XmlNode oNode = null;
            try
            {

                pConfFiles = GetAllConfigFiles(true);
                pConfFileNames = new List<ConfigEntries>();

                for (int i = 0; i < pConfFiles.Count; i++)
                {
                    oXml = new XmlDocument();
                    oXml.Load(pConfFiles[i]);

                    // XmlNode pXMLNode = oXml.FirstChild;

                    confEn = new ConfigEntries();
                    confEn.FullName = pConfFiles[i];
                    confEn.Path = Path.GetDirectoryName(pConfFiles[i]);
                    confEn.FileName = Path.GetFileName(pConfFiles[i]);
                    if (confEn.FileName.ToUpper() == "Loaded.config".ToUpper())
                        confEn.Loaded = true;
                    else
                        confEn.Loaded = false;
                    oList = oXml.GetElementsByTagName("Name");
                    if (oList == null)
                    {
                        confEn.Name = "";
                    }
                    else if (oList.Count == 0)
                    {
                        confEn.Name = confEn.FileName;
                    }
                    else
                    {
                        oNode = oList.Item(0);
                        confEn.Name = oNode.InnerText;
                        oNode = null;
                    }
                    if (!(includeLoaded == false && confEn.Loaded == true))
                    {
                        pConfFileNames.Add(confEn);
                    }
                    oXml = null;

                }

                return pConfFileNames;
            }
            catch (Exception ex)
            {
                MessageBox.Show("GetAllConfigFilesNames:  " + ex.Message);

                return null;
            }
            finally
            {

                pConfFiles = null;
                pConfFileNames = null;
                oXml = null;

                oList = null;
                confEn = null;
                oNode = null;
            }
        }
        private void initForm()
        {
            txtBxPath.Text = ConfigUtil.generateUserCachePath();

            List<ConfigEntries> ConfigNames = ConfigUtil.GetAllConfigFilesNames(true);

            foreach (ConfigEntries pConEn in ConfigNames)
            {
                if (pConEn.Loaded == true)
                {
                    m_LoadedConfig = pConEn;
                    txtBxLoadedConfig.Text = pConEn.Name;
                    ConfigNames.Remove(pConEn);
                    break;
                }
            }

            cboConfigs.DataSource = ConfigNames;
            cboConfigs.DisplayMember = "Name";

            if (Globals.LogLocations == "")
                gpBxLog.Enabled = false;
            else
            {
                gpBxLog.Enabled = true;
                txtBoxLogPath.Text = Globals.LogLocations;

            }
        }