Files
EgtDOORCreator/ProjectManager/MySaveFileDialogVM.vb
T
Nicola Pievani 75bdbe6b15 EgtDOORcreator 2.1k1 :
-> aggiorno direttorio porte corrente (modalità progetto);
-> correzione comando "Duplica";
-> aggiunto nuovo profilo sul top della porta (Angle);
-> eliminazione progetti (configurabile);
-> configurare la modalità di funzionamento da OptionPage "SingleDoor"/"Project".
2019-11-13 14:20:58 +00:00

56 lines
1.9 KiB
VB.net

Imports System.ComponentModel
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Public Class MySaveFileDialogVM
Inherits EgtWPFLib5.SaveFileDialogVM
Public ReadOnly Property IsFrameMsg As String
Get
Return "Frame"
End Get
End Property
Private Property m_IsFrame As Boolean = False
Public Property IsFrame As Boolean
Get
Return m_IsFrame
End Get
Set(value As Boolean)
m_IsFrame = value
End Set
End Property
Friend Function MySave() As Boolean
If IsFolder And IsFrame Then
WriteFileName &= FRAME_FOLDER
End If
Dim sCompleteFileName As String = Directory & "\" & WriteFileName & If(IsFolder, "", Extension)
If String.IsNullOrWhiteSpace(WriteFileName) Then
MessageBox.Show(EgtMsg(MSG_EGTSAVEFILEDIALOG + 8), EgtMsg(MSG_EGTSAVEFILEDIALOG + 7), MessageBoxButton.OK, MessageBoxImage.Error)
Return False
End If
If IsFolder Then
If System.IO.Directory.Exists(sCompleteFileName) Then
If MessageBox.Show(FileName & " " & EgtMsg(MSG_EGTSAVEFILEDIALOG + 3) & vbCrLf & EgtMsg(MSG_EGTSAVEFILEDIALOG + 4), EgtMsg(MSG_EGTSAVEFILEDIALOG + 9), MessageBoxButton.YesNo, MessageBoxImage.Exclamation) <> MessageBoxResult.Yes Then
Return False
End If
End If
Else
If File.Exists(sCompleteFileName) Then
If MessageBox.Show(FileName & " " & EgtMsg(MSG_EGTSAVEFILEDIALOG + 3) & vbCrLf & EgtMsg(MSG_EGTSAVEFILEDIALOG + 4), EgtMsg(MSG_EGTSAVEFILEDIALOG + 9), MessageBoxButton.YesNo, MessageBoxImage.Exclamation) <> MessageBoxResult.Yes Then
Return False
End If
End If
End If
FileName = sCompleteFileName
Return True
End Function
Public Sub New()
MyBase.New()
End Sub
End Class