Files
EgtDOORCreator/HardwareManager/HardwarePageVM.vb
T
Nicola Pievani 6a36a13211 EgtDOORCreator 1.9b6 :
- correzione dell'errore nel caricamento dei parametri,
- inserimento  di costanti.
2018-02-22 17:11:03 +00:00

143 lines
3.9 KiB
VB.net

Imports System.Collections.ObjectModel
Imports System.ComponentModel
Imports System.IO
Imports EgtUILib
Imports System.Text.RegularExpressions
Imports EgtWPFLib5
Public Class HardwarePageVM
Inherits VMBase
Private m_Door As Part
Public Property Door As Part
Get
Return m_Door
End Get
Set(value As Part)
m_Door = value
NotifyPropertyChanged("Door")
End Set
End Property
Private m_CurrHardware As Hardware
Public Property CurrHardware As Hardware
Get
Return m_CurrHardware
End Get
Set(value As Hardware)
m_CurrHardware = value
NotifyPropertyChanged("CurrHardware")
End Set
End Property
' l'elenco dei bottoni
Private m_CompoPanelPart As ContentControl
Public Property CompoPanelControl As ContentControl
Get
Return m_CompoPanelPart
End Get
Set(value As ContentControl)
m_CompoPanelPart = value
End Set
End Property
' mostra la visibilità del general della pagina
Private m_VisibilityGeneral As Visibility = Visibility.Collapsed
Public Property VisibilityGeneral As Visibility
Get
Return m_VisibilityGeneral
End Get
Set(value As Visibility)
m_VisibilityGeneral = value
NotifyPropertyChanged("VisibilityGeneral")
End Set
End Property
#Region "MESSAGES"
Public ReadOnly Property GeneralMsg As String
Get
Return "General"
End Get
End Property
Public ReadOnly Property TemplateMsg As String
Get
Return "Template"
End Get
End Property
Public ReadOnly Property TypeMsg As String
Get
Return "Type"
End Get
End Property
Public ReadOnly Property BrandMsg As String
Get
Return "Brand"
End Get
End Property
#End Region ' Messages
' definizione comando
Private m_EnterRefreshCmd As ICommand
Private m_F1GuideCmd As ICommand
#Region "COMMANDS"
Public ReadOnly Property RefreshCmd As ICommand
Get
If m_EnterRefreshCmd Is Nothing Then
m_EnterRefreshCmd = New Command(AddressOf EnterRefresh)
End If
Return m_EnterRefreshCmd
End Get
End Property
Public Sub EnterRefresh()
Map.refSceneManagerVM.RefreshBtn()
End Sub
' Comando Guida
Public ReadOnly Property GuideCmd As ICommand
Get
If m_F1GuideCmd Is Nothing Then
m_F1GuideCmd = New Command(AddressOf F1Guide)
End If
Return m_F1GuideCmd
End Get
End Property
Public Sub F1Guide()
Dim rfGuideVM As New GuideVM
If String.IsNullOrEmpty(GuideVM.m_AddressGuide) Then
GuideVM.m_AddressGuide = GUIDE_FILE
End If
Map.refProjectManagerVM.Guide()
End Sub
#End Region ' Command
Public Function CreateDoor() As Boolean
Dim Hardware As String = String.Empty
' questa stringa serve solo per costruire un overload della sub New!
Dim ref_Door As New Part(Hardware)
Door = ref_Door
Dim sTempFile As String = IniFile.m_sTempDir & "\" & TEMP_FILE
DdfFile.WriteDDFPartForTestHardware(Door, sTempFile, False, False)
ExecDoors(Map.refSceneManagerVM.ProjectScene, sTempFile)
Return True
End Function
Sub New()
Map.SetRefHardwarePageVM(Me)
' se non esiste la lista dei componenti per l'HardwareManager viene creata nuova
If IsNothing(Map.refCompoPanelHardwareVM) Then Map.SetRefCompoPaneHardwarelVM(New CompoPanelVM("HardwarePage"))
' se il ContentControl è vuoto allora viene creato nuovo
If IsNothing(m_CompoPanelPart) Then m_CompoPanelPart = New CompoPanelHardwareV
m_CompoPanelPart.DataContext = Map.refCompoPanelHardwareVM
End Sub
End Class