You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
3.7 KiB

Imports System.ComponentModel
Imports System.Deployment
Imports System.Deployment.Application
Public Class frmMain
Private _dataPath As String = System.IO.Path.Combine(My.Computer.FileSystem.SpecialDirectories.MyDocuments, "Gästeliste.xml")
Private _rowIndex As Integer = 0
Private Sub frmMain_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
Me.GästeDataSet.WriteXml(_dataPath)
End Sub
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
Me.GästeDataSet.ReadXml(_dataPath)
Catch ex As Exception
' do nothing, that file gets created when we close the application ;)
End Try
' Setting colors of grids to some fancy ones :)
Me.DataGridView1.RowsDefaultCellStyle.BackColor = Color.Azure
Me.DataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige
End Sub
Private Sub InfoToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles InfoToolStripMenuItem.Click
Dim oForm As New frmAbout()
oForm.ShowDialog()
oForm.Dispose()
oForm = Nothing
End Sub
Private Sub HilfePerEmailAnfordernToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles HilfePerEmailAnfordernToolStripMenuItem.Click
If MsgBox("Dies startet dein Emailprogramm, um mir eine Email zu schreiben", vbOKCancel) = vbOK Then
Process.Start("mailto:Dominic%20Reich%20<dominic@tmsn.at>?subject=[FEWO%20Gästeliste]%20Bitte%20um%20Hilfe&body=Hallo%20Dominic,%0Aich%20brauche%20Hilfe%20bei%20%0A%0A--%20%0AEmail%20über%20das%20Programm%20'Gästeliste'%20erstellt.")
End If
End Sub
Private Sub FehlerMeldenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles FehlerMeldenToolStripMenuItem.Click
If MsgBox("Dies öffnet deinen Browser und führt dich zur Github-Issues Seite." + Chr(13) + "Ein Github-Konto ist zwingend erforderlich!", vbOKCancel) = vbOK Then
Process.Start("https://github.com/freefallcid/Gaesteliste/issues")
End If
End Sub
Private Sub DataGridView1_CellMouseUp(sender As Object, e As DataGridViewCellMouseEventArgs) Handles DataGridView1.CellMouseUp
If e.Button = MouseButtons.Right Then
Me.DataGridView1.Rows(e.RowIndex).Selected = True
Me._rowIndex = e.RowIndex
Me.DataGridView1.CurrentCell = Me.DataGridView1.Rows(e.RowIndex).Cells(1)
Me.mnuContext.Show(Me.DataGridView1, e.Location)
mnuContext.Show(Cursor.Position)
End If
End Sub
Private Sub EintragLöschenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles EintragLöschenToolStripMenuItem.Click
If Not Me.DataGridView1.Rows(Me._rowIndex).IsNewRow Then
Me.DataGridView1.Rows.RemoveAt(Me._rowIndex)
End If
End Sub
Private Sub OnlineHilfeToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OnlineHilfeToolStripMenuItem.Click
Process.Start("http://tmsn.at/?tools&gaesteliste&hilfe")
End Sub
Private Sub UpdateToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles UpdateToolStripMenuItem.Click
Dim Info As UpdateCheckInfo
If ApplicationDeployment.IsNetworkDeployed Then
Dim AD As ApplicationDeployment = ApplicationDeployment.CurrentDeployment
Info = AD.CheckForDetailedUpdate
If Info.UpdateAvailable Then
If MsgBox("Ein Update ist verfügbar, willst du jetzt aktualisieren?", vbYesNo) = vbYes Then
AD.UpdateAsync()
End If
Else
MsgBox("Es ist kein Update verfügbar.")
End If
End If
End Sub
End Class