Thread: Method argument descriptions?

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    70

    Method argument descriptions?

    What attributes should be applied, ie:

    public void some([Description("Obj1")]object a, object b)

  2. #2
    Banned nickname_changed's Avatar
    Join Date
    Feb 2003
    Location
    Australia
    Posts
    986
    Code:
    /// <summary>
    /// This is MyMethod, and it does stuff :)
    /// </summary>
    /// <param name="a">'A' is the first parameter, where you 
    /// should put Object number 1</param>
    /// <param name="b">'B' is the second parameter, where you 
    /// should put Object number 2</param>
    public void MyMethod(object a, object b)
    For more information:
    http://msdn.microsoft.com/msdnmag/issues/02/06/XMLC/

    Edit: If you actually want the 'Description' attribute for reflection or something, you can't use it on parameters. Attributes can only be used on classes, properties, fields, methods and constructors - not parameters. That would be like placing an attribute on a local variable - kinda silly.
    Last edited by nickname_changed; 11-10-2005 at 05:45 PM.

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    70
    Well, now I know how to set them. Thanks ...and how can I get them from other's (compiled) assemblies, like those in the FW?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. getopt - parsing string as argument
    By bertazoid in forum C Programming
    Replies: 13
    Last Post: 02-05-2009, 04:35 PM
  2. stuck on display method
    By shintaro in forum C++ Programming
    Replies: 2
    Last Post: 02-01-2009, 05:17 PM
  3. Best communication method to thousand childs?
    By Ironic in forum C Programming
    Replies: 8
    Last Post: 11-08-2008, 12:30 AM
  4. template argument
    By George2 in forum C++ Programming
    Replies: 4
    Last Post: 03-12-2008, 03:01 AM
  5. How to pass non-static method to signal() function?
    By registering in forum C++ Programming
    Replies: 3
    Last Post: 11-06-2003, 04:33 PM