EgtCAM5 :
- Cambiati nomi classi e file.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<UserControl x:Class="DoorPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<!--Barra superiore dei comandi-->
|
||||
<StackPanel Background="Transparent" Orientation="Horizontal">
|
||||
<Button Command="{Binding DoorsCommand}" Style="{StaticResource GridViewPanelButton}"
|
||||
Width="55" Content="DOORS" ContextMenuService.Placement="Bottom">
|
||||
<Button.ContextMenu>
|
||||
<ContextMenu ItemsSource="{Binding MruDoorNames}" ItemContainerStyle="{StaticResource MruDoorItem}">
|
||||
</ContextMenu>
|
||||
</Button.ContextMenu>
|
||||
</Button>
|
||||
<Button Command="{Binding DMachCommand}" Style="{StaticResource GridViewPanelButton}"
|
||||
Width="55" Content="DMACH"/>
|
||||
<Button Command="{Binding MTableDbCommand}"
|
||||
Style="{StaticResource GridViewPanelButton}" Width="65" Content="MTABLE"/>
|
||||
</StackPanel>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class DoorPanelV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,151 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
|
||||
Namespace EgtCAM5
|
||||
|
||||
Public Class DoorPanelVM
|
||||
Inherits ViewModelBase
|
||||
|
||||
Public ReadOnly Property MruDoorNames As ObservableCollection(Of String)
|
||||
Get
|
||||
Return IniFile.m_MruDoors.m_FileNames
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdDoors As ICommand
|
||||
Private m_cmdDMach As ICommand
|
||||
Private Shared m_cmdOpenMruDoor As ICommand
|
||||
Private m_cmdMTableDb As ICommand
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "DoorsCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Import.
|
||||
''' </summary>
|
||||
Public ReadOnly Property DoorsCommand As ICommand
|
||||
Get
|
||||
If m_cmdDoors Is Nothing Then
|
||||
m_cmdDoors = New RelayCommand(AddressOf Doors)
|
||||
End If
|
||||
Return m_cmdDoors
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Door. This method is invoked by the DoorsCommand.
|
||||
''' </summary>
|
||||
Public Sub Doors(ByVal param As Object)
|
||||
Application.Msn.NotifyColleagues(Application.DOORSSCRIPT, String.Empty)
|
||||
End Sub
|
||||
|
||||
#End Region ' DoorsCommand
|
||||
|
||||
#Region "OpenMruDoorCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Open.
|
||||
''' </summary>
|
||||
Public Shared ReadOnly Property OpenMruDoorCommand As ICommand
|
||||
Get
|
||||
If m_cmdOpenMruDoor Is Nothing Then
|
||||
m_cmdOpenMruDoor = New RelayCommand(AddressOf OpenMruDoor)
|
||||
End If
|
||||
Return m_cmdOpenMruDoor
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Public Shared Sub OpenMruDoor(ByVal param As Object)
|
||||
Application.Msn.NotifyColleagues(Application.DOORSSCRIPT, DirectCast(param, String).Replace("__", "_"))
|
||||
End Sub
|
||||
|
||||
#End Region ' OpenMruFileCommand
|
||||
|
||||
#Region "DMachCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Import.
|
||||
''' </summary>
|
||||
Public ReadOnly Property DMachCommand As ICommand
|
||||
Get
|
||||
If m_cmdDMach Is Nothing Then
|
||||
m_cmdDMach = New RelayCommand(AddressOf DMach)
|
||||
End If
|
||||
Return m_cmdDMach
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Dmach. This method is invoked by the DMachCommand.
|
||||
''' </summary>
|
||||
Public Sub DMach(ByVal param As Object)
|
||||
Application.Msn.NotifyColleagues(Application.DMACHSCRIPT)
|
||||
End Sub
|
||||
|
||||
#End Region ' DMachCommand
|
||||
|
||||
#Region "MTableDbCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property MTableDbCommand As ICommand
|
||||
Get
|
||||
If m_cmdMTableDb Is Nothing Then
|
||||
m_cmdMTableDb = New RelayCommand(AddressOf MTableDb)
|
||||
End If
|
||||
Return m_cmdMTableDb
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub MTableDb(ByVal param As Object)
|
||||
' Leggo dal file ini il direttorio delle MTable
|
||||
Dim sTablesDir As String = String.Empty
|
||||
If GetPrivateProfileString(S_DOORS, K_TABLESDIR, "", sTablesDir) = 0 Then
|
||||
' Se non lo trovo mando messaggio di errore e chiudo la finestra
|
||||
MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 4), EgtMsg(MSG_DOORSERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
IniFile.m_sTablesRoot = IniFile.m_sDoorsDirPath & "\" & sTablesDir
|
||||
' Verifico che la cartella indicata esista
|
||||
If Not My.Computer.FileSystem.DirectoryExists(IniFile.m_sTablesRoot) Then
|
||||
' Se non la trovo mando messaggio di errore e chiudo la finestra
|
||||
MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 5), EgtMsg(MSG_DOORSERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
' Verifico che ci sia il file ini per scrivere le tabelle
|
||||
If Not My.Computer.FileSystem.FileExists(IniFile.m_sTablesRoot & "\" & MTABLETEMPLATE_FILE) OrElse Not My.Computer.FileSystem.FileExists(IniFile.m_sTablesRoot & "\" & GEONAMELIST_FILE) _
|
||||
OrElse Not My.Computer.FileSystem.FileExists(IniFile.m_sTablesRoot & "\" & OPERATIONLIST_FILE) Then
|
||||
' Se non la trovo mando messaggio di errore e chiudo la finestra
|
||||
MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 6), EgtMsg(MSG_DOORSERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
' verifico
|
||||
If Not EgtVerifyMachinesDir() Then Return
|
||||
|
||||
Dim MTableDb As New MTableDbV(Application.Current.MainWindow, New MTableDbVM)
|
||||
MTableDb.ShowDialog()
|
||||
|
||||
'Dim MTableDbWindow As New MTableDbView
|
||||
'MTableDbWindow.Height = 614
|
||||
'MTableDbWindow.Width = 1024
|
||||
'MTableDbWindow.DataContext = New MTableDbViewModel
|
||||
'MTableDbWindow.Owner = Application.Current.MainWindow
|
||||
'MTableDbWindow.ShowDialog()
|
||||
End Sub
|
||||
|
||||
#End Region ' MTableDbCommand
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
Reference in New Issue
Block a user