Imports System.Collections.ObjectModel Imports System.IO Imports EgtUILib Namespace EgtCAM5 Public Class MTableDbViewModel Inherits TabViewModel Private m_TablesList As New ObservableCollection(Of String) Public Property TablesList As ObservableCollection(Of String) Get Return m_TablesList End Get Set(value As ObservableCollection(Of String)) m_TablesList = value End Set End Property Private m_SelectedTable As String Public Property SelectedTable As String Get Return m_SelectedTable End Get Set(value As String) m_SelectedTable = value End Set End Property Private m_Title As String Public ReadOnly Property Title As String Get Return EgtMsg(MSG_MAINWINDOW + 20) End Get End Property Sub New() SearchTables() End Sub Private Sub SearchTables() ' Leggo dal file ini il direttorio per le Table If GetPrivateProfileString(S_TABLE, K_TABLESDIR, "", m_sTablesRoot) = 0 _ Or Not My.Computer.FileSystem.DirectoryExists(m_sTablesRoot) Then ' Se non lo trovo mando messaggio di errore e chiudo la finestra MessageBox.Show("ERROR IN LOADING TABLES", "Tables dir not found.") End If ' se trovo la cartella carico la lista di tabelle For Each Table In My.Computer.FileSystem.GetFiles(m_sTablesRoot) m_TablesList.Add(Path.GetFileNameWithoutExtension(Table)) Next End Sub End Class End Namespace