Imports System.ComponentModel.Composition
Imports Effector.Plugin.Interface
Imports Effector.Plugin.Lib

Public Class FiveLakesUIVM
   Inherits VMBase

   Public Enum Pages As Integer
      DOOR_LIST = 0
      MACHINE_STATUS = 1
      STATISTICS = 2
   End Enum

   Private m_sDataRoot As String
   Private m_sConfigDir As String
   Private m_sIniFile As String
   Private m_sResourcesRoot As String

   Private m_SelPage As Pages
   Public Property SelPage As Integer
      Get
         Return m_SelPage
      End Get
      Set(value As Integer)
         m_SelPage = value
      End Set
   End Property
   Friend Sub SetSelPage(nPage As Pages)
      m_SelPage = nPage
      NotifyPropertyChanged(NameOf(SelPage))
   End Sub

   Private m_TextTest As String
   Public ReadOnly Property TextTest As String
      Get
         Return m_TextTest
      End Get
   End Property
   Friend Sub SetTextTest(sValue As String)
      m_TextTest = sValue
      NotifyPropertyChanged(NameOf(TextTest))
   End Sub

   Sub New()
      ' Creo riferimento a questa classe in Map
      Map.BeginInit(Me)
      ' Impostazione path radice per i dati
      m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory
      If GetPrivateProfileString(S_DATA, K_DATAROOT, "", m_sDataRoot, m_sDataRoot & "\" & DAT_FILE_NAME) = 0 Then
         m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory
      End If
      m_sDataRoot &= "\" & "Plugin\Effector.Plugin.StoneCut"
      ' Impostazione direttorio di configurazione
      m_sConfigDir = m_sDataRoot & "\" & CONF_DIR
      ' Impostazione path Ini file
      PluginIniFile.SetIniFile(m_sConfigDir & "\" & INI_FILE_NAME)
      ' Impostazione path resources dir
      m_sResourcesRoot = m_sDataRoot & "\" & RES_DIR
   End Sub

End Class
