Files
EgtDOORCreator/ProjectManager/MySaveFileDialogVM.vb
T
Nicola Pievani e65a72681b EgtDOORCreator 2.2e1:
-> correzione gestione creazione cartelle ".frame"
-> correzione lettura visibilità dei parametri delle componenti sui frame.
2020-05-06 13:25:44 +00:00

66 lines
2.2 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
Public ReadOnly Property VisibilityCreateFrameDir As Visibility
Get
If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then
Return Visibility.Collapsed
Else
Return Visibility.Visible
End If
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