EgtDOORCreator 1.8l3 :
- copia dei file di un progetto nel direttorio della macchina (configurabili nel file da OptionPage); - salvataggio delle modifiche dei parametri delle componenti già esistenti (RunAs=0);
This commit is contained in:
@@ -25,6 +25,7 @@ Public Class ProjectManagerVM
|
||||
Private m_cmdSendFeedback As ICommand
|
||||
Private m_CmdCreateTemplate As ICommand
|
||||
Private m_cmdGuide As ICommand
|
||||
Private m_cmdCopy As ICommand
|
||||
|
||||
#Region "ToolTip"
|
||||
|
||||
@@ -87,6 +88,19 @@ Public Class ProjectManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CopyToolTip As String
|
||||
Get
|
||||
Return "Copy"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Copy As String
|
||||
Get
|
||||
Return "Copy"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
#End Region ' ToolTip
|
||||
|
||||
#End Region ' Fields & Properties
|
||||
@@ -519,6 +533,65 @@ Public Class ProjectManagerVM
|
||||
|
||||
#End Region ' Guide
|
||||
|
||||
#Region "Copy"
|
||||
|
||||
Public ReadOnly Property CopyCommand As ICommand
|
||||
Get
|
||||
If m_cmdCopy Is Nothing Then
|
||||
m_cmdCopy = New Command(AddressOf CopyDDF)
|
||||
End If
|
||||
Return m_cmdCopy
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub CopyDDF()
|
||||
Dim Result = MessageBox.Show("Do yuo want to copy all files? (yes). Do you want to copy the current file? (no)", "?", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
|
||||
Dim CurrProjetc As String = Map.refAssemblyManagerVM.CurrProject.Name
|
||||
Dim MachinProject As String = IniFile.m_MachinProject
|
||||
Dim CurrFile As String = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name
|
||||
Dim MachinFile As String = String.Empty
|
||||
If String.IsNullOrEmpty(MachinProject) Then
|
||||
MessageBox.Show("Machin Directory not found", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
Select Case Result
|
||||
Case MessageBoxResult.Yes
|
||||
For IndexFile As Integer = 0 To Map.refAssemblyManagerVM.CurrProject.AssemblyList.Count - 1
|
||||
' controllo che abbia estenzione ddf
|
||||
If Path.GetExtension(Map.refAssemblyManagerVM.CurrProject.AssemblyList(IndexFile).Name) = ".ddf" Then
|
||||
If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName.Contains("*") Then
|
||||
Dim Length As Integer = Map.refAssemblyManagerVM.CurrProject.AssemblyList(IndexFile).GraphicName.Length - 1
|
||||
Dim FileName As String = Map.refAssemblyManagerVM.CurrProject.AssemblyList(IndexFile).GraphicName.Remove(Length)
|
||||
MachinFile = MachinProject & "/" & FileName & ".ddf"
|
||||
Else
|
||||
MachinFile = MachinProject & "/" & Map.refAssemblyManagerVM.CurrProject.AssemblyList(IndexFile).GraphicName & ".ddf"
|
||||
End If
|
||||
Try
|
||||
File.Copy(CurrFile, MachinFile, True)
|
||||
Catch ex As System.IO.IOException
|
||||
MessageBox.Show("Error in copying: " & ex.Message)
|
||||
End Try
|
||||
End If
|
||||
Next
|
||||
Case MessageBoxResult.No
|
||||
Try
|
||||
If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName.Contains("*") Then
|
||||
Dim Length As Integer = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName.Length - 1
|
||||
Dim FileName As String = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName.Remove(Length)
|
||||
MachinFile = MachinProject & "/" & FileName & ".ddf"
|
||||
Else
|
||||
MachinFile = MachinProject & "/" & Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName & ".ddf"
|
||||
End If
|
||||
File.Copy(CurrFile, MachinFile, True)
|
||||
Catch ex As System.IO.IOException
|
||||
MessageBox.Show("Error in copying: " & ex.Message)
|
||||
End Try
|
||||
Case Else
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
#End Region ' Copy
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
Reference in New Issue
Block a user