コード例 #1
0
        protected string BClassFileName(IBClass bClass)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(HelpMeReflect.AttributeStringData(bClass.GetType(), typeof(BClass), "Description"));
            sb.Append(".txt");
            return(sb.ToString());
        }
コード例 #2
0
        private void Configure()
        {
            // Type argument
            Type typeArgument = this.GetType().GenericTypeArguments[0];

            // Menu title (=~ class type)
            string typeName =
                HelpMeReflect.AttributeStringData(typeArgument, typeof(BClass), "Description");

            this.Titel = TITEL_TEMPLATE.Replace(PLACEHOLDER, typeName);


            // Menu options (=~ class properties)
            this.bProperties = HelpMeReflect.PropertiesWithBPropertyAttribute(typeArgument);
            this.MenuOpties  = this.bProperties.Select(HelpMeReflect.AttributeOfType <BProperty>)
                               .Select(bProp => bProp.Description)
                               .ToList();

            // Associate the order (=~ indexes shown to user) with right properties
            int startIndex = 1;

            this.bProperties.ForEach(prop => this.indexedBProperties.Add(startIndex++, prop));
        }