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 ProductFinder
    Inherits BaseObject
    Private _MasterKey As Guid
    Private _Products As Products
    Public Sub New(ByVal session As Session)
        MyBase.New(session)
        ' This constructor is used when an object is loaded from a persistent storage.
        ' Do not place any code here or place it only when the IsLoading property is false:
        ' if (!IsLoading){
        '   It is now OK to place your initialization code here.
        ' }
        ' or as an alternative, move your initialization code into the AfterConstruction method.
    End Sub
    Public Overrides Sub AfterConstruction()
        MyBase.AfterConstruction()
        ' Place here your initialization code.
    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)
            If Session.IsObjectsSaving = False And Session.IsObjectsLoading = False Then
                Dim c As XPCollection(Of ProductFinderInfo)
                c = Me.ProductFinderInfo
            End If
        End Set
    End Property
    <VisibleInListView(False), VisibleInLookupListView(False)> _
    ReadOnly Property ProductSelect As XPCollection(Of ProductSelect)
        Get
            Return New XPCollection(Of ProductSelect)(Session)
        End Get
    End Property
    <VisibleInListView(False), VisibleInLookupListView(False)> _
    ReadOnly Property ProductSelected As XPCollection(Of ProductSelected)
        Get
            Return New XPCollection(Of ProductSelected)(Session, CriteriaOperator.Parse("MasterKey=?", Me.MasterKey))
        End Get
    End Property
    <VisibleInListView(False), VisibleInLookupListView(False)> _
    ReadOnly Property StorageOutCirculation As XPCollection(Of StorageOutCirculation)
        Get
            Return New XPCollection(Of StorageOutCirculation)(Session, CriteriaOperator.Parse("1=2"))
        End Get
    End Property
    ReadOnly Property StorageComputedInfo As XPCollection(Of StorageComputedInfo)
        Get
            Return New XPCollection(Of StorageComputedInfo)(Session, CriteriaOperator.Parse("1=2"))
        End Get
    End Property
    <VisibleInListView(False), VisibleInLookupListView(False)> _
    ReadOnly Property ProductFinderInfo As XPCollection(Of ProductFinderInfo)
        Get
            Return New XPCollection(Of ProductFinderInfo)(Session, CriteriaOperator.Parse("1=2"))
        End Get
    End Property
End Class
