Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Resolves the value of a parameter for a directive processor if the parameter is not specified in the template text.
Namespace:  Microsoft.VisualStudio.TextTemplating
Assembly:  Microsoft.VisualStudio.TextTemplating (in Microsoft.VisualStudio.TextTemplating.dll)
Syntax
'Declaration
Function ResolveParameterValue ( _
    directiveId As String, _
    processorName As String, _
    parameterName As String _
) As String
'Usage
Dim instance As ITextTemplatingEngineHost 
Dim directiveId As String 
Dim processorName As String 
Dim parameterName As String 
Dim returnValue As String 
returnValue = instance.ResolveParameterValue(directiveId, _
    processorName, parameterName)
string ResolveParameterValue(
    string directiveId,
    string processorName,
    string parameterName
)
String^ ResolveParameterValue(
    String^ directiveId, 
    String^ processorName, 
    String^ parameterName
)
function ResolveParameterValue(
    directiveId : String, 
    processorName : String, 
    parameterName : String
) : String
Parameters
- directiveId 
 Type: System.String- The ID of the directive call to which the parameter belongs. This ID disambiguates repeated calls to the same directive from the same text template. 
- processorName 
 Type: System.String- The name of the directive processor to which the directive belongs. 
- parameterName 
 Type: System.String- The name of the parameter to be resolved. 
Return Value
Type: System.String
A String that represents the resolved parameter value.
Remarks
This method can be called by a directive processor or from the code of a text template to get values from the text template host. Typically the directive processor will call the method to get a default value for a parameter of the directive.
For example, in the host that executes in the command-line utility TextTransform.exe, this method retrieves values from the –a command line option. For more information, see TextTransform.
Examples
The following code example shows a possible implementation for a custom host. This code example is part of a larger example. For the complete example, see Walkthrough: Creating a Custom Text Template Host.
public string ResolveParameterValue(string directiveId, string processorName, string parameterName)
{
    if (directiveId == null)
    {
        throw new ArgumentNullException("the directiveId cannot be null");
    }
    if (processorName == null)
    {
        throw new ArgumentNullException("the processorName cannot be null");
    }
    if (parameterName == null)
    {
        throw new ArgumentNullException("the parameterName cannot be null");
    }
    //code to provide "hard-coded" parameter values goes here
    //this code depends on the directive processors this host will interact with
    //if we cannot do better - return the empty string
    return String.Empty;
}
Public Function ResolveParameterValue(ByVal directiveId As String, ByVal processorName As String, ByVal parameterName As String) As String Implements Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost.ResolveParameterValue
    If directiveId Is Nothing Then
        Throw New ArgumentNullException("the directiveId cannot be null")
    End If
    If processorName Is Nothing Then
        Throw New ArgumentNullException("the processorName cannot be null")
    End If
    If parameterName Is Nothing Then
        Throw New ArgumentNullException("the parameterName cannot be null")
    End If
    'code to provide "hard-coded" parameter values goes here
    'this code depends on the directive processors this host will interact with
    'if we cannot do better - return the empty string
    Return String.Empty
End Function
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
ITextTemplatingEngineHost Interface
ITextTemplatingEngineHost Members
Microsoft.VisualStudio.TextTemplating Namespace