Files
egtbeamwall/EgtBEAMWALL.ViewerOptimizer/ItemParamList/FeatureInPartInRawPartListVM.vb
T
Demetrio Cassarino 088b9ce3cf -aggiunto selezione checkbox FeatureInPartInRawPartListVM
-istemata visibilità spèecial panel
2024-04-05 17:01:25 +02:00

102 lines
3.7 KiB
VB.net

Imports System.Collections.ObjectModel
Imports System.Data
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public Class FeatureInPartInRawPartListVM
Inherits VMBase
Private m_colFeatureInPartInRawPart_Do As EgtDataGridColumn
Public ReadOnly Property colFeatureInPartInRawPart_Do As EgtDataGridColumn
Get
Return m_colFeatureInPartInRawPart_Do
End Get
End Property
Private m_colFeatureInPartInRawPart_Priority As EgtDataGridColumn
Public ReadOnly Property colFeatureInPartInRawPart_Priority As EgtDataGridColumn
Get
Return m_colFeatureInPartInRawPart_Priority
End Get
End Property
Private m_FeatureInPartInRawPartColumns As New ObservableCollection(Of EgtDataGridColumn)
Public Property FeatureInPartInRawPartColumns As ObservableCollection(Of EgtDataGridColumn)
Get
Return m_FeatureInPartInRawPartColumns
End Get
Set(value As ObservableCollection(Of EgtDataGridColumn))
m_FeatureInPartInRawPartColumns = value
End Set
End Property
Public Property bDOALL As Boolean?
Get
If Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart.FeatureVMList.Count = 0 Then Return False
Dim bTemp As Boolean = Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart.FeatureVMList(0).bDO
For FeatureIndex = 1 To Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart.FeatureVMList.Count - 1
If Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart.FeatureVMList(FeatureIndex).bDO <> bTemp Then Return Nothing
Next
Return bTemp
End Get
Set(value As Boolean?)
If Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart.FeatureVMList.Count = 0 Then
NotifyPropertyChanged(NameOf(bDOALL))
Return
End If
' imposto modalita' update multiplo
BTLFeatureVM.bDO_MultipleUpdate = True
For FeatureIndex = 0 To Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart.FeatureVMList.Count - 1
If FeatureIndex = Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart.FeatureVMList.Count - 1 Then
' reset modalita' update multiplo
BTLFeatureVM.bDO_MultipleUpdate = False
End If
Dim Feature As BTLFeatureVM = Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.SelPart.FeatureVMList(FeatureIndex)
Feature.bDO = value
Next
End Set
End Property
#Region "Messages"
Public ReadOnly Property Description_Msg As String
Get
Return EgtMsg(61603)
End Get
End Property
Public ReadOnly Property DO_Msg As String
Get
Return EgtMsg(61610)
End Get
End Property
Public ReadOnly Property Priority_Msg As String
Get
Return EgtMsg(61895)
End Get
End Property
#End Region ' Messages
Sub New()
' creo riferimento in Map
Map.SetRefFeatureInPartInRawPartListVM(Me)
' carico le colonne della datagrid
GetPrivateProfileColumns(S_FEATUREINPARTINRAWPARTLIST, FeatureInPartInRawPartColumns)
' recupero riferimento a colonna Do
m_colFeatureInPartInRawPart_Do = FeatureInPartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_DO)
m_colFeatureInPartInRawPart_Priority = FeatureInPartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_PRIORITY)
' Aggiorno check DOALL
NotifyPropertyChanged(NameOf(bDOALL))
End Sub
Friend Sub UpdateColumns(nMachType As MachineType)
If Not IsNothing(m_colFeatureInPartInRawPart_Priority) Then
m_colFeatureInPartInRawPart_Priority.Visible = (nMachType = MachineType.WALL AndAlso CurrentMachine.bIsEnabledPriority)
End If
End Sub
End Class