Expression.IsValidValue Property

 

Indicates whether the specified value in an expression is valid.

Namespace:   EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

bool IsValidValue { get; }

Property Value

Type: System.Boolean

A Boolean value.

Returns true if the value in the expression is valid; otherwise, it returns false.

The following example demonstrates how to use the IsValidValue property.

public static void IsValidValue(DTE dte)
{
    // Setup debug Output window.
    Window w = (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
    w.Visible = true;
    OutputWindow ow = (OutputWindow)w.Object;
    OutputWindowPane owp = ow.OutputWindowPanes.Add("IsValidValue property: ");
    owp.Activate();

    EnvDTE.Expression exp = dte.Debugger.GetExpression("tempC", true, 1);
    if(exp.IsValidValue)
        owp.OutputString("The specified value in an expression is valid.");
    else
        owp.OutputString("The specified value in an expression is invalid.");
}
Return to top
Show: