Files
OmagCUT/SaveNameWD.xaml.vb
T
Dario Sassi a8cd99ebb4 OmagCUT 1.6o3 :
- aggiunta gestione cornici (per ora solo disegno)
- migliorie varie.
2016-03-29 09:10:43 +00:00

44 lines
1.6 KiB
VB.net

Imports System.IO
Imports EgtUILib
Imports EgtWPFLib
Public Class SaveNameWD
' Riferimento alla MainWindow
Private m_MainWindow As MainWindow = Application.Current.MainWindow
Sub New(Owner As Window)
Me.Owner = Owner
InitializeComponent()
End Sub
Private Sub SaveNameWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
SaveNameTxbl.Text = EgtMsg(MSG_CADCUTPAGEUC + 7) 'Nuovo nome del progetto
GetPrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, "", SaveNameTxBx.Text, m_MainWindow.GetIniFile())
End Sub
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
' Creo path completa con nome inserito
Dim sPath As String = m_MainWindow.GetSaveNameDir() & "\" & SaveNameTxBx.Text & ".nge"
' Verifico se il nome inserito è già utilizzato
If File.Exists(sPath) Then
Dim ConfirmWD As New EgtMsgBox(m_MainWindow, "", EgtMsg(MSG_EGTMSGBOX + 6), EgtMsgBox.Buttons.OK_CANCEL, EgtMsgBox.Icons.NULL)
Select Case ConfirmWD.DialogResult
Case 0 'Cancel
' Esco
Return
End Select
End If
' Aggiorno file Ini
WritePrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, SaveNameTxBx.Text, m_MainWindow.GetIniFile())
' Eseguo salvataggio
m_MainWindow.m_CurrentProjectPageUC.SaveNamedProject()
m_MainWindow.m_CurrentProjectPageUC.SaveProject()
EgtDraw()
Close()
End Sub
End Class