public void SaveSettings(SystemSettingsBase settings)
        {
            var methodInfo    = GetType().GetMethods().First(x => x.Name == "SaveSettings" && x.IsGenericMethod);
            var genericMethod = methodInfo.MakeGenericMethod(settings.GetType());

            genericMethod.Invoke(this, new object[] { settings });
        }
Пример #2
0
        public void DeleteSettings(SystemSettingsBase settings)
        {
            string fileLocation = GetFileLocation(settings);

            if (File.Exists(fileLocation))
            {
                File.Delete(fileLocation);
            }
        }
        public void MarkAsMigrated(SystemSettingsBase settings)
        {
            string fileLocation = GetFileLocation(settings.GetType());

            File.Move(fileLocation, GetMigratedFileLocation(settings.GetType()));
        }
Пример #4
0
 private string GetFileLocation(SystemSettingsBase settings)
 {
     return(GetFileLocation(settings.GetType()));
 }