a4b5cd4834
- Cambiati nomi classi e file.
86 lines
2.5 KiB
VB.net
86 lines
2.5 KiB
VB.net
Imports EgtUILib
|
|
|
|
Namespace EgtCAM5
|
|
|
|
Public Class InfoExpanderViewModel
|
|
Inherits ViewModelBase
|
|
|
|
#Region "Messages"
|
|
|
|
Public ReadOnly Property PropertiesMsg As String
|
|
Get
|
|
Return EgtMsg(MSG_DRAWOPTION + 1)
|
|
End Get
|
|
End Property
|
|
|
|
#End Region
|
|
|
|
Private m_IsExpanded As Boolean
|
|
Public Property IsEnabled As Boolean
|
|
Get
|
|
Return m_IsExpanded
|
|
End Get
|
|
Set(value As Boolean)
|
|
If value <> m_IsExpanded Then
|
|
m_IsExpanded = value
|
|
OnPropertyChanged("IsEnabled")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Private m_InfoBox As String
|
|
Public Property InfoBox As String
|
|
Get
|
|
Return m_InfoBox
|
|
End Get
|
|
Set(value As String)
|
|
If value <> m_InfoBox Then
|
|
m_InfoBox = value
|
|
If value <> String.Empty Then
|
|
IsEnabled = True
|
|
Else
|
|
IsEnabled = False
|
|
End If
|
|
OnPropertyChanged("InfoBox")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Sub New()
|
|
Application.Msn.Register(Application.UPDATEOBJDATAINOBJTREE, Sub(Id As Integer)
|
|
UpdateObjDataInObjTree(Id)
|
|
End Sub)
|
|
Application.Msn.Register(Application.SETINFOBOX, Sub(sString As String)
|
|
InfoBox = sString
|
|
End Sub)
|
|
End Sub
|
|
|
|
Private Sub UpdateObjDataInObjTree(ByVal nId As Integer)
|
|
' recupero il tipo del nuovo oggetto
|
|
Dim nType As Integer = EgtGetType(nId)
|
|
' stampa dei dati dell'oggetto
|
|
Dim sDump As String = String.Empty
|
|
If nType = GDB_TY.NONE Then
|
|
InfoBox = String.Empty
|
|
ElseIf nType = GDB_TY.GROUP Then
|
|
If EgtGroupDump(nId, sDump) Then
|
|
InfoBox = sDump
|
|
IsEnabled = True
|
|
Else
|
|
InfoBox = String.Empty
|
|
IsEnabled = False
|
|
End If
|
|
Else
|
|
If EgtGeoObjDump(nId, sDump) Then
|
|
InfoBox = sDump
|
|
IsEnabled = True
|
|
Else
|
|
InfoBox = String.Empty
|
|
IsEnabled = False
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
End Class
|
|
|
|
End Namespace |