Imports System.Collections.ObjectModel
Imports EgtBEAMWALL.Core
Imports EgtUILib

Public Class FeatureInPartInRawPartListVM

   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

#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)
   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
