Habanero.DB.DBMigrator.CurrentVersion C# (CSharp) Method

CurrentVersion() public method

Returns the current version number
Thrown if the /// settings storer has not been assigned
public CurrentVersion ( ) : int
return int
        public int CurrentVersion() {
            if (this._settings == null && GlobalRegistry.Settings == null)
            {
                throw new HabaneroArgumentException("SettingsStorer",
                                                "Please set the setting storer before using CurrentVersion as it uses the SettingsStorer to read the current version (VERSION setting)");
            }
            try
            {
                return _settings == null 
                    ? Convert.ToInt32(GlobalRegistry.Settings.GetString(DatabaseVersionSetting)) 
                    : Convert.ToInt32(_settings.GetString(DatabaseVersionSetting));
            }
            catch (UserException ) {
                return 0;
            }
        }