Imports Microsoft.VisualStudio.DebuggerVisualizers
Imports System.Linq.Expressions

Public NotInheritable Class CPersona
    Private _nombre As String
    Private _fechaNac As String

    Public Property Nombre() As String
        Get
            Return _nombre
        End Get
        Set(ByVal value As String)
            _nombre = value
        End Set
    End Property

    Public Property FechaNac() As DateTime
        Get
            Return _fechaNac
        End Get
        Set(ByVal value As DateTime)
            _fechaNac = value
        End Set
    End Property
End Class

Module Module1

    ' The Expression Tree Visualizer can be used in a debug environment to visualize expressions.  To use 
    ' the visualizer the dll generated by the ExpressionTreeVisualizer project must be copied to 
    ' \My Documents\Visual Studio Codename Orcas\Visualizers.  This console program provides the ability to
    ' host the visualizer outside of Visual Studio without copying the DLL.
    Sub Main()
        Dim introduction = "The Visualizer may be hidden behind a window. Try the GuiHost."
        Console.WriteLine(introduction)
        'Dim expr As Expression(Of Func(Of Integer, Boolean)) = Function(x) x = 10
        Dim expr As Expression(Of Func(Of CPersona, Boolean)) = Function(p) p.FechaNac.Year = 1991
        Dim host = New VisualizerDevelopmentHost(expr, _
                    GetType(ExpressionTreeVisualizer), _
                    GetType(ExpressionTreeVisualizerObjectSource))
        host.ShowVisualizer()
    End Sub

End Module
