mscorlib 4.0.0.0 System.Attribute System.AttributeUsage(System.AttributeTargets.Delegate | System.AttributeTargets.ReturnValue | System.AttributeTargets.All, AllowMultiple=false, Inherited=false)

In a wrt component, all the parameters of a method and the return value must have names. By default, Winmdexp.exe (Windows Runtime Metadata Export Tool) gives the return value the name "value". When you use a component in a win8_appname_long app written in JavaScript, you can use this name to retrieve the return value. For example, suppose a component defines a method that has a return value and two out parameters (ByRef parameters with the attribute in Visual Basic):

`public static int ComputeAverage([ReadOnlyArray()] int[] input, out int minValue, out int maxValue) { … }` `Public Shared Function ComputeAverage( _ <ReadOnlyArray()> ByVal input As Integer, _ <Out()> ByRef minValue As Integer, _ <Out()> ByRef maxValue As Integer) As Integer … End Function`

When you call the function from JavaScript, you can access the return value by its default name (value):

`var data = [5, 13, 23, 37]; var results = SampleComponent.TestStuff.computeAverage(data); var formattedResults = "Min=" + results.minValue + ", Avg=" + results.value + ", Max=" + results.maxValue;`

You must give the return value a different name if you already have a parameter named "value". Or you might simply want to use a more meaningful name (such as "average" in this example). Apply the attribute to your method and specify a new name.

`[return: ReturnValueName("average")] public static int ComputeAverage([ReadOnlyArray()] int[] input, out int minValue, out int maxValue) { … }` `Public Shared Function ComputeAverage( _ <ReadOnlyArray()> ByVal input As Integer, _ <Out()> ByRef minValue As Integer, _ <Out()> ByRef maxValue As Integer) _ As <ReturnValueName("average")> Integer … End Function`

Specifies the name of the return value of a method in a wrt component.

- Constructor
  4.0.0.0
  To be added.

  Initializes a new instance of the class, and specifies the name of the return value.

  The name of the return value.
- Property
  4.0.0.0
  System.String To be added. To be added.

  Gets the name that was specified for the return value of a method in a wrt component.