Imports System
Imports System.ComponentModel

Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering

Imports DevExpress.ExpressApp
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Persistent.Validation

<DefaultClassOptions(), NonPersistent(), CreatableItem(False), NavigationItem(False)> _
Public Class ProductFinderVariable
    Inherits BaseObject
    Private _MasterKey As Guid
    Private _Products As Products

    Public Sub New(ByVal session As Session)
        MyBase.New(session)
    End Sub
    Public Overrides Sub AfterConstruction()
        MyBase.AfterConstruction()
    End Sub

    <Browsable(False)> _
    Property MasterKey As Guid
        Get
            Return _MasterKey
        End Get
        Set(value As Guid)
            SetPropertyValue("MasterKey", _MasterKey, value)
        End Set
    End Property
    <ImmediatePostData(), Browsable(False)>
    Property Products As Products
        Get
            Return _Products
        End Get
        Set(value As Products)
            SetPropertyValue("Products", _Products, value)
        End Set
    End Property

    <VisibleInListView(False), VisibleInLookupListView(False)> _
    ReadOnly Property ProductSelectOriginal As XPCollection(Of ProductSelect)
        Get
            If Me.Products IsNot Nothing Then
                Return New XPCollection(Of ProductSelect)(Session, CriteriaOperator.Parse("Products=?", Me.Products))
            Else
                Return Nothing
            End If
        End Get
    End Property
    <VisibleInListView(False), VisibleInLookupListView(False)> _
    ReadOnly Property ProductSelectVariables As XPCollection(Of ProductSelect)
        Get
            Return New XPCollection(Of ProductSelect)(Session)
        End Get
    End Property
End Class
