Imports Microsoft.VisualBasic Imports DevExpress.Data Imports System.ComponentModel Imports DevExpress.ExpressApp.DC Imports DevExpress.ExpressApp.Model Imports DevExpress.ExpressApp.Editors Imports DevExpress.ExpressApp #Region "INTERFACE" Public Interface IModelOptionsExtender Property RequreMinimumPriceCheck As Boolean Property DefaultCustomersFileFolder As String Property DefaultproductsFileFolder As String Property NAVProgramPath As String Property ExternalBrowserPath As String Property HeaderLeft As String Property HeaderCenter As String Property HeaderRight As String Property FooterLeft As String Property FooterCenter As String Property FooterRight As String End Interface Public Interface IModelListViewExtender Property IsGroupFooterVisible() As Boolean Property AdditionalCriteria As String Property RequireCriteriaBeforeView As Boolean Property RequireCriteriaBeforeViewCaption As String Property RequireCriteriaBeforeViewCriteria As String Property GridViewGroupFormat As String Property IsCentralListView As Boolean Property TreeListEnableFiltering As Boolean Property DefaultDateYearInFilter As Boolean 'Az a képesség, hogy ListView esetén van-e automatikusan adott évre filter szűrő Property DefaultDateYearInFilterProperty As String 'Az a képesség, hogy ListView esetén van-e automatikusan adott évre szűrő és melyik a dátum szűrése ! Overloads Property IsFooterVisible As Boolean Property Hints As String '// Grid nyomtatáshoz '// {0} CustomersFrom.FullName alapértelmezettből ! Property HeaderLeft As String Property HeaderCenter As String Property HeaderRight As String Property FooterLeft As String Property FooterCenter As String Property FooterRight As String End Interface Public Interface IModelDetailViewExtender Property Hints As String End Interface Public Interface IModelColumnExtender _ Property GroupFooterSummaryType() As SummaryItemType _ Property InLineEdit As Boolean Property InLineCriteria As String _ _ Property InLineEditAutoCommit As Boolean _ Property HideValueIfZero As Boolean '// ModelMember.Type -> a mező tipusára vonatkoztatva '// ParentView.ModelClass.TypeInfo -> a ListView objektumára vonatkoztatva End Interface Public Enum DefaultDateYearInCriteriaEnum CurrentYearOnly = 0 CurrentYearAndPrevYear = 1 NotSet = -1 End Enum Public Interface IModelClassAllowSort Property DefaultListViewAllowSort() As Boolean Property NonPersistent As Boolean Property IsPopup As Boolean Property SISGroup1 As String Property SISGroup2 As String Property SISDescription As String Property LockObjectBeforeEdit As Boolean ' Property LockObjectBeforeEditErrorString As String Property DefaultDateYearInFilter As Boolean 'Az a képesség, hogy ListView esetén van-e automatikusan adott évre filter szűrő Property DefaultDateYearInFilterProperty As String 'Az a képesség, hogy ListView esetén van-e automatikusan adott évre szűrő és melyik a dátum szűrése ! End Interface Public Interface IModelMemberAllowSort Property AllowSort() As Boolean Property AllowRounding() As Boolean Property RoundingTo() As Long Property HideValueIfZero As Boolean End Interface Public Interface IModelListViewAllowSort Property AllowSort() As Boolean Property IsListViewProcess As Boolean Property RowAutoHeight As Boolean End Interface Public Interface IModelColumnAllowSort Property AllowSort() As Boolean End Interface Public Interface IModelActionExtender Property SISGroup1 As String Property SISGroup2 As String Property SISDescription As String Property FocusItem As String End Interface #End Region #Region "DOMAIN LOGIC" _ Public NotInheritable Class ModelClassAllowSortLogic Public Shared Function Get_DefaultListViewAllowSort(ByVal modelClass As IModelClass) As Boolean If modelClass Is Nothing Then Return True End If If modelClass.TypeInfo Is Nothing Then Return True End If Dim attribute As AllowSortAttribute = modelClass.TypeInfo.FindAttribute(Of AllowSortAttribute)() If attribute IsNot Nothing Then Return attribute.AllowSort Else Return True End If End Function End Class _ Public NotInheritable Class ModelMemberAllowSortLogic Public Shared Function Get_AllowSort(ByVal modelMember As IModelMember) As Boolean If modelMember Is Nothing Then Return True Else If modelMember.MemberInfo Is Nothing Then Return True End If Dim attribute As AllowSortAttribute = modelMember.MemberInfo.FindAttribute(Of AllowSortAttribute)() If attribute IsNot Nothing Then Return attribute.AllowSort Else Return True End If End If End Function End Class _ Public NotInheritable Class ModelListViewAllowSortLogic Public Shared Function Get_AllowSort(ByVal modelListView As IModelListView) As Boolean Return (CType(modelListView.ModelClass, IModelClassAllowSort)).DefaultListViewAllowSort End Function End Class _ Public NotInheritable Class ModelColumnAllowSortLogic Public Shared Function Get_AllowSort(ByVal modelColumn As IModelColumn) As Boolean If modelColumn.ModelMember IsNot Nothing Then Return (CType(modelColumn.ModelMember, IModelMemberAllowSort)).AllowSort Else Return True End If End Function End Class _ Public NotInheritable Class IModelColumnExtenderLogic Public Shared Function Get_HideValueIfZero(ByVal modelColumn As IModelColumn) As Boolean If modelColumn.ModelMember IsNot Nothing Then Return (CType(modelColumn.ModelMember, IModelMemberAllowSort)).HideValueIfZero Else Return False End If End Function End Class _ Public NotInheritable Class IModelListViewExtenderLogic Public Shared Function Get_DefaultDateYearInFilter(ByVal modelListView As IModelListView) As Boolean If modelListView.ModelClass IsNot Nothing Then Return (CType(modelListView.ModelClass, IModelClassAllowSort)).DefaultDateYearInFilter Else Return False End If End Function Public Shared Function Get_DefaultDateYearInFilterProperty(ByVal modelListView As IModelListView) As String If modelListView.ModelClass IsNot Nothing Then Return (CType(modelListView.ModelClass, IModelClassAllowSort)).DefaultDateYearInFilterProperty Else Return "" End If End Function Public Shared Function Get_HeaderLeft(ByVal modelListView As IModelListView) As String If modelListView.Application IsNot Nothing Then If modelListView.Application.Options IsNot Nothing Then Return TryCast(modelListView.Application.Options, IModelOptionsExtender).HeaderLeft Else Return "" End If Else Return "" End If End Function Public Shared Function Get_HeaderCenter(ByVal modelListView As IModelListView) As String If modelListView.Application IsNot Nothing Then If modelListView.Application.Options IsNot Nothing Then Return TryCast(modelListView.Application.Options, IModelOptionsExtender).HeaderCenter Else Return "" End If Else Return "" End If End Function Public Shared Function Get_HeaderRight(ByVal modelListView As IModelListView) As String If modelListView.Application IsNot Nothing Then If modelListView.Application.Options IsNot Nothing Then Return TryCast(modelListView.Application.Options, IModelOptionsExtender).HeaderRight Else Return "" End If Else Return "" End If End Function Public Shared Function Get_FooterLeft(ByVal modelListView As IModelListView) As String If modelListView.Application IsNot Nothing Then If modelListView.Application.Options IsNot Nothing Then Return TryCast(modelListView.Application.Options, IModelOptionsExtender).FooterLeft Else Return "" End If Else Return "" End If End Function Public Shared Function Get_FooterCenter(ByVal modelListView As IModelListView) As String If modelListView.Application IsNot Nothing Then If modelListView.Application.Options IsNot Nothing Then Return TryCast(modelListView.Application.Options, IModelOptionsExtender).FooterCenter Else Return "" End If Else Return "" End If End Function Public Shared Function Get_FooterRight(ByVal modelListView As IModelListView) As String If modelListView.Application IsNot Nothing Then If modelListView.Application.Options IsNot Nothing Then Return TryCast(modelListView.Application.Options, IModelOptionsExtender).FooterRight Else Return "" End If Else Return "" End If End Function End Class #End Region