NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

MethodInfo.ReturnType

When implemented by a subclass, this property retrieves the Type of this method's return value.

[Visual Basic]
MustOverride Public ReadOnly Property ReturnType As Type
[C#]
public Type ReturnType {abstract get;}
[C++]
public: __property virtual Type* get_ReturnType() = 0;
[JScript]
public abstract function get ReturnType() : Type;

Property Value

Read-only. The Type of object this method returns.

Remarks

The return type of the method.

To get the return type property, first get the class Type. From the Type, get the MethodInfo. From the MethodInfo, get the ReturnType.

Example [C#]

[C#]

class Mymethodinfo
{
   public static int Main()
      {
      Console.WriteLine ("\nReflection.MethodInfo");
 
      //Get the Type and MethodInfo
      Type MyType = Type.GetType("System.Reflection.FieldInfo");
      MethodInfo Mymethodinfo = MyType.GetMethod("GetValue");
      Console.Write ("\n" + MyType.FullName + "." + Mymethodinfo.Name);
 
      //Get and display the ReturnType
      Console.Write ("\nReturnType - {0}", Mymethodinfo.ReturnType);
      return 0;
   }
}
Produces the following output

Reflection.MethodInfo
System.Reflection.FieldInfo.GetValue
ReturnType - System.Variant

See Also

MethodInfo Class | MethodInfo Members | System.Reflection Namespace