Exemplo n.º 1
0
        private void ApplySettings(object settings, SettingsIO settingsIO)
        {
            if (settingsIO.Begin())
            {
                Type           classType = settings.GetType();
                PropertyInfo[] fi        = classType.GetProperties(BindingFlags.Public | BindingFlags.Instance);

                foreach (PropertyInfo info in fi)
                {
                    object[] customAttributes = info.GetCustomAttributes(typeof(UserScopedSettingAttribute), false);
                    if (customAttributes.Length > 0)
                    {
                        settingsIO.Process(settings, info);
                    }
                }
                settingsIO.End();
            }
        }
Exemplo n.º 2
0
        private void ApplySettings(object settings, SettingsIO settingsIO)
        {
            if(settingsIO.Begin())
            {
                Type classType = settings.GetType();
                PropertyInfo[] fi = classType.GetProperties(BindingFlags.Public | BindingFlags.Instance);

                foreach (PropertyInfo info in fi)
                {
                    object[] customAttributes = info.GetCustomAttributes(typeof(UserScopedSettingAttribute), false);
                    if (customAttributes.Length > 0)
                    {
                        settingsIO.Process(settings, info);
                    }
                }
                settingsIO.End();
            }
        }