コード例 #1
0
 public void Bind(PropertyInfo property, IBindingContext context)
 {
     property.ForAttribute<BindingAttribute>(att =>
     {
         att.Bind(property, context);
     });
 }
コード例 #2
0
ファイル: InputParser.cs プロジェクト: RobertTheGrey/fubumvc
        public static string ToFlagName(PropertyInfo property)
        {
            var name = property.Name.Substring(0, property.Name.Length - 4);
            property.ForAttribute<FlagAliasAttribute>(att => name = att.Alias);

            return FLAG_PREFIX + name.ToLower();
        }
コード例 #3
0
        public static FlagAliases ToFlagAliases(PropertyInfo property)
        {
            var name = property.Name;
            if (name.EndsWith("Flag"))
            {
                name = name.Substring(0, property.Name.Length - 4);
            }

            name = splitOnPascalCaseAndAddHyphens(name);

            var oneLetterName = name.ToLower()[0];

            property.ForAttribute<FlagAliasAttribute>(att =>
                                                          {
                                                              name = att.LongAlias ?? name;
                                                              oneLetterName = att.OneLetterAlias ?? oneLetterName;
                                                          });
            return new FlagAliases
                       {
                           ShortForm = (SHORT_FLAG_PREFIX + oneLetterName),
                           LongForm = LONG_FLAG_PREFIX + name.ToLower()
                       };
        }