Esempio n. 1
0
        public static MoviesDAL.MovieSettings_GetRecord GetSetting(SettingID SettingID)
        {
            Dictionary <int, MoviesDAL.MovieSettings_GetRecord> allSettings = MovieSettings.GetAllSettings();

            if (allSettings.TryGetValue((int)SettingID, out MoviesDAL.MovieSettings_GetRecord returnValue) == false)
            {
                lock (_syncObject)
                {
                    // Do it again to make sure another thread didn't load it.
                    if (allSettings.TryGetValue((int)SettingID, out returnValue) == false)
                    {
                        returnValue = null;
                    }
                }
            }

            return(returnValue);
        }
Esempio n. 2
0
        public static string GetSettingValue(SettingID SettingID)
        {
            string returnValue = string.Empty;

            try
            {
                MoviesDAL.MovieSettings_GetRecord setting = MovieSettings.GetSetting(SettingID);
                if (setting != null)
                {
                    returnValue = setting.Value;
                }
            }
            catch (Exception ex)
            {
                // Logging.Logger.LogError ( ex );
                throw ex;
            }
            return(returnValue);
        }
Esempio n. 3
0
 public ListSetting GetListByID(SettingID id)
 {
     return(this.FirstOrDefault(s => s.ID == id) as ListSetting);
 }
Esempio n. 4
0
 public NumericSetting GetNumericByID(SettingID id)
 {
     return(this.FirstOrDefault(s => s.ID == id) as NumericSetting);
 }
Esempio n. 5
0
 public Setting GetByID(SettingID id)
 {
     return(this.FirstOrDefault(s => s.ID == id));
 }