public static string GetDescription(Type actorType) { DocumentationAttribute documentation = Attribute.GetCustomAttribute(actorType, typeof(DocumentationAttribute)) as DocumentationAttribute; if (documentation != null) { return(documentation.Description); } return(string.Empty); }
public static MessagePrototype Create(string _name, MethodInfo minfo) { MessagePrototype newPrototype = new MessagePrototype(); DocumentationAttribute docAttr = Attribute.GetCustomAttribute(minfo, typeof(DocumentationAttribute)) as DocumentationAttribute; if (docAttr != null) { newPrototype.documentation = docAttr.Documentation; newPrototype.description = docAttr.Description; } // Build up prototype. newPrototype.parameterTypes = new Type[minfo.GetParameters().Length]; for (int i = 0; i < newPrototype.parameterTypes.Length; i++) { newPrototype.parameterTypes[i] = minfo.GetParameters()[i].ParameterType; } newPrototype.returnType = minfo.ReturnType; newPrototype.name = _name; return(newPrototype); }