176 lines
5.1 KiB
VB.net
176 lines
5.1 KiB
VB.net
Imports System.Collections.ObjectModel
|
|
Imports EgtWPFLib5.MachiningTreeViewItem
|
|
|
|
Public Class NoteListBoxItem
|
|
Inherits VMBase
|
|
|
|
#Region "FIELD & PROPERTIES"
|
|
|
|
' Indice dei valori nel file Note.ini
|
|
Friend m_Id As Integer
|
|
Public Property Id As Integer
|
|
Get
|
|
Return m_Id
|
|
End Get
|
|
Set(value As Integer)
|
|
m_Id = value
|
|
End Set
|
|
End Property
|
|
|
|
' Tipo del valore che può essere b = boolean, d = double, l=lenght
|
|
Friend m_Type As String
|
|
Public Property Type As String
|
|
Get
|
|
Return m_Type
|
|
End Get
|
|
Set(value As String)
|
|
m_Type = value
|
|
End Set
|
|
End Property
|
|
|
|
' Descrizione
|
|
Friend m_Description As String
|
|
Public Property Description As String
|
|
Get
|
|
Return m_Description
|
|
End Get
|
|
Set(value As String)
|
|
m_Description = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_IsModifiedValue As Boolean = False
|
|
Public Property IsModifiedValue As Boolean
|
|
Get
|
|
Return m_IsModifiedValue
|
|
End Get
|
|
Set(value As Boolean)
|
|
m_IsModifiedValue = value
|
|
NotifyPropertyChanged(NameOf(IsModifiedValue))
|
|
End Set
|
|
End Property
|
|
|
|
' Valore di default 0
|
|
Friend m_Value As String
|
|
Public Property Value As String
|
|
Get
|
|
Return m_Value
|
|
End Get
|
|
Set(value As String)
|
|
m_IsModifiedValue = True
|
|
NotifyPropertyChanged(NameOf(IsModifiedValue))
|
|
m_Value = value
|
|
Dim SelTool As ToolTreeViewItem = If(Not IsNothing(LibMap.refToolDbWindowVM), LibMap.refToolDbWindowVM.SelTool, Nothing)
|
|
Dim SelMach As MachiningTreeViewItem = Nothing
|
|
If Not IsNothing(LibMap.refMachiningDbWindowVM) AndAlso Not IsNothing(LibMap.refMachiningDbWindowVM.SelMachining) Then
|
|
SelMach = LibMap.refMachiningDbWindowVM.SelMachining
|
|
Else
|
|
SelMach = MachiningTreeViewItem.sh_SelMach
|
|
End If
|
|
If Not IsNothing(SelMach) Then
|
|
SelMach.IsModifiedNote(Me)
|
|
ElseIf Not IsNothing(SelTool) Then
|
|
SelTool.IsModifiedNote(Me)
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
' Valore di default 0
|
|
Friend m_ListValue As New ObservableCollection(Of String)
|
|
Public Property ListValue As ObservableCollection(Of String)
|
|
Get
|
|
Return m_ListValue
|
|
End Get
|
|
Set(value As ObservableCollection(Of String))
|
|
m_ListValue = value
|
|
NotifyPropertyChanged(NameOf(ListValue))
|
|
End Set
|
|
End Property
|
|
|
|
' Valore di default 0
|
|
Friend m_SelListValue As String
|
|
Public Property SelListValue As String
|
|
Get
|
|
Return m_SelListValue
|
|
End Get
|
|
Set(value As String)
|
|
m_SelListValue = value
|
|
Dim SelTool As ToolTreeViewItem = If(Not IsNothing(LibMap.refToolDbWindowVM), LibMap.refToolDbWindowVM.SelTool, Nothing)
|
|
If Not IsNothing(SelTool) Then SelTool.SelNoteListValue(Me)
|
|
NotifyPropertyChanged(NameOf(SelListValue))
|
|
End Set
|
|
End Property
|
|
|
|
|
|
' Indice di selezione del tab per la scelta grafica se 0 viene mostrata la textbox se 1 la combobox
|
|
Friend m_SelTypeValue As Integer = 0
|
|
Public Property SelTypeValue As Integer
|
|
Get
|
|
Return m_SelTypeValue
|
|
End Get
|
|
Set(value As Integer)
|
|
m_SelTypeValue = value
|
|
End Set
|
|
End Property
|
|
|
|
' Comandi
|
|
Private m_cmdRemoveNoteItem As ICommand
|
|
|
|
#End Region ' Fields & Properties
|
|
|
|
#Region "CONSTRUCTOR"
|
|
|
|
Sub New(Id As Integer, Type As String, Description As String, Value As String)
|
|
m_Id = Id
|
|
m_Type = Type
|
|
m_Description = Description
|
|
m_Value = Value
|
|
End Sub
|
|
|
|
Sub New(Id As Integer, Type As String, Description As String, ListValue As ObservableCollection(Of String))
|
|
m_Id = Id
|
|
m_Type = Type
|
|
m_Description = Description
|
|
m_ListValue = ListValue
|
|
End Sub
|
|
|
|
#End Region ' Constructor
|
|
|
|
#Region "COMMANDS"
|
|
|
|
#Region "RemoveItemNoteCommand"
|
|
|
|
Public ReadOnly Property RemoveItemNoteCommand As ICommand
|
|
Get
|
|
If m_cmdRemoveNoteItem Is Nothing Then
|
|
m_cmdRemoveNoteItem = New Command(AddressOf RemoveItemNote)
|
|
End If
|
|
Return m_cmdRemoveNoteItem
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub RemoveItemNote(ByVal param As Object)
|
|
Dim SelTool As ToolTreeViewItem = If(Not IsNothing(LibMap.refToolDbWindowVM), LibMap.refToolDbWindowVM.SelTool, Nothing)
|
|
Dim SelMach As MachiningTreeViewItem = Nothing
|
|
If Not IsNothing(LibMap.refMachiningDbWindowVM) AndAlso Not IsNothing(LibMap.refMachiningDbWindowVM.SelMachining) Then
|
|
SelMach = LibMap.refMachiningDbWindowVM.SelMachining
|
|
Else
|
|
SelMach = MachiningTreeViewItem.sh_SelMach
|
|
End If
|
|
|
|
If Not IsNothing(SelTool) Then
|
|
SelTool.RemoveNote(Me)
|
|
ElseIf Not IsNothing(SelMach) AndAlso SelMach.m_CurrMachTreeViewItemType = MachTreeViewItemType.OPERATION Then
|
|
SelMach.RemoveNote(Me)
|
|
ElseIf Not IsNothing(SelMach) AndAlso SelMach.m_CurrMachTreeViewItemType = MachTreeViewItemType.MACH_DB Then
|
|
SelMach.RemoveNote(Me)
|
|
End If
|
|
End Sub
|
|
|
|
#End Region ' RemoveItemNoteCommand
|
|
|
|
#End Region ' Commands
|
|
|
|
End Class
|
|
|