Imports DevExpress.ExpressApp.DC
Imports DevExpress.ExpressApp.Model

<DomainLogic(GetType(IModelMemberAllowSort))>
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
