Imports System.Collections.ObjectModel Imports EgtUILib Public Class LayerTreeViewItem Inherits TreeViewItemBase Friend Shared m_SendCmd As Boolean = True Friend Shared m_MarkOnSel As Boolean = True Private m_Id As Integer Public ReadOnly Property Id As Integer Get Return m_Id End Get End Property ''' ''' Property that determines if the Tool is selected or not ''' Public Overrides Property IsSelected As Boolean Get Return m_IsSelected End Get Set(value As Boolean) If (value <> m_IsSelected) Then m_IsSelected = value If value Then ' recupero l'Id del nuovo oggetto selezionato Application.Msn.NotifyColleagues(Application.ISRIGHTCLICKEDLAYERTREEITEM, False) If m_MarkOnSel Then Application.Msn.NotifyColleagues(Application.UPDATEOBJINOBJTREE, Me.Id) Else Application.Msn.NotifyColleagues(Application.UPDATEOBJINOBJTREENOMARK, Me.Id) End If End If End If End Set End Property Private m_IsRightSelected As Boolean ''' ''' Property that determines if the Tool is selected or not ''' Public Property IsRightSelected As Boolean Get Return m_IsRightSelected End Get Set(value As Boolean) ' In realtà il valore di value è insignificante perchè la cosa importante è che il click esegua questo Set m_IsRightSelected = value Application.Msn.NotifyColleagues(Application.ISRIGHTCLICKEDLAYERTREEITEM, True) Application.Msn.NotifyColleagues(Application.RIGHTCLICKEDLAYERTREEITEM, Me.Id) End Set End Property Private m_Items As New ObservableCollection(Of LayerTreeViewItem) Public Property Items As ObservableCollection(Of LayerTreeViewItem) Get Return m_Items End Get Set(value As ObservableCollection(Of LayerTreeViewItem)) m_Items = value End Set End Property Private m_OnOff As Boolean Public Property OnOff As Boolean Get Return m_OnOff End Get Set(value As Boolean) If m_OnOff <> value Then m_OnOff = value ' se abilitato, eseguo operazione If m_SendCmd Then Application.Msn.NotifyColleagues(Application.SETLASTINTEGER, Id) If value Then Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.SHOW) Else Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.HIDE) End If End If End If End Set End Property Private m_sPictureString As String Public Property PictureString As String Get Return m_sPictureString End Get Set(value As String) If value <> m_sPictureString Then m_sPictureString = value NotifyPropertyChanged("PictureString") End If End Set End Property Private m_LayerColor As SolidColorBrush Public Property LayerColor As SolidColorBrush Get Return m_LayerColor End Get Set(value As SolidColorBrush) m_LayerColor = value End Set End Property Sub New(Id As Integer, Name As String, Image As String, CurrColor As Color3d) MyBase.New(Name) Me.m_Id = Id Me.PictureString = Image Me.LayerColor = New SolidColorBrush(Color.FromArgb(CByte(CurrColor.A * 255 / 100), CByte(CurrColor.R), CByte(CurrColor.G), CByte(CurrColor.B))) End Sub Sub New(Id As Integer, Name As String) MyBase.New(Name) End Sub End Class