Пример #1
0
 static IEnumerable<SettingValue> GetFields()
 {
     foreach (var fi in typeof(Settings).GetFields())
     {
         SettingValue ret = new SettingValue();
         ret.Name = fi.Name;
         ret.Field = fi;
         yield return ret;
     }
 }
Пример #2
0
        static IEnumerable<SettingValue> GetFields()
        {
            foreach (var fi in typeof(Settings).GetFields())
            {
                SettingValue ret = new SettingValue();
                ret.Name = fi.Name;
                ret.Field = fi;

                foreach (var cur in fi.GetCustomAttributes())
                {
                    if (cur is Comment)
                    {
                        ret.Comment = ((Comment)cur).Value;
                    }
                }

                yield return ret;
            }
        }