Files
Emmanuele Sassi 75d05a8b31 - create tray top, bottom, left e right
- gestiti panel con Visibility
- gestiti elementi grafici in ProjectV con ItemsControl
- eliminato pannello Printing3d
- aggiunta gestione Plugin
- verifica bit per Plugin
2023-11-03 11:20:13 +01:00

214 lines
6.1 KiB
VB.net

Imports System.Collections.ObjectModel
Imports EgtUILib
Public Class GunStockPanelVM
Inherits ViewModelBase
Public ReadOnly Property MruNewGunStockNames As ObservableCollection(Of String)
Get
Return IniFile.m_MruNewGunStock.m_FileNames
End Get
End Property
Public ReadOnly Property MruModifyGunStockNames As ObservableCollection(Of String)
Get
Return IniFile.m_MruModifyGunStock.m_FileNames
End Get
End Property
Public ReadOnly Property CopyGunStock_Visibility As Visibility
Get
Dim sFunction As String = String.Empty
GetPrivateProfileString(S_GUNSTOCK, K_COPYFUNCTION, "", sFunction)
Return If(String.IsNullOrWhiteSpace(sFunction), Visibility.Collapsed, Visibility.Visible)
End Get
End Property
Private m_GunStockPanel_Visibility As Visibility
Public ReadOnly Property GunStockPanel_Visibility As Visibility
Get
Return m_GunStockPanel_Visibility
End Get
End Property
Friend Sub SetGunStockPanelVisibility(bValue As Boolean)
m_GunStockPanel_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
OnPropertyChanged(NameOf(GunStockPanel_Visibility))
End Sub
#Region "Messages"
Public ReadOnly Property NewGunStockMsg As String
Get
Return EgtMsg(8201)
End Get
End Property
Public ReadOnly Property ModifyGunStockMsg As String
Get
Return EgtMsg(8203)
End Get
End Property
Public ReadOnly Property CopyGunStockMsg As String
Get
Return EgtMsg(8214)
End Get
End Property
#End Region ' Messages
#Region "ToolTip"
Public ReadOnly Property NewGunStockToolTip As String
Get
Return EgtMsg(8202)
End Get
End Property
Public ReadOnly Property ModifyGunStockToolTip As String
Get
Return EgtMsg(8204)
End Get
End Property
Public ReadOnly Property CopyGunStockToolTip As String
Get
Return EgtMsg(8215)
End Get
End Property
#End Region ' ToolTip
' Definizione comandi
Private m_cmdNewGunStock As ICommand
Private m_cmdModifyGunStock As ICommand
Private m_cmdCopyGunStock As ICommand
Private Shared m_cmdOpenMruNewGunStock As ICommand
Private Shared m_cmdOpenMruModifyGunStock As ICommand
Sub New()
' Creo riferimento a questa classe in Map
Map.SetRefGunStockPanelVM(Me)
End Sub
#Region "COMMANDS"
#Region "NewGunStockCommand"
''' <summary>
''' Returns a command that do Import.
''' </summary>
Public ReadOnly Property NewGunStockCommand As ICommand
Get
If m_cmdNewGunStock Is Nothing Then
m_cmdNewGunStock = New RelayCommand(AddressOf NewGunStock)
End If
Return m_cmdNewGunStock
End Get
End Property
''' <summary>
''' Execute the Door. This method is invoked by the DoorsCommand.
''' </summary>
Public Sub NewGunStock(ByVal param As Object)
Map.refProjectVM.GunStockNew(String.Empty)
End Sub
#End Region ' NewGunStockCommand
#Region "ModifyGunStockCommand"
''' <summary>
''' Returns a command that do Import.
''' </summary>
Public ReadOnly Property ModifyGunStockCommand As ICommand
Get
If m_cmdModifyGunStock Is Nothing Then
m_cmdModifyGunStock = New RelayCommand(AddressOf ModifyGunStock)
End If
Return m_cmdModifyGunStock
End Get
End Property
''' <summary>
''' Execute the Door. This method is invoked by the DoorsCommand.
''' </summary>
Public Sub ModifyGunStock(ByVal param As Object)
Map.refProjectVM.GunStockModif(String.Empty)
End Sub
#End Region ' ModifyGunStockCommand
#Region "CopyGunStockCommand"
''' <summary>
''' Returns a command that Copy Part Program files.
''' </summary>
Public ReadOnly Property CopyGunStockCommand As ICommand
Get
If m_cmdCopyGunStock Is Nothing Then
m_cmdCopyGunStock = New RelayCommand(AddressOf CopyGunStock)
End If
Return m_cmdCopyGunStock
End Get
End Property
''' <summary>
''' Copy Part Program files. This method is invoked by the CopyGunStockCommand.
''' </summary>
Public Sub CopyGunStock(ByVal param As Object)
Dim sFilePath As String = ""
IniFile.m_MruModifyGunStock.GetFileName(0, sFilePath)
Dim sDirDest As String = ""
GetPrivateProfileString(S_GUNSTOCK, K_COPYDIR, "", sDirDest)
Map.refProjectVM.GunStockCopy(sFilePath, sDirDest)
End Sub
#End Region ' CopyGunStockCommand
#Region "OpenMruNewGunStockCommand"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public Shared ReadOnly Property OpenMruNewGunStockCommand As ICommand
Get
If m_cmdOpenMruNewGunStock Is Nothing Then
m_cmdOpenMruNewGunStock = New RelayCommand(AddressOf OpenMruNewGunStock)
End If
Return m_cmdOpenMruNewGunStock
End Get
End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Public Shared Sub OpenMruNewGunStock(ByVal param As Object)
Map.refProjectVM.GunStockNew(DirectCast(param, String).Replace("__", "_"))
End Sub
#End Region ' OpenMruNewGunStockCommand
#Region "OpenMruModifyGunStockCommand"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public Shared ReadOnly Property OpenMruModifyGunStockCommand As ICommand
Get
If m_cmdOpenMruModifyGunStock Is Nothing Then
m_cmdOpenMruModifyGunStock = New RelayCommand(AddressOf OpenMruModifyGunStock)
End If
Return m_cmdOpenMruModifyGunStock
End Get
End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Public Shared Sub OpenMruModifyGunStock(ByVal param As Object)
Map.refProjectVM.GunStockModif(DirectCast(param, String).Replace("__", "_"))
End Sub
#End Region ' OpenMruNewGunStockCommand
#End Region
End Class