EgtDOORCreator 1.9g1 :

- ripristino della modalità assemblato
- aggiunta del campo properties nel ddf 
- semplificazione del codice in modalità porta singola/assemblato
This commit is contained in:
Nicola Pievani
2018-07-19 16:44:03 +00:00
parent 70c5223b97
commit eaee74096d
26 changed files with 3026 additions and 1833 deletions
+32 -30
View File
@@ -152,9 +152,6 @@ Public Class ProjectManagerVM
#Region "NewCommand"
''' <summary>
''' Returns a command that do New.
''' </summary>
Public ReadOnly Property NewCommand As ICommand
Get
If m_cmdNew Is Nothing Then
@@ -164,9 +161,6 @@ Public Class ProjectManagerVM
End Get
End Property
''' <summary>
''' Execute the New. This method is invoked by the NewCommand.
''' </summary>
Public Sub NewCmd()
' Gestisco porta corrente modificata
If Not Map.refAssemblyManagerVM.ManageModified() Then Return
@@ -179,6 +173,17 @@ Public Class ProjectManagerVM
Map.refAssemblyManagerVM.Open(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName)
Return
End If
' controllo che il direttorio non esista
Dim MsgResult As MessageBoxResult = MessageBoxResult.Yes
If Directory.Exists(SaveFileDialog.FileName) Then
MsgResult = MessageBox.Show("Directory " & SaveFileDialog.FileName & " already exists! Do you want to overwrite it?", "Caution", MessageBoxButton.YesNo, MessageBoxImage.Asterisk)
' cancello il direttorio
Directory.Delete(SaveFileDialog.FileName, True)
End If
If MsgResult = MessageBoxResult.No Then
Map.refAssemblyManagerVM.Open(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName)
Return
End If
' Creo nuovo progetto
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
Directory.CreateDirectory(SaveFileDialog.FileName)
@@ -200,9 +205,6 @@ Public Class ProjectManagerVM
#Region "OpenCommand"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public ReadOnly Property OpenCommand As ICommand
Get
If m_cmdOpen Is Nothing Then
@@ -293,9 +295,6 @@ Public Class ProjectManagerVM
#Region "OpenMruFileCommand"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public ReadOnly Property OpenMruFileCommand As ICommand
Get
If m_cmdOpenMruFile Is Nothing Then
@@ -305,9 +304,6 @@ Public Class ProjectManagerVM
End Get
End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Public Sub OpenMruFile(ByVal param As Object)
OpenProject(DirectCast(param, String).Replace("__", "_"))
End Sub
@@ -316,9 +312,6 @@ Public Class ProjectManagerVM
#Region "SaveCommand"
''' <summary>
''' Returns a command that do Save.
''' </summary>
Public ReadOnly Property SaveCommand As ICommand
Get
If m_cmdSave Is Nothing Then
@@ -328,9 +321,6 @@ Public Class ProjectManagerVM
End Get
End Property
''' <summary>
''' Execute the Save. This method is invoked by the SaveCommand.
''' </summary>
Public Sub Save()
' Verifico esista elemento selezionato
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
@@ -347,9 +337,6 @@ Public Class ProjectManagerVM
#Region "OptionsCommand"
''' <summary>
''' Returns a command that do Export.
''' </summary>
Public ReadOnly Property OptionsCommand As ICommand
Get
If m_cmdOptions Is Nothing Then
@@ -359,12 +346,9 @@ Public Class ProjectManagerVM
End Get
End Property
''' <summary>
''' Execute the Export. This method is invoked by the ExportCommand.
''' </summary>
Public Sub Options(ByVal param As Object)
Dim OptionsWindow As New OptionsV
OptionsWindow.Height = 550
OptionsWindow.Height = 650
OptionsWindow.Width = 650
OptionsWindow.DataContext = New OptionsVM()
OptionsWindow.Owner = Application.Current.MainWindow
@@ -621,6 +605,12 @@ Public Class ProjectManagerVM
End Property
Public Sub CopyDDF()
If IsNothing(Map.refAssemblyManagerVM.CurrProject) OrElse
IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
' 50192 = Impossible to export to machine a door if there is not a door!
MessageBox.Show(EgtMsg(50192), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
Return
End If
'Verifico che tutto sia salvato, altrimenti esco con messaggio
If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified() Then
' Project must be saved before copying
@@ -681,7 +671,13 @@ Public Class ProjectManagerVM
End Property
Public Sub Duplica()
If IsNothing(Map.refAssemblyManagerVM.CurrProject) Then Return
' questo test potrebbe essere sostituito con il controllo : If IsNothing(Map.refPartPageVM.CurrPart) Then Return
If IsNothing(Map.refAssemblyManagerVM.CurrProject) OrElse
IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
' 50191 = Impossible to copy a door if there is not a door!
MessageBox.Show(EgtMsg(50191), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
Return
End If
If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified() Then
' Project must be saved before copying
MessageBox.Show(EgtMsg(50186), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
@@ -800,7 +796,13 @@ Public Class ProjectManagerVM
End Property
Public Sub Print(ByVal param As Object)
If IsNothing(Map.refAssemblyManagerVM.CurrProject) Then Return
' questo test potrebbe essere sostituito con il controllo : If IsNothing(Map.refPartPageVM.CurrPart) Then Return
If IsNothing(Map.refAssemblyManagerVM.CurrProject) OrElse
IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
' 50193 = Impossible to print a door if there is not a door!
MessageBox.Show(EgtMsg(50193), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
Return
End If
If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified() Then
' Project must be saved before printing
MessageBox.Show(EgtMsg(50186), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)