Imports System.Windows.Forms

Public Class DialogNovProj

    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.OK

        If (My.Computer.FileSystem.DirectoryExists("Projekti\" + TextBox1.Text)) Then
            MessageBox.Show("Projekt z tem imenom že obstaja!")
        Else
            My.Computer.FileSystem.CreateDirectory("Projekti\" + TextBox1.Text)
            FormGsiJobs.ListViewProj.Items.Add(TextBox1.Text).SubItems.Add("Projekti\" + TextBox1.Text)
            FormGsiJobs.ProjektiShraniNast()
        End If

        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub

End Class
