Condividi tramite


Expression.IsValidValue Property

Definition

Indicates whether the specified value in an expression is valid.

public:
 property bool IsValidValue { bool get(); };
public:
 property bool IsValidValue { bool get(); };
[System.Runtime.InteropServices.DispId(103)]
public bool IsValidValue { [System.Runtime.InteropServices.DispId(103)] get; }
[<System.Runtime.InteropServices.DispId(103)>]
[<get: System.Runtime.InteropServices.DispId(103)>]
member this.IsValidValue : bool
Public ReadOnly Property IsValidValue As Boolean

Property Value

A Boolean value.

Attributes

Examples

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.");  
}  
Shared Sub IsValidValue(ByRef dte As EnvDTE.DTE)  
    Dim exp As EnvDTE.Expression = dte.Debugger.GetExpression("tempC", True, 1)  
    If exp.IsValidValue Then  
        MessageBox.Show("The specified value in an expression is valid.", _  
                        "Expression Test - IsValidValue Property")  
    Else  
        MessageBox.Show("The specified value in an expression is invalid.", _  
                        "Expression Test - IsValidValue Property")  
    End If  
End Sub  

Remarks

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

Applies to