public bool SaveProgramSettings(ProgramData data)
        {
            bool result = false;
            try
            {
                if (setDoc != null && data != null)
                {
                    XElement sets = setDoc.Element("ProgramSettings");
                    sets.Element("ImageCacheMaxSize").Value = data.ImageCacheMaxSize.ToString();
                    sets.Element("ClearImageCache").Value = data.IsClearImageCache.ToString();
                    sets.Element("DataCacheMaxSize").Value = data.DataCacheMaxSize.ToString();
                    sets.Element("DetermineNewMessages").Value = data.DetermineNewMessages == true ? "1" : "0";
                    setDoc.Save(setting);
                    LoggingModule.Instance.WriteMessage(LoggingModule.Severity.Information, data.ToString());

                    result = true;
                }
            }
            catch (Exception ex)
            {
                LoggingModule.Instance.WriteMessage(LoggingModule.Severity.Error, ex.Message);
            }

            return result;
        }
        public ProgramData GetProgramSettings()
        {
            if (setDoc != null)
            {
                ProgramData data = new ProgramData();
                data.ImageCacheMaxSize = double.Parse(setDoc.Element("ProgramSettings").Element("ImageCacheMaxSize").Value);
                data.IsClearImageCache = bool.Parse(setDoc.Element("ProgramSettings").Element("ClearImageCache").Value);
                data.DataCacheMaxSize = double.Parse(setDoc.Element("ProgramSettings").Element("DataCacheMaxSize").Value);
                data.DetermineNewMessages = setDoc.Element("ProgramSettings").Element("DetermineNewMessages").Value == "1" ? true : false;

                LoggingModule.Instance.WriteMessage(LoggingModule.Severity.Information, "Configuration manager program settings", data.ToString());

                return data;
            }
            return null;
        }