コード例 #1
0
        public CommandTypeWrapper(Type type)
        {
            LinkedToType = type;
            Name         = type.Name.ToHyphened();

            var attributes = type.GetCustomAttributes(typeof(CommandAttribute), true);

            if (attributes.Length <= 0)
            {
                return;
            }

            var commandAttribute = (CommandAttribute)attributes.First();

            Description = Description.GetNewIfValid(commandAttribute.Description);
            Name        = Name.GetNewIfValid(commandAttribute.Name);
            RouteBase   = RouteBase.GetNewIfValid(commandAttribute.RouteBase);
        }