Imports EgtUILib
'''
''' Class that represent a Machining in the treeview.
''' It's an element in the treeview that represent the child of familymachiningtreeviewitem, but also the class that read and write in the machining's database
'''
Public Class MachiningTreeViewExpanderItem
Inherits ChildItem
#Region "Machining Property"
Private m_Type As MCH_MY
Public ReadOnly Property Type As Integer
Get
Return m_Type
End Get
End Property
'''
''' Property that determines if the Machining 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 Machining is selected, set it as current and notify all machining's property
' to refresh them values with those of the new selected machining
If value Then
EgtMdbSetCurrMachining(Me.Name)
Else
End If
End If
End Set
End Property
Private m_Tool As String
Public Property Tool As String
Get
Return m_Tool
End Get
Set(value As String)
m_Tool = value
End Set
End Property
#End Region ' Machining Property
#Region "Constructors"
Sub New(Name As String, Type As MCH_MY, Tool As String)
MyBase.New(Name)
Me.m_Type = Type
Me.Tool = If(Not String.IsNullOrEmpty(Tool), "(" & Tool & ")", String.Empty)
End Sub
#End Region ' Constructors
End Class
'''
''' Class that represent a FamilyMachining in the treeview.
''' It's an element in the treeview that represent a folder, but also a machining family
'''
Public Class FamilyMachiningTreeViewExpanderItem
Inherits ParentItem
Private m_MachiningType As MCH_MY
'''
''' Property that determines the machining type of the family
'''
Public Property MachiningType As MCH_MY
Get
Return m_MachiningType
End Get
Set(value As MCH_MY)
m_MachiningType = value
End Set
End Property
'''
''' Property that determines if the Machining 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
End If
End Set
End Property
'''
''' Constructor that receive the name of the FamilyMachiningTreeViewItem, the MachiningType, and set
''' the picture(Folder.png)
'''
Sub New(Name As String, MachiningType As MCH_MY)
MyBase.New(Name)
Me.MachiningType = MachiningType
Me.PictureString = "/Resources/TreeView/Folder.png"
End Sub
End Class