27 Commits

Author SHA1 Message Date
Michael J. Seiferling
b86206a7a2 v0.94 Final commit 2015-12-01 00:00:16 -06:00
Michael J. Seiferling
1b47b6aa15 Fixed another form border style 2015-11-27 17:08:45 -06:00
Michael J. Seiferling
27f03cbd35 Fixed missed field change 2015-11-24 14:26:31 -06:00
Michael J. Seiferling
254bcbbab5 Changed data managers to use field names 2015-11-24 14:20:07 -06:00
Michael J. Seiferling
2617852d77 Fixed exporting wrong field 2015-11-24 11:51:10 -06:00
Michael J. Seiferling
ca7cc7824a Update README.md 2015-11-18 00:09:50 -06:00
Michael J. Seiferling
91f423d7ae Better import/export path fix 2015-11-17 13:45:56 -06:00
Michael J. Seiferling
2744aa7cbc v0.94 pre-release import hot fix 2015-11-17 11:33:23 -06:00
Michael J. Seiferling
aba6ed1462 v0.94 pre-release final commit 2015-11-17 11:08:03 -06:00
Michael J. Seiferling
0ba1323fb2 Empty filter fix 2015-11-16 14:21:12 -06:00
Michael J. Seiferling
c05ef0f32f Added more filter options 2015-11-16 13:35:10 -06:00
Michael J. Seiferling
a8cda1d5f8 Changed some sync logic 2015-11-16 11:16:35 -06:00
Michael J. Seiferling
049878202a Fixed border style on new forms 2015-11-14 22:53:58 -06:00
Michael J. Seiferling
0a3bb9a58f Added filtering by tags 2015-11-14 20:39:48 -06:00
Michael J. Seiferling
040d6c4bf3 Fixed Sync ID issue 2015-11-14 15:55:05 -06:00
Michael J. Seiferling
e13b6cd58b Added missing form resx 2015-11-14 14:30:50 -06:00
Michael J. Seiferling
7c1698388a Sync Overhaul (Tag Support and Efficiency) 2015-11-14 14:09:29 -06:00
Michael J. Seiferling
ebf5fb5f4d Rewrote import / export 2015-11-14 01:14:44 -06:00
Michael J. Seiferling
5357fb214d Add tagging support for games 2015-11-13 17:59:27 -06:00
Michael J. Seiferling
5e5da3c068 Reworked notifications 2015-11-12 19:46:31 -06:00
Michael J. Seiferling
3743e71288 v0.94 bug fixes and feature additions 2015-11-12 16:28:00 -06:00
Michael J. Seiferling
0c3f3fd5f4 Merge branch 'master' of https://github.com/MikeMaximus/gbm.git 2015-11-11 20:16:06 -06:00
Michael J. Seiferling
2e63862493 Updates for the GitHub move 2015-11-11 20:16:00 -06:00
Michael J. Seiferling
c7a279e11a Update README.md 2015-11-11 17:26:03 -06:00
MikeMaximus
90b1194cc5 Update README.md 2015-11-09 12:47:36 -06:00
MikeMaximus
d489738d08 Update README.md 2015-11-09 12:41:05 -06:00
MikeMaximus
0fc6ce772b Update README.md 2015-11-09 12:37:31 -06:00
36 changed files with 3083 additions and 415 deletions
+83
View File
@@ -0,0 +1,83 @@
Public Class Game
Private sGameName As String
Private sProcessName As String
Private sPath As String
Private bAbsolutePath As Boolean
Private bFolderSave As Boolean
Private sFileType As String
Private sExcludeList As String
Private oTags As List(Of Tag)
Property Name As String
Set(value As String)
sGameName = value
End Set
Get
Return sGameName
End Get
End Property
Property ProcessName As String
Set(value As String)
sProcessName = value
End Set
Get
Return sProcessName
End Get
End Property
Property Path As String
Set(value As String)
sPath = value
End Set
Get
Return sPath
End Get
End Property
Property AbsolutePath As Boolean
Set(value As Boolean)
bAbsolutePath = value
End Set
Get
Return bAbsolutePath
End Get
End Property
Property FolderSave As Boolean
Set(value As Boolean)
bFolderSave = value
End Set
Get
Return bFolderSave
End Get
End Property
Property FileType As String
Set(value As String)
sFileType = value
End Set
Get
Return sFileType
End Get
End Property
Property ExcludeList As String
Set(value As String)
sExcludeList = value
End Set
Get
Return sExcludeList
End Get
End Property
Property Tags As List(Of Tag)
Get
Return oTags
End Get
Set(value As List(Of Tag))
oTags = value
End Set
End Property
End Class
+13
View File
@@ -0,0 +1,13 @@
Public Class Tag
Private sTagName As String
Property Name As String
Get
Return sTagName
End Get
Set(value As String)
sTagName = value
End Set
End Property
End Class
+41 -15
View File
@@ -18,6 +18,7 @@
Private bDuplicate As Boolean = False
Private sDOSBoxProcess As String = String.Empty
Private bTempGame As Boolean = False
Private oImportTags As New List(Of Tag)
Property ID As String
Set(value As String)
@@ -156,40 +157,40 @@
End Set
End Property
Property Enabled As Boolean
Set(value As Boolean)
bEnabled = value
End Set
Property Enabled As Boolean
Get
Return bEnabled
End Get
Set(value As Boolean)
bEnabled = value
End Set
End Property
Property MonitorOnly As Boolean
Set(value As Boolean)
bMonitorOnly = value
End Set
Property MonitorOnly As Boolean
Get
Return bMonitorOnly
End Get
Set(value As Boolean)
bMonitorOnly = value
End Set
End Property
Property Duplicate As Boolean
Set(value As Boolean)
bDuplicate = value
End Set
Get
Return bDuplicate
End Get
Set(value As Boolean)
bDuplicate = value
End Set
End Property
Property DOSBoxProcess As String
Set(value As String)
sDOSBoxProcess = value
End Set
Property DOSBoxProcess As String
Get
Return sDOSBoxProcess
End Get
Set(value As String)
sDOSBoxProcess = value
End Set
End Property
ReadOnly Property TruePath As String
@@ -213,11 +214,24 @@
End Set
End Property
Property ImportTags As List(Of Tag)
Get
Return oImportTags
End Get
Set(value As List(Of Tag))
oImportTags = value
End Set
End Property
Public Function SyncEquals(obj As Object) As Boolean
Dim oGame As clsGame = TryCast(obj, clsGame)
If oGame Is Nothing Then
Return False
Else
If ID <> oGame.ID Then
Return False
End If
If Name <> oGame.Name Then
Return False
End If
@@ -264,6 +278,18 @@
End If
End Function
Public Function MinimalEquals(obj As Object) As Boolean
Dim oGame As clsGame = TryCast(obj, clsGame)
If oGame Is Nothing Then
Return False
Else
If ID <> oGame.ID Then
Return False
End If
Return True
End If
End Function
Public Function ShallowCopy() As clsGame
Return DirectCast(Me.MemberwiseClone(), clsGame)
End Function
+38
View File
@@ -0,0 +1,38 @@
Public Class clsGameTag
Private sTagID As String = String.Empty
Private sMonitorID As String = String.Empty
Property TagID As String
Get
Return sTagID
End Get
Set(value As String)
sTagID = value
End Set
End Property
Property MonitorID As String
Get
Return sMonitorID
End Get
Set(value As String)
sMonitorID = value
End Set
End Property
Public Function CoreEquals(obj As Object) As Boolean
Dim oGameTag As clsGameTag = TryCast(obj, clsGameTag)
If oGameTag Is Nothing Then
Return False
Else
If TagID <> oGameTag.TagID Then
Return False
End If
If MonitorID <> oGameTag.MonitorID Then
Return False
End If
Return True
End If
End Function
End Class
+50
View File
@@ -0,0 +1,50 @@
Public Class clsTag
Private sTagID As String = Guid.NewGuid.ToString
Private sTagName As String = String.Empty
Property ID As String
Get
Return sTagID
End Get
Set(value As String)
sTagID = value
End Set
End Property
Property Name As String
Get
Return sTagName
End Get
Set(value As String)
sTagName = value
End Set
End Property
Public Function CoreEquals(obj As Object) As Boolean
Dim oTag As clsTag = TryCast(obj, clsTag)
If oTag Is Nothing Then
Return False
Else
If ID <> oTag.ID Then
Return False
End If
If Name <> oTag.Name Then
Return False
End If
Return True
End If
End Function
Public Function MinimalEquals(obj As Object) As Boolean
Dim oTag As clsTag = TryCast(obj, clsTag)
If oTag Is Nothing Then
Return False
Else
If ID <> oTag.ID Then
Return False
End If
Return True
End If
End Function
End Class
+1
View File
@@ -96,6 +96,7 @@ Partial Class frmAdvancedImport
Me.Controls.Add(Me.btnImport)
Me.Controls.Add(Me.lstGames)
Me.Controls.Add(Me.lblGames)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frmAdvancedImport"
+171
View File
@@ -0,0 +1,171 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmFilter
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.btnOK = New System.Windows.Forms.Button()
Me.lblGameTags = New System.Windows.Forms.Label()
Me.lblTags = New System.Windows.Forms.Label()
Me.btnRemove = New System.Windows.Forms.Button()
Me.btnAdd = New System.Windows.Forms.Button()
Me.lstFilter = New System.Windows.Forms.ListBox()
Me.lstTags = New System.Windows.Forms.ListBox()
Me.GroupBox1 = New System.Windows.Forms.GroupBox()
Me.optAll = New System.Windows.Forms.RadioButton()
Me.optAny = New System.Windows.Forms.RadioButton()
Me.GroupBox1.SuspendLayout()
Me.SuspendLayout()
'
'btnOK
'
Me.btnOK.Location = New System.Drawing.Point(297, 229)
Me.btnOK.Name = "btnOK"
Me.btnOK.Size = New System.Drawing.Size(75, 23)
Me.btnOK.TabIndex = 7
Me.btnOK.Text = "&OK"
Me.btnOK.UseVisualStyleBackColor = True
'
'lblGameTags
'
Me.lblGameTags.AutoSize = True
Me.lblGameTags.Location = New System.Drawing.Point(263, 8)
Me.lblGameTags.Name = "lblGameTags"
Me.lblGameTags.Size = New System.Drawing.Size(66, 13)
Me.lblGameTags.TabIndex = 5
Me.lblGameTags.Text = "Current Filter"
'
'lblTags
'
Me.lblTags.AutoSize = True
Me.lblTags.Location = New System.Drawing.Point(49, 8)
Me.lblTags.Name = "lblTags"
Me.lblTags.Size = New System.Drawing.Size(77, 13)
Me.lblTags.TabIndex = 0
Me.lblTags.Text = "Available Tags"
'
'btnRemove
'
Me.btnRemove.Location = New System.Drawing.Point(168, 114)
Me.btnRemove.Name = "btnRemove"
Me.btnRemove.Size = New System.Drawing.Size(48, 23)
Me.btnRemove.TabIndex = 4
Me.btnRemove.Text = "< <"
Me.btnRemove.UseVisualStyleBackColor = True
'
'btnAdd
'
Me.btnAdd.Location = New System.Drawing.Point(168, 85)
Me.btnAdd.Name = "btnAdd"
Me.btnAdd.Size = New System.Drawing.Size(48, 23)
Me.btnAdd.TabIndex = 3
Me.btnAdd.Text = "> >"
Me.btnAdd.UseVisualStyleBackColor = True
'
'lstFilter
'
Me.lstFilter.FormattingEnabled = True
Me.lstFilter.Location = New System.Drawing.Point(222, 24)
Me.lstFilter.Name = "lstFilter"
Me.lstFilter.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended
Me.lstFilter.Size = New System.Drawing.Size(150, 173)
Me.lstFilter.TabIndex = 6
'
'lstTags
'
Me.lstTags.FormattingEnabled = True
Me.lstTags.Location = New System.Drawing.Point(12, 24)
Me.lstTags.Name = "lstTags"
Me.lstTags.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended
Me.lstTags.Size = New System.Drawing.Size(150, 173)
Me.lstTags.TabIndex = 1
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.optAll)
Me.GroupBox1.Controls.Add(Me.optAny)
Me.GroupBox1.Location = New System.Drawing.Point(12, 206)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(150, 46)
Me.GroupBox1.TabIndex = 2
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "Matching Options"
'
'optAll
'
Me.optAll.AutoSize = True
Me.optAll.Location = New System.Drawing.Point(77, 19)
Me.optAll.Name = "optAll"
Me.optAll.Size = New System.Drawing.Size(63, 17)
Me.optAll.TabIndex = 1
Me.optAll.TabStop = True
Me.optAll.Text = "All Tags"
Me.optAll.UseVisualStyleBackColor = True
'
'optAny
'
Me.optAny.AutoSize = True
Me.optAny.Checked = True
Me.optAny.Location = New System.Drawing.Point(6, 19)
Me.optAny.Name = "optAny"
Me.optAny.Size = New System.Drawing.Size(65, 17)
Me.optAny.TabIndex = 0
Me.optAny.TabStop = True
Me.optAny.Text = "Any Tag"
Me.optAny.UseVisualStyleBackColor = True
'
'frmFilter
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(384, 261)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.btnOK)
Me.Controls.Add(Me.lblGameTags)
Me.Controls.Add(Me.lblTags)
Me.Controls.Add(Me.btnRemove)
Me.Controls.Add(Me.btnAdd)
Me.Controls.Add(Me.lstFilter)
Me.Controls.Add(Me.lstTags)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frmFilter"
Me.ShowIcon = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Filter by Tags"
Me.GroupBox1.ResumeLayout(False)
Me.GroupBox1.PerformLayout()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents btnOK As System.Windows.Forms.Button
Friend WithEvents lblGameTags As System.Windows.Forms.Label
Friend WithEvents lblTags As System.Windows.Forms.Label
Friend WithEvents btnRemove As System.Windows.Forms.Button
Friend WithEvents btnAdd As System.Windows.Forms.Button
Friend WithEvents lstFilter As System.Windows.Forms.ListBox
Friend WithEvents lstTags As System.Windows.Forms.ListBox
Friend WithEvents GroupBox1 As GroupBox
Friend WithEvents optAll As RadioButton
Friend WithEvents optAny As RadioButton
End Class
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+137
View File
@@ -0,0 +1,137 @@
Public Class frmFilter
Public Enum eFilterType As Integer
Any = 1
All = 2
End Enum
Dim oFilters As New List(Of clsTag)
Dim eCurrentFilterType As eFilterType = eFilterType.Any
Dim hshTags As New Hashtable
Dim bShutdown As Boolean = False
Public ReadOnly Property Filters As List(Of clsTag)
Get
Return oFilters
End Get
End Property
Public ReadOnly Property FilterType As eFilterType
Get
Return eCurrentFilterType
End Get
End Property
Private Sub AddTag()
Dim oData As KeyValuePair(Of String, String)
Dim oTags As List(Of KeyValuePair(Of String, String))
If lstTags.SelectedItems.Count = 1 Then
oData = lstTags.SelectedItems(0)
lstFilter.Items.Add(oData)
lstTags.Items.Remove(oData)
ElseIf lstTags.SelectedItems.Count > 1 Then
oTags = New List(Of KeyValuePair(Of String, String))
For Each oData In lstTags.SelectedItems
oTags.Add(oData)
Next
For Each kp As KeyValuePair(Of String, String) In oTags
lstFilter.Items.Add(kp)
lstTags.Items.Remove(kp)
Next
End If
End Sub
Private Sub RemoveTag()
Dim oData As KeyValuePair(Of String, String)
Dim oTags As List(Of KeyValuePair(Of String, String))
If lstFilter.SelectedItems.Count = 1 Then
oData = lstFilter.SelectedItems(0)
lstFilter.Items.Remove(oData)
lstTags.Items.Add(oData)
ElseIf lstFilter.SelectedItems.Count > 1 Then
oTags = New List(Of KeyValuePair(Of String, String))
For Each oData In lstFilter.SelectedItems
oTags.Add(oData)
Next
For Each kp As KeyValuePair(Of String, String) In oTags
lstFilter.Items.Remove(kp)
lstTags.Items.Add(kp)
Next
End If
End Sub
Private Sub LoadData()
Dim oTag As clsTag
Dim oData As KeyValuePair(Of String, String)
'Handle Data
hshTags = mgrTags.ReadTags()
'Handle Lists
lstTags.Items.Clear()
lstFilter.Items.Clear()
lstTags.ValueMember = "Key"
lstTags.DisplayMember = "Value"
lstFilter.ValueMember = "Key"
lstFilter.DisplayMember = "Value"
For Each de As DictionaryEntry In hshTags
oTag = DirectCast(de.Value, clsTag)
oData = New KeyValuePair(Of String, String)(oTag.ID, oTag.Name)
lstTags.Items.Add(oData)
Next
End Sub
Private Sub GetFilters()
Dim oData As KeyValuePair(Of String, String)
Dim oTag As clsTag
'Set Tags
For Each oData In lstFilter.Items
oTag = DirectCast(hshTags(oData.Value), clsTag)
Filters.Add(oTag)
Next
'Set Filter Type
If optAll.Checked Then
eCurrentFilterType = eFilterType.All
Else
eCurrentFilterType = eFilterType.Any
End If
End Sub
Private Sub frmGameTags_Load(sender As Object, e As EventArgs) Handles MyBase.Load
LoadData()
End Sub
Private Sub btnOK_Click(sender As Object, e As EventArgs) Handles btnOK.Click
GetFilters()
bShutdown = True
Me.close
End Sub
Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click
AddTag()
End Sub
Private Sub btnRemove_Click(sender As Object, e As EventArgs) Handles btnRemove.Click
RemoveTag()
End Sub
Private Sub frmFilter_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
If Not bShutdown Then
e.Cancel = True
End If
End Sub
End Class
+53 -13
View File
@@ -44,6 +44,7 @@ Partial Class frmGameManager
Me.txtName = New System.Windows.Forms.TextBox()
Me.chkMonitorOnly = New System.Windows.Forms.CheckBox()
Me.grpExtra = New System.Windows.Forms.GroupBox()
Me.lblTags = New System.Windows.Forms.Label()
Me.btnIconBrowse = New System.Windows.Forms.Button()
Me.txtIcon = New System.Windows.Forms.TextBox()
Me.lblVersion = New System.Windows.Forms.Label()
@@ -57,6 +58,7 @@ Partial Class frmGameManager
Me.txtAppPath = New System.Windows.Forms.TextBox()
Me.nudHours = New System.Windows.Forms.NumericUpDown()
Me.lblHours = New System.Windows.Forms.Label()
Me.btnTags = New System.Windows.Forms.Button()
Me.grpStats = New System.Windows.Forms.GroupBox()
Me.btnOpenRestorePath = New System.Windows.Forms.Button()
Me.btnOpenBackupFile = New System.Windows.Forms.Button()
@@ -75,6 +77,7 @@ Partial Class frmGameManager
Me.btnCancel = New System.Windows.Forms.Button()
Me.chkEnabled = New System.Windows.Forms.CheckBox()
Me.grpFilter = New System.Windows.Forms.GroupBox()
Me.optTag = New System.Windows.Forms.RadioButton()
Me.optBackupData = New System.Windows.Forms.RadioButton()
Me.optPendingRestores = New System.Windows.Forms.RadioButton()
Me.optAllGames = New System.Windows.Forms.RadioButton()
@@ -90,7 +93,7 @@ Partial Class frmGameManager
'
Me.btnAdd.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.btnAdd.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnAdd.Location = New System.Drawing.Point(12, 528)
Me.btnAdd.Location = New System.Drawing.Point(12, 527)
Me.btnAdd.Name = "btnAdd"
Me.btnAdd.Size = New System.Drawing.Size(30, 23)
Me.btnAdd.TabIndex = 2
@@ -101,7 +104,7 @@ Partial Class frmGameManager
'
Me.btnDelete.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.btnDelete.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnDelete.Location = New System.Drawing.Point(48, 528)
Me.btnDelete.Location = New System.Drawing.Point(48, 527)
Me.btnDelete.Name = "btnDelete"
Me.btnDelete.Size = New System.Drawing.Size(30, 23)
Me.btnDelete.TabIndex = 3
@@ -111,7 +114,7 @@ Partial Class frmGameManager
'btnBackup
'
Me.btnBackup.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnBackup.Location = New System.Drawing.Point(616, 527)
Me.btnBackup.Location = New System.Drawing.Point(616, 526)
Me.btnBackup.Name = "btnBackup"
Me.btnBackup.Size = New System.Drawing.Size(75, 23)
Me.btnBackup.TabIndex = 13
@@ -121,7 +124,7 @@ Partial Class frmGameManager
'btnClose
'
Me.btnClose.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnClose.Location = New System.Drawing.Point(697, 527)
Me.btnClose.Location = New System.Drawing.Point(697, 526)
Me.btnClose.Name = "btnClose"
Me.btnClose.Size = New System.Drawing.Size(75, 23)
Me.btnClose.TabIndex = 14
@@ -295,6 +298,7 @@ Partial Class frmGameManager
'grpExtra
'
Me.grpExtra.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.grpExtra.Controls.Add(Me.lblTags)
Me.grpExtra.Controls.Add(Me.btnIconBrowse)
Me.grpExtra.Controls.Add(Me.txtIcon)
Me.grpExtra.Controls.Add(Me.lblVersion)
@@ -313,7 +317,18 @@ Partial Class frmGameManager
Me.grpExtra.Size = New System.Drawing.Size(534, 155)
Me.grpExtra.TabIndex = 5
Me.grpExtra.TabStop = False
Me.grpExtra.Text = "Extra Information"
Me.grpExtra.Text = "Game Information"
'
'lblTags
'
Me.lblTags.AutoEllipsis = True
Me.lblTags.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblTags.Location = New System.Drawing.Point(163, 124)
Me.lblTags.Name = "lblTags"
Me.lblTags.Size = New System.Drawing.Size(311, 20)
Me.lblTags.TabIndex = 0
Me.lblTags.Text = "#Tags"
Me.lblTags.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'btnIconBrowse
'
@@ -426,6 +441,15 @@ Partial Class frmGameManager
Me.lblHours.TabIndex = 0
Me.lblHours.Text = "Hours:"
'
'btnTags
'
Me.btnTags.Location = New System.Drawing.Point(535, 360)
Me.btnTags.Name = "btnTags"
Me.btnTags.Size = New System.Drawing.Size(75, 23)
Me.btnTags.TabIndex = 22
Me.btnTags.Text = "Tags..."
Me.btnTags.UseVisualStyleBackColor = True
'
'grpStats
'
Me.grpStats.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
@@ -543,7 +567,7 @@ Partial Class frmGameManager
'btnMarkAsRestored
'
Me.btnMarkAsRestored.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnMarkAsRestored.Location = New System.Drawing.Point(429, 527)
Me.btnMarkAsRestored.Location = New System.Drawing.Point(429, 526)
Me.btnMarkAsRestored.Name = "btnMarkAsRestored"
Me.btnMarkAsRestored.Size = New System.Drawing.Size(100, 23)
Me.btnMarkAsRestored.TabIndex = 11
@@ -553,7 +577,7 @@ Partial Class frmGameManager
'btnRestore
'
Me.btnRestore.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnRestore.Location = New System.Drawing.Point(535, 527)
Me.btnRestore.Location = New System.Drawing.Point(535, 526)
Me.btnRestore.Name = "btnRestore"
Me.btnRestore.Size = New System.Drawing.Size(75, 23)
Me.btnRestore.TabIndex = 12
@@ -563,7 +587,7 @@ Partial Class frmGameManager
'btnSave
'
Me.btnSave.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnSave.Location = New System.Drawing.Point(616, 361)
Me.btnSave.Location = New System.Drawing.Point(616, 360)
Me.btnSave.Name = "btnSave"
Me.btnSave.Size = New System.Drawing.Size(75, 23)
Me.btnSave.TabIndex = 8
@@ -573,17 +597,17 @@ Partial Class frmGameManager
'lstGames
'
Me.lstGames.FormattingEnabled = True
Me.lstGames.Location = New System.Drawing.Point(12, 112)
Me.lstGames.Location = New System.Drawing.Point(12, 138)
Me.lstGames.Name = "lstGames"
Me.lstGames.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended
Me.lstGames.Size = New System.Drawing.Size(220, 407)
Me.lstGames.Size = New System.Drawing.Size(220, 381)
Me.lstGames.Sorted = True
Me.lstGames.TabIndex = 1
'
'btnCancel
'
Me.btnCancel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnCancel.Location = New System.Drawing.Point(697, 361)
Me.btnCancel.Location = New System.Drawing.Point(697, 360)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(75, 23)
Me.btnCancel.TabIndex = 9
@@ -602,16 +626,28 @@ Partial Class frmGameManager
'
'grpFilter
'
Me.grpFilter.Controls.Add(Me.optTag)
Me.grpFilter.Controls.Add(Me.optBackupData)
Me.grpFilter.Controls.Add(Me.optPendingRestores)
Me.grpFilter.Controls.Add(Me.optAllGames)
Me.grpFilter.Location = New System.Drawing.Point(12, 12)
Me.grpFilter.Name = "grpFilter"
Me.grpFilter.Size = New System.Drawing.Size(220, 91)
Me.grpFilter.Size = New System.Drawing.Size(220, 113)
Me.grpFilter.TabIndex = 0
Me.grpFilter.TabStop = False
Me.grpFilter.Text = "Games Filter"
'
'optTag
'
Me.optTag.AutoSize = True
Me.optTag.Location = New System.Drawing.Point(6, 87)
Me.optTag.Name = "optTag"
Me.optTag.Size = New System.Drawing.Size(49, 17)
Me.optTag.TabIndex = 3
Me.optTag.TabStop = True
Me.optTag.Text = "Tags"
Me.optTag.UseVisualStyleBackColor = True
'
'optBackupData
'
Me.optBackupData.AutoSize = True
@@ -649,8 +685,9 @@ Partial Class frmGameManager
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(784, 562)
Me.ClientSize = New System.Drawing.Size(784, 561)
Me.Controls.Add(Me.grpFilter)
Me.Controls.Add(Me.btnTags)
Me.Controls.Add(Me.chkEnabled)
Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.chkMonitorOnly)
@@ -742,4 +779,7 @@ Partial Class frmGameManager
Friend WithEvents optAllGames As System.Windows.Forms.RadioButton
Friend WithEvents optBackupData As System.Windows.Forms.RadioButton
Friend WithEvents btnOpenRestorePath As System.Windows.Forms.Button
Friend WithEvents btnTags As System.Windows.Forms.Button
Friend WithEvents lblTags As System.Windows.Forms.Label
Friend WithEvents optTag As System.Windows.Forms.RadioButton
End Class
+62 -2
View File
@@ -205,8 +205,18 @@ Public Class frmGameManager
Dim oRestoreData As New SortedList
Dim oGame As clsGame
Dim oBackup As clsBackup
Dim frm As frmFilter
Dim oFilters As New List(Of clsTag)
Dim eCurrentFilter As frmFilter.eFilterType = frmFilter.eFilterType.Any
AppData = mgrMonitorList.ReadList(mgrMonitorList.eListTypes.ListByKey)
If optTag.Checked Then
frm = New frmFilter
frm.ShowDialog()
oFilters = frm.Filters
eCurrentFilter = frm.FilterType
End If
AppData = mgrMonitorList.ReadFilteredList(oFilters, eCurrentFilter)
If optPendingRestores.Checked Then
oRestoreData = mgrRestore.CompareManifests
@@ -420,6 +430,22 @@ Public Class frmGameManager
End Sub
Private Sub OpenTags()
Dim frm As New frmGameTags
Dim oApp As clsGame
Dim sMonitorIDs As New List(Of String)
For Each oData In lstGames.SelectedItems
oApp = DirectCast(AppData(oData.Key), clsGame)
sMonitorIDs.Add(oApp.ID)
Next
frm.IDList = sMonitorIDs
frm.GameName = CurrentGame.Name
frm.ShowDialog()
FillTags(CurrentGame.ID)
End Sub
Private Sub GetBackupInfo(ByVal oApp As clsGame)
Dim oBackupInfo As clsBackup
Dim sFileName As String
@@ -550,6 +576,8 @@ Public Class frmGameManager
txtVersion.Text = oApp.Version
txtIcon.Text = oApp.Icon
FillTags(oData.Key)
'Icon
If IO.File.Exists(oApp.Icon) Then
pbIcon.Image = Image.FromFile(oApp.Icon)
@@ -573,6 +601,22 @@ Public Class frmGameManager
IsLoading = False
End Sub
Private Sub FillTags(ByVal sID As String)
Dim hshTags As Hashtable
Dim oTag As clsTag
Dim sTags As String = String.Empty
Dim cTrim() As Char = {",", " "}
hshTags = mgrGameTags.GetTagsByGame(sID)
For Each de As DictionaryEntry In hshTags
oTag = DirectCast(de.Value, clsTag)
sTags &= "#" & oTag.Name & ", "
Next
lblTags.Text = sTags.TrimEnd(cTrim)
End Sub
Private Sub DirtyCheck_ValueChanged(sender As Object, e As EventArgs)
If Not IsLoading And Not eCurrentMode = eModes.MultiSelect Then
IsDirty = True
@@ -639,6 +683,8 @@ Public Class frmGameManager
lblSync.Visible = False
chkEnabled.Checked = True
chkMonitorOnly.Checked = False
btnTags.Enabled = False
lblTags.Visible = False
Case eModes.Edit
grpFilter.Enabled = False
lstGames.Enabled = False
@@ -657,6 +703,8 @@ Public Class frmGameManager
btnDeleteBackup.Enabled = False
btnOpenBackupFile.Enabled = False
btnOpenRestorePath.Enabled = False
btnTags.Enabled = True
lblTags.Visible = True
Case eModes.View
grpFilter.Enabled = True
lstGames.Enabled = True
@@ -670,6 +718,8 @@ Public Class frmGameManager
btnAdd.Enabled = True
btnDelete.Enabled = True
btnBackup.Enabled = True
btnTags.Enabled = True
lblTags.Visible = True
Case eModes.ViewTemp
grpFilter.Enabled = True
lstGames.Enabled = True
@@ -683,6 +733,8 @@ Public Class frmGameManager
btnAdd.Enabled = True
btnDelete.Enabled = False
btnBackup.Enabled = False
btnTags.Enabled = False
lblTags.Visible = False
Case eModes.Disabled
grpFilter.Enabled = True
lstGames.Enabled = True
@@ -690,6 +742,7 @@ Public Class frmGameManager
WipeControls(grpExtra.Controls)
WipeControls(grpStats.Controls)
pbIcon.Image = My.Resources.Unknown
lblTags.Text = String.Empty
lblSync.Visible = False
btnSave.Enabled = False
btnCancel.Enabled = False
@@ -703,6 +756,7 @@ Public Class frmGameManager
btnBackup.Enabled = False
btnRestore.Enabled = False
btnMarkAsRestored.Enabled = False
btnTags.Enabled = False
Case eModes.MultiSelect
lstGames.Enabled = True
WipeControls(grpConfig.Controls)
@@ -724,6 +778,7 @@ Public Class frmGameManager
btnBackup.Enabled = True
btnRestore.Enabled = True
btnMarkAsRestored.Enabled = True
btnTags.Enabled = True
End Select
IsLoading = False
@@ -1121,6 +1176,10 @@ Public Class frmGameManager
OpenRestorePath()
End Sub
Private Sub btnTags_Click(sender As Object, e As EventArgs) Handles btnTags.Click
OpenTags()
End Sub
Private Sub btnDeleteBackup_Click(sender As Object, e As EventArgs) Handles btnDeleteBackup.Click
DeleteBackup()
End Sub
@@ -1133,11 +1192,12 @@ Public Class frmGameManager
TriggerSelectedRestore()
End Sub
Private Sub optGamesFilter_CheckedChanged(sender As Object, e As EventArgs) Handles optPendingRestores.CheckedChanged, optAllGames.CheckedChanged
Private Sub optGamesFilter_Click(sender As Object, e As EventArgs) Handles optPendingRestores.Click, optAllGames.Click, optBackupData.Click, optTag.Click
lstGames.ClearSelected()
eCurrentMode = eModes.Disabled
ModeChange()
LoadData()
End Sub
End Class
+139
View File
@@ -0,0 +1,139 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmGameTags
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.lstTags = New System.Windows.Forms.ListBox()
Me.lstGameTags = New System.Windows.Forms.ListBox()
Me.btnAdd = New System.Windows.Forms.Button()
Me.btnRemove = New System.Windows.Forms.Button()
Me.lblTags = New System.Windows.Forms.Label()
Me.lblGameTags = New System.Windows.Forms.Label()
Me.btnClose = New System.Windows.Forms.Button()
Me.btnOpenTags = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'lstTags
'
Me.lstTags.FormattingEnabled = True
Me.lstTags.Location = New System.Drawing.Point(12, 25)
Me.lstTags.Name = "lstTags"
Me.lstTags.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended
Me.lstTags.Size = New System.Drawing.Size(150, 199)
Me.lstTags.TabIndex = 0
'
'lstGameTags
'
Me.lstGameTags.FormattingEnabled = True
Me.lstGameTags.Location = New System.Drawing.Point(222, 25)
Me.lstGameTags.Name = "lstGameTags"
Me.lstGameTags.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended
Me.lstGameTags.Size = New System.Drawing.Size(150, 199)
Me.lstGameTags.TabIndex = 3
'
'btnAdd
'
Me.btnAdd.Location = New System.Drawing.Point(168, 86)
Me.btnAdd.Name = "btnAdd"
Me.btnAdd.Size = New System.Drawing.Size(48, 23)
Me.btnAdd.TabIndex = 1
Me.btnAdd.Text = "> >"
Me.btnAdd.UseVisualStyleBackColor = True
'
'btnRemove
'
Me.btnRemove.Location = New System.Drawing.Point(168, 115)
Me.btnRemove.Name = "btnRemove"
Me.btnRemove.Size = New System.Drawing.Size(48, 23)
Me.btnRemove.TabIndex = 2
Me.btnRemove.Text = "< <"
Me.btnRemove.UseVisualStyleBackColor = True
'
'lblTags
'
Me.lblTags.AutoSize = True
Me.lblTags.Location = New System.Drawing.Point(49, 9)
Me.lblTags.Name = "lblTags"
Me.lblTags.Size = New System.Drawing.Size(77, 13)
Me.lblTags.TabIndex = 0
Me.lblTags.Text = "Available Tags"
'
'lblGameTags
'
Me.lblGameTags.AutoSize = True
Me.lblGameTags.Location = New System.Drawing.Point(263, 9)
Me.lblGameTags.Name = "lblGameTags"
Me.lblGameTags.Size = New System.Drawing.Size(68, 13)
Me.lblGameTags.TabIndex = 0
Me.lblGameTags.Text = "Current Tags"
'
'btnClose
'
Me.btnClose.Location = New System.Drawing.Point(297, 230)
Me.btnClose.Name = "btnClose"
Me.btnClose.Size = New System.Drawing.Size(75, 23)
Me.btnClose.TabIndex = 5
Me.btnClose.Text = "&Close"
Me.btnClose.UseVisualStyleBackColor = True
'
'btnOpenTags
'
Me.btnOpenTags.Location = New System.Drawing.Point(12, 230)
Me.btnOpenTags.Name = "btnOpenTags"
Me.btnOpenTags.Size = New System.Drawing.Size(90, 23)
Me.btnOpenTags.TabIndex = 4
Me.btnOpenTags.Text = "Setup &Tags..."
Me.btnOpenTags.UseVisualStyleBackColor = True
'
'frmGameTags
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(384, 261)
Me.Controls.Add(Me.btnOpenTags)
Me.Controls.Add(Me.btnClose)
Me.Controls.Add(Me.lblGameTags)
Me.Controls.Add(Me.lblTags)
Me.Controls.Add(Me.btnRemove)
Me.Controls.Add(Me.btnAdd)
Me.Controls.Add(Me.lstGameTags)
Me.Controls.Add(Me.lstTags)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frmGameTags"
Me.ShowIcon = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Edit Tags"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents lstTags As System.Windows.Forms.ListBox
Friend WithEvents lstGameTags As System.Windows.Forms.ListBox
Friend WithEvents btnAdd As System.Windows.Forms.Button
Friend WithEvents btnRemove As System.Windows.Forms.Button
Friend WithEvents lblTags As System.Windows.Forms.Label
Friend WithEvents lblGameTags As System.Windows.Forms.Label
Friend WithEvents btnClose As System.Windows.Forms.Button
Friend WithEvents btnOpenTags As System.Windows.Forms.Button
End Class
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+190
View File
@@ -0,0 +1,190 @@
Public Class frmGameTags
Dim sMonitorIDs As List(Of String)
Dim sGameName As String = String.Empty
Public Property IDList As List(Of String)
Get
Return sMonitorIDs
End Get
Set(value As List(Of String))
sMonitorIDs = value
End Set
End Property
Public Property GameName As String
Get
Return sGameName
End Get
Set(value As String)
sGameName = value
End Set
End Property
Private Sub AddTag()
Dim oData As KeyValuePair(Of String, String)
Dim oTags As List(Of KeyValuePair(Of String, String))
Dim oGameTag As clsGameTag
Dim oGameTags As List(Of clsGameTag)
If lstTags.SelectedItems.Count = 1 Then
oData = lstTags.SelectedItems(0)
oGameTags = New List(Of clsGameTag)
For Each sID As String In IDList
oGameTag = New clsGameTag
oGameTag.MonitorID = sID
oGameTag.TagID = oData.Key
oGameTags.Add(oGameTag)
Next
mgrGameTags.DoGameTagAddBatch(oGameTags)
lstGameTags.Items.Add(oData)
lstTags.Items.Remove(oData)
ElseIf lstTags.SelectedItems.Count > 1 Then
oTags = New List(Of KeyValuePair(Of String, String))
For Each oData In lstTags.SelectedItems
oTags.Add(oData)
Next
For Each kp As KeyValuePair(Of String, String) In oTags
oGameTags = New List(Of clsGameTag)
For Each sID As String In IDList
oGameTag = New clsGameTag
oGameTag.MonitorID = sID
oGameTag.TagID = kp.Key
oGameTags.Add(oGameTag)
Next
mgrGameTags.DoGameTagAddBatch(oGameTags)
lstGameTags.Items.Add(kp)
lstTags.Items.Remove(kp)
Next
End If
End Sub
Private Sub RemoveTag()
Dim oData As KeyValuePair(Of String, String)
Dim oTags As List(Of KeyValuePair(Of String, String))
Dim oGameTag As clsGameTag
Dim oGameTags As List(Of clsGameTag)
If lstGameTags.SelectedItems.Count = 1 Then
oData = lstGameTags.SelectedItems(0)
oGameTags = New List(Of clsGameTag)
For Each sID As String In IDList
oGameTag = New clsGameTag
oGameTag.MonitorID = sID
oGameTag.TagID = oData.Key
oGameTags.Add(oGameTag)
Next
mgrGameTags.DoGameTagDelete(oGameTags)
lstGameTags.Items.Remove(oData)
lstTags.Items.Add(oData)
ElseIf lstGameTags.SelectedItems.Count > 1 Then
oTags = New List(Of KeyValuePair(Of String, String))
For Each oData In lstGameTags.SelectedItems
oTags.Add(oData)
Next
For Each kp As KeyValuePair(Of String, String) In oTags
oGameTags = New List(Of clsGameTag)
For Each sID As String In IDList
oGameTag = New clsGameTag
oGameTag.MonitorID = sID
oGameTag.TagID = kp.Key
oGameTags.Add(oGameTag)
Next
mgrGameTags.DoGameTagDelete(oGameTags)
lstGameTags.Items.Remove(kp)
lstTags.Items.Add(kp)
Next
End If
End Sub
Private Sub LoadData()
Dim hshTags As Hashtable
Dim hshGameTags As Hashtable
Dim oTag As clsTag
Dim oData As KeyValuePair(Of String, String)
'Handle Data
hshTags = mgrTags.ReadTags()
hshGameTags = mgrGameTags.GetTagsByGameMulti(IDList)
For Each de As DictionaryEntry In hshGameTags
oTag = DirectCast(de.Value, clsTag)
If hshTags.ContainsKey(oTag.Name) Then
hshTags.Remove(oTag.Name)
End If
Next
'Handle Lists
lstTags.Items.Clear()
lstGameTags.Items.Clear()
lstTags.ValueMember = "Key"
lstTags.DisplayMember = "Value"
lstGameTags.ValueMember = "Key"
lstGameTags.DisplayMember = "Value"
For Each de As DictionaryEntry In hshGameTags
oTag = DirectCast(de.Value, clsTag)
oData = New KeyValuePair(Of String, String)(oTag.ID, oTag.Name)
lstGameTags.Items.Add(oData)
Next
For Each de As DictionaryEntry In hshTags
oTag = DirectCast(de.Value, clsTag)
oData = New KeyValuePair(Of String, String)(oTag.ID, oTag.Name)
lstTags.Items.Add(oData)
Next
End Sub
Private Sub OpenTags()
Dim frm As New frmTags
frm.ShowDialog()
LoadData()
End Sub
Private Sub SetForm()
If IDList.Count > 1 Then
Me.Text = "Edit Tags for Multiple Games"
Else
Me.Text = "Edit Tags for " & GameName
End If
End Sub
Private Sub frmGameTags_Load(sender As Object, e As EventArgs) Handles MyBase.Load
LoadData()
SetForm()
End Sub
Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click
Me.Close()
End Sub
Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click
AddTag()
End Sub
Private Sub btnRemove_Click(sender As Object, e As EventArgs) Handles btnRemove.Click
RemoveTag()
End Sub
Private Sub btnOpenTags_Click(sender As Object, e As EventArgs) Handles btnOpenTags.Click
OpenTags()
End Sub
End Class
+18 -2
View File
@@ -80,6 +80,8 @@ Partial Class frmMain
Me.lblTimeSpent = New System.Windows.Forms.Label()
Me.txtGameInfo = New System.Windows.Forms.TextBox()
Me.btnCancelOperation = New System.Windows.Forms.Button()
Me.gMonSetupTags = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonTraySetupTags = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonTrayMenu.SuspendLayout()
Me.gMonStatusStrip.SuspendLayout()
Me.gMonMainMenu.SuspendLayout()
@@ -126,7 +128,7 @@ Partial Class frmMain
'
'gMonTraySetup
'
Me.gMonTraySetup.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonTraySetupAddWizard, Me.gMonTraySetupGameManager, Me.gMonTraySetupCustomVariables})
Me.gMonTraySetup.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonTraySetupAddWizard, Me.gMonTraySetupGameManager, Me.gMonTraySetupCustomVariables, Me.gMonTraySetupTags})
Me.gMonTraySetup.Name = "gMonTraySetup"
Me.gMonTraySetup.Size = New System.Drawing.Size(161, 22)
Me.gMonTraySetup.Text = "&Setup"
@@ -309,7 +311,7 @@ Partial Class frmMain
'
'gMonSetup
'
Me.gMonSetup.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonSetupGameManager, Me.gMonSetupAddWizard, Me.gMonSetupCustomVariables})
Me.gMonSetup.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonSetupGameManager, Me.gMonSetupAddWizard, Me.gMonSetupCustomVariables, Me.gMonSetupTags})
Me.gMonSetup.Name = "gMonSetup"
Me.gMonSetup.Size = New System.Drawing.Size(49, 20)
Me.gMonSetup.Text = "&Setup"
@@ -489,6 +491,18 @@ Partial Class frmMain
Me.btnCancelOperation.Text = "&Cancel"
Me.btnCancelOperation.UseVisualStyleBackColor = True
'
'gMonSetupTags
'
Me.gMonSetupTags.Name = "gMonSetupTags"
Me.gMonSetupTags.Size = New System.Drawing.Size(201, 22)
Me.gMonSetupTags.Text = "&Tags..."
'
'gMonTraySetupTags
'
Me.gMonTraySetupTags.Name = "gMonTraySetupTags"
Me.gMonTraySetupTags.Size = New System.Drawing.Size(201, 22)
Me.gMonTraySetupTags.Text = "&Tags"
'
'frmMain
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -582,4 +596,6 @@ Partial Class frmMain
Friend WithEvents gMonHelpCheckforUpdates As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents btnCancelOperation As System.Windows.Forms.Button
Friend WithEvents gMonStripAdminButton As ToolStripSplitButton
Friend WithEvents gMonTraySetupTags As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents gMonSetupTags As System.Windows.Forms.ToolStripMenuItem
End Class
+62 -13
View File
@@ -367,8 +367,10 @@ Public Class frmMain
lblGameTitle.Text = "Last Game: " & oProcess.GameInfo.CroppedName
pbIcon.Image = oPriorImage
txtGameInfo.Text = sPriorDetails
lblTimeTitle.Visible = True
lblTimeSpent.Visible = True
If oSettings.TimeTracking Then
lblTimeTitle.Visible = True
lblTimeSpent.Visible = True
End If
Else
pbIcon.Image = My.Resources.Searching
lblGameTitle.Text = "No Game Detected"
@@ -451,7 +453,12 @@ Public Class frmMain
End If
'Do Time Update
UpdateTimeSpent(oProcess.GameInfo.Hours, 0)
If oSettings.TimeTracking Then
UpdateTimeSpent(oProcess.GameInfo.Hours, 0)
Else
lblTimeTitle.Visible = False
lblTimeSpent.Visible = False
End If
'Set Details
If sFileName = String.Empty Then
@@ -538,6 +545,14 @@ Public Class frmMain
"See gpl-3.0.html in the program folder for details.", MsgBoxStyle.Information, "Game Backup Monitor")
End Sub
Private Sub OpenTags()
Dim frm As New frmTags
PauseScan()
frm.ShowDialog()
If oSettings.Sync Then mgrMonitorList.SyncMonitorLists()
ResumeScan()
End Sub
Private Sub OpenGameManager(Optional ByVal bPendingRestores As Boolean = False)
Dim frm As New frmGameManager
PauseScan()
@@ -548,7 +563,7 @@ Public Class frmMain
If oSettings.Sync Then mgrMonitorList.SyncMonitorLists()
ResumeScan()
'Handle manual backup trigger
'Handle backup trigger
If frm.TriggerBackup Then
RunManualBackup(frm.BackupList)
End If
@@ -597,7 +612,7 @@ Public Class frmMain
frm.Settings = oSettings
PauseScan()
frm.ShowDialog()
LoadSettings()
LoadAndVerify()
bFirstRun = False
ResumeScan()
End Sub
@@ -668,7 +683,14 @@ Public Class frmMain
oRemoteDatabase.DatabaseUpgrade()
End Sub
Private Sub LoadSettings()
Private Sub LoadAndVerify()
'The application cannot continue if this fails
If Not oBackup.CheckForUtilities(mgrPath.Utility7zLocation) Then
MsgBox("7-Zip was not found in the Game Backup Monitor utilities folder. The application cannot continue.", MsgBoxStyle.Critical, "Game Backup Monitor")
bShutdown = True
Me.Close()
End If
'Local Database Check
VerifyDBVersion(mgrSQLite.Database.Local)
@@ -698,9 +720,11 @@ Public Class frmMain
'Load Game Settings
LoadGameSettings()
'Check for utilities
If Not oBackup.CheckForUtilities(mgrPath.Utility7zLocation) Then
UpdateLog("The correct version of 7-Zip was not found! Please re-install GBM, you may experience an application crash if a backup or restore is performed.", True, ToolTipIcon.Error)
'Verify the "Start with Windows" setting
If oSettings.StartWithWindows Then
If Not VerifyStartWithWindows() Then
UpdateLog("GBM is running from a new location, the Windows startup entry has been updated.", False, ToolTipIcon.Info)
End If
End If
End Sub
@@ -904,7 +928,7 @@ Public Class frmMain
txtLog.ScrollToCaret()
gMonTray.BalloonTipText = sLogUpdate
gMonTray.BalloonTipIcon = objIcon
If bTrayUpdate Then gMonTray.ShowBalloonTip(2000)
If bTrayUpdate Then gMonTray.ShowBalloonTip(5000)
End If
Application.DoEvents()
End Sub
@@ -1047,6 +1071,27 @@ Public Class frmMain
End If
End Sub
Private Function VerifyStartWithWindows() As Boolean
Dim oKey As Microsoft.Win32.RegistryKey
Dim sAppName As String = Application.ProductName
Dim sAppPath As String = Application.ExecutablePath
Dim sRegPath As String
oKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True)
sRegPath = oKey.GetValue(sAppName, String.Empty).ToString.Replace("""", "")
oKey.Close()
If sAppPath.ToLower <> sRegPath.ToLower Then
oKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True)
oKey.SetValue(sAppName, """" & sAppPath & """")
oKey.Close()
Return False
Else
Return True
End If
End Function
Private Sub CheckForSavedDuplicate()
For Each o As clsGame In oProcess.DuplicateList
If o.ProcessPath.ToLower = oProcess.GameInfo.ProcessPath.ToLower Then
@@ -1091,7 +1136,7 @@ Public Class frmMain
If slItems.Count > 0 Then
For Each oItem As clsBackup In slItems.Values
UpdateLog("[Sync Notifier] " & oItem.Name & " entry removed from local manfiest.", False)
UpdateLog(oItem.Name & " entry removed from local manfiest.", False)
Next
MsgBox(slItems.Count & " entries removed from the local manifest.")
Else
@@ -1185,6 +1230,10 @@ Public Class frmMain
OpenCustomVariables()
End Sub
Private Sub gMonSetupTags_Click(sender As Object, e As EventArgs) Handles gMonSetupTags.Click, gMonTraySetupTags.Click
OpenTags()
End Sub
Private Sub gMonHelpAbout_Click(sender As Object, e As EventArgs) Handles gMonHelpAbout.Click
OpenAbout()
End Sub
@@ -1337,7 +1386,7 @@ Public Class frmMain
If Not bCancelledByUser Then
DoMultiGameCheck()
UpdateLog(oProcess.GameInfo.Name & " has ended.", False)
HandleTimeSpent()
If oSettings.TimeTracking Then HandleTimeSpent()
RunBackup()
End If
bCancelledByUser = False
@@ -1346,7 +1395,7 @@ Public Class frmMain
Private Sub Main_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
SetForm()
VerifyGameDataPath()
LoadSettings()
LoadAndVerify()
VerifyCustomPathVariables()
If oSettings.StartToTray Then
+20 -7
View File
@@ -25,6 +25,7 @@ Partial Class frmSettings
Me.chkMonitorOnStartup = New System.Windows.Forms.CheckBox()
Me.chkBackupConfirm = New System.Windows.Forms.CheckBox()
Me.grpGeneral = New System.Windows.Forms.GroupBox()
Me.chkTimeTracking = New System.Windows.Forms.CheckBox()
Me.chkStartWindows = New System.Windows.Forms.CheckBox()
Me.chkSync = New System.Windows.Forms.CheckBox()
Me.chkShowDetectionTips = New System.Windows.Forms.CheckBox()
@@ -68,6 +69,7 @@ Partial Class frmSettings
'
'grpGeneral
'
Me.grpGeneral.Controls.Add(Me.chkTimeTracking)
Me.grpGeneral.Controls.Add(Me.chkStartWindows)
Me.grpGeneral.Controls.Add(Me.chkSync)
Me.grpGeneral.Controls.Add(Me.chkShowDetectionTips)
@@ -75,11 +77,21 @@ Partial Class frmSettings
Me.grpGeneral.Controls.Add(Me.chkMonitorOnStartup)
Me.grpGeneral.Location = New System.Drawing.Point(12, 12)
Me.grpGeneral.Name = "grpGeneral"
Me.grpGeneral.Size = New System.Drawing.Size(360, 145)
Me.grpGeneral.Size = New System.Drawing.Size(360, 165)
Me.grpGeneral.TabIndex = 0
Me.grpGeneral.TabStop = False
Me.grpGeneral.Text = "General"
'
'chkTimeTracking
'
Me.chkTimeTracking.AutoSize = True
Me.chkTimeTracking.Location = New System.Drawing.Point(6, 111)
Me.chkTimeTracking.Name = "chkTimeTracking"
Me.chkTimeTracking.Size = New System.Drawing.Size(122, 17)
Me.chkTimeTracking.TabIndex = 5
Me.chkTimeTracking.Text = "Enable time tracking"
Me.chkTimeTracking.UseVisualStyleBackColor = True
'
'chkStartWindows
'
Me.chkStartWindows.AutoSize = True
@@ -93,7 +105,7 @@ Partial Class frmSettings
'chkSync
'
Me.chkSync.AutoSize = True
Me.chkSync.Location = New System.Drawing.Point(6, 111)
Me.chkSync.Location = New System.Drawing.Point(6, 134)
Me.chkSync.Name = "chkSync"
Me.chkSync.Size = New System.Drawing.Size(208, 17)
Me.chkSync.TabIndex = 4
@@ -125,7 +137,7 @@ Partial Class frmSettings
Me.grpPaths.Controls.Add(Me.btnBackupFolder)
Me.grpPaths.Controls.Add(Me.lblBackupFolder)
Me.grpPaths.Controls.Add(Me.txtBackupFolder)
Me.grpPaths.Location = New System.Drawing.Point(12, 311)
Me.grpPaths.Location = New System.Drawing.Point(12, 331)
Me.grpPaths.Name = "grpPaths"
Me.grpPaths.Size = New System.Drawing.Size(360, 60)
Me.grpPaths.TabIndex = 2
@@ -160,7 +172,7 @@ Partial Class frmSettings
'btnSave
'
Me.btnSave.DialogResult = System.Windows.Forms.DialogResult.OK
Me.btnSave.Location = New System.Drawing.Point(216, 377)
Me.btnSave.Location = New System.Drawing.Point(216, 397)
Me.btnSave.Name = "btnSave"
Me.btnSave.Size = New System.Drawing.Size(75, 23)
Me.btnSave.TabIndex = 3
@@ -170,7 +182,7 @@ Partial Class frmSettings
'btnCancel
'
Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btnCancel.Location = New System.Drawing.Point(297, 377)
Me.btnCancel.Location = New System.Drawing.Point(297, 397)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(75, 23)
Me.btnCancel.TabIndex = 4
@@ -184,7 +196,7 @@ Partial Class frmSettings
Me.grpBackup.Controls.Add(Me.chkOverwriteWarning)
Me.grpBackup.Controls.Add(Me.chkCreateFolder)
Me.grpBackup.Controls.Add(Me.chkBackupConfirm)
Me.grpBackup.Location = New System.Drawing.Point(12, 163)
Me.grpBackup.Location = New System.Drawing.Point(12, 183)
Me.grpBackup.Name = "grpBackup"
Me.grpBackup.Size = New System.Drawing.Size(360, 142)
Me.grpBackup.TabIndex = 1
@@ -235,7 +247,7 @@ Partial Class frmSettings
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(384, 412)
Me.ClientSize = New System.Drawing.Size(384, 431)
Me.Controls.Add(Me.grpBackup)
Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.btnSave)
@@ -277,4 +289,5 @@ Partial Class frmSettings
Friend WithEvents chkSync As System.Windows.Forms.CheckBox
Friend WithEvents chkCheckSum As System.Windows.Forms.CheckBox
Friend WithEvents chkStartWindows As System.Windows.Forms.CheckBox
Friend WithEvents chkTimeTracking As System.Windows.Forms.CheckBox
End Class
+2
View File
@@ -53,6 +53,7 @@
oSettings.CreateSubFolder = chkCreateFolder.Checked
oSettings.ShowOverwriteWarning = chkOverwriteWarning.Checked
oSettings.RestoreOnLaunch = chkRestoreOnLaunch.Checked
oSettings.TimeTracking = chkTimeTracking.Checked
'We need to clear all checksums its turned off
If chkCheckSum.Checked = False And oSettings.CheckSum = True Then
@@ -102,6 +103,7 @@
txtBackupFolder.Text = oSettings.BackupFolder
chkSync.Checked = oSettings.Sync
chkCheckSum.Checked = oSettings.CheckSum
chkTimeTracking.Checked = oSettings.TimeTracking
End Sub
Private Sub btnSave_Click(sender As System.Object, e As System.EventArgs) Handles btnSave.Click
+172
View File
@@ -0,0 +1,172 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmTags
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.grpTag = New System.Windows.Forms.GroupBox()
Me.txtName = New System.Windows.Forms.TextBox()
Me.lblName = New System.Windows.Forms.Label()
Me.btnClose = New System.Windows.Forms.Button()
Me.btnDelete = New System.Windows.Forms.Button()
Me.btnAdd = New System.Windows.Forms.Button()
Me.lstTags = New System.Windows.Forms.ListBox()
Me.txtID = New System.Windows.Forms.TextBox()
Me.btnCancel = New System.Windows.Forms.Button()
Me.btnSave = New System.Windows.Forms.Button()
Me.grpTag.SuspendLayout()
Me.SuspendLayout()
'
'grpTag
'
Me.grpTag.Controls.Add(Me.txtName)
Me.grpTag.Controls.Add(Me.lblName)
Me.grpTag.Location = New System.Drawing.Point(238, 12)
Me.grpTag.Name = "grpTag"
Me.grpTag.Size = New System.Drawing.Size(334, 50)
Me.grpTag.TabIndex = 3
Me.grpTag.TabStop = False
Me.grpTag.Text = "Configuration"
'
'txtName
'
Me.txtName.Location = New System.Drawing.Point(50, 19)
Me.txtName.Name = "txtName"
Me.txtName.Size = New System.Drawing.Size(278, 20)
Me.txtName.TabIndex = 1
'
'lblName
'
Me.lblName.AutoSize = True
Me.lblName.Location = New System.Drawing.Point(6, 22)
Me.lblName.Name = "lblName"
Me.lblName.Size = New System.Drawing.Size(38, 13)
Me.lblName.TabIndex = 0
Me.lblName.Text = "Name:"
'
'btnClose
'
Me.btnClose.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnClose.Location = New System.Drawing.Point(497, 226)
Me.btnClose.Name = "btnClose"
Me.btnClose.Size = New System.Drawing.Size(75, 23)
Me.btnClose.TabIndex = 7
Me.btnClose.Text = "C&lose"
Me.btnClose.UseVisualStyleBackColor = True
'
'btnDelete
'
Me.btnDelete.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.btnDelete.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnDelete.Location = New System.Drawing.Point(48, 226)
Me.btnDelete.Name = "btnDelete"
Me.btnDelete.Size = New System.Drawing.Size(30, 23)
Me.btnDelete.TabIndex = 2
Me.btnDelete.Text = "-"
Me.btnDelete.UseVisualStyleBackColor = True
'
'btnAdd
'
Me.btnAdd.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.btnAdd.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnAdd.Location = New System.Drawing.Point(12, 226)
Me.btnAdd.Name = "btnAdd"
Me.btnAdd.Size = New System.Drawing.Size(30, 23)
Me.btnAdd.TabIndex = 1
Me.btnAdd.Text = "+"
Me.btnAdd.UseVisualStyleBackColor = True
'
'lstTags
'
Me.lstTags.FormattingEnabled = True
Me.lstTags.Location = New System.Drawing.Point(12, 12)
Me.lstTags.Name = "lstTags"
Me.lstTags.Size = New System.Drawing.Size(220, 212)
Me.lstTags.Sorted = True
Me.lstTags.TabIndex = 0
'
'txtID
'
Me.txtID.Enabled = False
Me.txtID.Location = New System.Drawing.Point(377, 67)
Me.txtID.Name = "txtID"
Me.txtID.Size = New System.Drawing.Size(33, 20)
Me.txtID.TabIndex = 4
Me.txtID.TabStop = False
Me.txtID.Visible = False
'
'btnCancel
'
Me.btnCancel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnCancel.Location = New System.Drawing.Point(497, 67)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(75, 23)
Me.btnCancel.TabIndex = 6
Me.btnCancel.Text = "&Cancel"
Me.btnCancel.UseVisualStyleBackColor = True
'
'btnSave
'
Me.btnSave.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnSave.Location = New System.Drawing.Point(416, 67)
Me.btnSave.Name = "btnSave"
Me.btnSave.Size = New System.Drawing.Size(75, 23)
Me.btnSave.TabIndex = 5
Me.btnSave.Text = "&Save"
Me.btnSave.UseVisualStyleBackColor = True
'
'frmTags
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(584, 261)
Me.Controls.Add(Me.grpTag)
Me.Controls.Add(Me.btnClose)
Me.Controls.Add(Me.btnDelete)
Me.Controls.Add(Me.btnAdd)
Me.Controls.Add(Me.lstTags)
Me.Controls.Add(Me.txtID)
Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.btnSave)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frmTags"
Me.ShowIcon = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Tags"
Me.grpTag.ResumeLayout(False)
Me.grpTag.PerformLayout()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents grpTag As System.Windows.Forms.GroupBox
Friend WithEvents txtName As System.Windows.Forms.TextBox
Friend WithEvents lblName As System.Windows.Forms.Label
Friend WithEvents btnClose As System.Windows.Forms.Button
Friend WithEvents btnDelete As System.Windows.Forms.Button
Friend WithEvents btnAdd As System.Windows.Forms.Button
Friend WithEvents lstTags As System.Windows.Forms.ListBox
Friend WithEvents txtID As System.Windows.Forms.TextBox
Friend WithEvents btnCancel As System.Windows.Forms.Button
Friend WithEvents btnSave As System.Windows.Forms.Button
End Class
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+307
View File
@@ -0,0 +1,307 @@
Public Class frmTags
Dim hshTagData As Hashtable
Private bIsDirty As Boolean = False
Private bIsLoading As Boolean = False
Private oCurrentTag As clsTag
Private Property IsDirty As Boolean
Get
Return bIsDirty
End Get
Set(value As Boolean)
bIsDirty = value
End Set
End Property
Private Property IsLoading As Boolean
Get
Return bIsLoading
End Get
Set(value As Boolean)
bIsLoading = value
End Set
End Property
Private Enum eModes As Integer
View = 1
Edit = 2
Add = 3
Disabled = 4
End Enum
Private eCurrentMode As eModes = eModes.Disabled
Private Property TagData As Hashtable
Get
Return hshTagData
End Get
Set(value As Hashtable)
hshTagData = value
End Set
End Property
Private Sub LoadData()
TagData = mgrTags.ReadTags
lstTags.Items.Clear()
FormatAndFillList()
End Sub
Private Function HandleDirty() As MsgBoxResult
Dim oResult As MsgBoxResult
oResult = MsgBox("There are unsaved changes on this form. Do you want to save?", MsgBoxStyle.YesNoCancel, "Game Backup Monitor")
Select Case oResult
Case MsgBoxResult.Yes
IsDirty = False
Case MsgBoxResult.No
IsDirty = False
Case MsgBoxResult.Cancel
'No Change
End Select
Return oResult
End Function
Private Sub FormatAndFillList()
IsLoading = True
For Each oTag As clsTag In TagData.Values
lstTags.Items.Add(oTag.Name)
Next
IsLoading = False
End Sub
Private Sub FillData()
IsLoading = True
oCurrentTag = DirectCast(TagData(lstTags.SelectedItems(0).ToString), clsTag)
txtID.Text = oCurrentTag.ID
txtName.Text = oCurrentTag.Name
IsLoading = False
End Sub
Private Sub DirtyCheck_ValueChanged(sender As Object, e As EventArgs)
If Not IsLoading Then
IsDirty = True
If Not eCurrentMode = eModes.Add Then EditTag()
End If
End Sub
Private Sub AssignDirtyHandlers(ByVal oCtls As GroupBox.ControlCollection)
For Each ctl As Control In oCtls
If TypeOf ctl Is TextBox Then
AddHandler DirectCast(ctl, TextBox).TextChanged, AddressOf DirtyCheck_ValueChanged
End If
Next
End Sub
Private Sub WipeControls(ByVal oCtls As GroupBox.ControlCollection)
For Each ctl As Control In oCtls
If TypeOf ctl Is TextBox Then
DirectCast(ctl, TextBox).Text = String.Empty
End If
Next
txtID.Text = String.Empty
End Sub
Private Sub ModeChange()
IsLoading = True
Select Case eCurrentMode
Case eModes.Add
grpTag.Enabled = True
WipeControls(grpTag.Controls)
btnSave.Enabled = True
btnCancel.Enabled = True
btnAdd.Enabled = False
btnDelete.Enabled = False
lstTags.Enabled = False
Case eModes.Edit
lstTags.Enabled = False
grpTag.Enabled = True
btnSave.Enabled = True
btnCancel.Enabled = True
btnAdd.Enabled = False
btnDelete.Enabled = False
Case eModes.View
lstTags.Enabled = True
grpTag.Enabled = True
btnSave.Enabled = False
btnCancel.Enabled = False
btnAdd.Enabled = True
btnDelete.Enabled = True
Case eModes.Disabled
lstTags.Enabled = True
WipeControls(grpTag.Controls)
grpTag.Enabled = False
btnSave.Enabled = False
btnCancel.Enabled = False
btnAdd.Enabled = True
btnDelete.Enabled = True
End Select
IsLoading = False
End Sub
Private Sub EditTag()
eCurrentMode = eModes.Edit
ModeChange()
End Sub
Private Sub AddTag()
eCurrentMode = eModes.Add
ModeChange()
txtName.Focus()
End Sub
Private Sub CancelEdit()
If bIsDirty Then
Select Case HandleDirty()
Case MsgBoxResult.Yes
SaveTag()
Case MsgBoxResult.No
If lstTags.SelectedItems.Count > 0 Then
eCurrentMode = eModes.View
ModeChange()
FillData()
lstTags.Focus()
Else
eCurrentMode = eModes.Disabled
ModeChange()
End If
Case MsgBoxResult.Cancel
'Do Nothing
End Select
Else
If lstTags.SelectedItems.Count > 0 Then
eCurrentMode = eModes.View
ModeChange()
FillData()
lstTags.Focus()
Else
eCurrentMode = eModes.Disabled
ModeChange()
End If
End If
End Sub
Private Sub SaveTag()
Dim oTag As New clsTag
Dim bSuccess As Boolean = False
If txtID.Text <> String.Empty Then
oTag.ID = txtID.Text
End If
oTag.Name = txtName.Text
Select Case eCurrentMode
Case eModes.Add
If CoreValidatation(oTag) Then
bSuccess = True
mgrTags.DoTagAdd(oTag)
eCurrentMode = eModes.View
End If
Case eModes.Edit
If CoreValidatation(oTag) Then
bSuccess = True
mgrTags.DoTagUpdate(oTag)
eCurrentMode = eModes.View
End If
End Select
If bSuccess Then
IsDirty = False
LoadData()
ModeChange()
If eCurrentMode = eModes.View Then lstTags.SelectedIndex = lstTags.Items.IndexOf(oTag.Name)
End If
End Sub
Private Sub DeleteTag()
Dim oTag As clsTag
If lstTags.SelectedItems.Count > 0 Then
oTag = DirectCast(TagData(lstTags.SelectedItems(0).ToString), clsTag)
If MsgBox("Are you sure you want to delete " & oTag.Name & "? This cannot be undone." & vbCrLf & vbCrLf & "All games using this tag will have it removed.", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then
mgrTags.DoTagDelete(oTag.ID)
LoadData()
eCurrentMode = eModes.Disabled
ModeChange()
End If
End If
End Sub
Private Sub SwitchTag()
If lstTags.SelectedItems.Count > 0 Then
eCurrentMode = eModes.View
FillData()
ModeChange()
End If
End Sub
Private Function CoreValidatation(ByVal oTag As clsTag) As Boolean
If txtName.Text = String.Empty Then
MsgBox("You must enter a valid tag name.", MsgBoxStyle.Exclamation, "Game Backup Monitor")
txtName.Focus()
Return False
End If
If mgrTags.DoCheckDuplicate(oTag.Name, oTag.ID) Then
MsgBox("A tag with this name already exists.", MsgBoxStyle.Exclamation, "Game Backup Monitor")
txtName.Focus()
Return False
End If
Return True
End Function
Private Sub frmTags_Load(sender As Object, e As EventArgs) Handles MyBase.Load
LoadData()
ModeChange()
AssignDirtyHandlers(grpTag.Controls)
End Sub
Private Sub lstTags_SelectedIndexChanged(sender As Object, e As EventArgs) Handles lstTags.SelectedIndexChanged
SwitchTag()
End Sub
Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click
AddTag()
End Sub
Private Sub btnDelete_Click(sender As Object, e As EventArgs) Handles btnDelete.Click
DeleteTag()
End Sub
Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
SaveTag()
End Sub
Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
CancelEdit()
End Sub
Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click
Me.Close()
End Sub
Private Sub frmTags_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
If bIsDirty Then
Select Case HandleDirty()
Case MsgBoxResult.Yes
SaveTag()
Case MsgBoxResult.No
'Do Nothing
Case MsgBoxResult.Cancel
e.Cancel = True
End Select
End If
End Sub
End Class
+6 -6
View File
@@ -51,7 +51,7 @@ Partial Class frmVariableManager
'
Me.btnDelete.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.btnDelete.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnDelete.Location = New System.Drawing.Point(48, 227)
Me.btnDelete.Location = New System.Drawing.Point(48, 226)
Me.btnDelete.Name = "btnDelete"
Me.btnDelete.Size = New System.Drawing.Size(30, 23)
Me.btnDelete.TabIndex = 2
@@ -62,7 +62,7 @@ Partial Class frmVariableManager
'
Me.btnAdd.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.btnAdd.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnAdd.Location = New System.Drawing.Point(12, 227)
Me.btnAdd.Location = New System.Drawing.Point(12, 226)
Me.btnAdd.Name = "btnAdd"
Me.btnAdd.Size = New System.Drawing.Size(30, 23)
Me.btnAdd.TabIndex = 1
@@ -72,7 +72,7 @@ Partial Class frmVariableManager
'btnClose
'
Me.btnClose.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnClose.Location = New System.Drawing.Point(497, 227)
Me.btnClose.Location = New System.Drawing.Point(497, 226)
Me.btnClose.Name = "btnClose"
Me.btnClose.Size = New System.Drawing.Size(75, 23)
Me.btnClose.TabIndex = 6
@@ -137,7 +137,7 @@ Partial Class frmVariableManager
'btnCancel
'
Me.btnCancel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnCancel.Location = New System.Drawing.Point(497, 95)
Me.btnCancel.Location = New System.Drawing.Point(497, 94)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(75, 23)
Me.btnCancel.TabIndex = 5
@@ -147,7 +147,7 @@ Partial Class frmVariableManager
'btnSave
'
Me.btnSave.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnSave.Location = New System.Drawing.Point(416, 95)
Me.btnSave.Location = New System.Drawing.Point(416, 94)
Me.btnSave.Name = "btnSave"
Me.btnSave.Size = New System.Drawing.Size(75, 23)
Me.btnSave.TabIndex = 4
@@ -168,7 +168,7 @@ Partial Class frmVariableManager
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(584, 262)
Me.ClientSize = New System.Drawing.Size(584, 261)
Me.Controls.Add(Me.txtID)
Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.btnSave)
+33
View File
@@ -113,15 +113,25 @@
<Import Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Compile Include="Classes\XML Serialize Classes\Tag.vb" />
<Compile Include="Classes\XML Serialize Classes\Game.vb" />
<Compile Include="Classes\clsGameTag.vb" />
<Compile Include="Classes\clsPathVariable.vb" />
<Compile Include="Classes\clsBackup.vb" />
<Compile Include="Classes\clsGame.vb" />
<Compile Include="Classes\clsTag.vb" />
<Compile Include="Forms\frmAdvancedImport.Designer.vb">
<DependentUpon>frmAdvancedImport.vb</DependentUpon>
</Compile>
<Compile Include="Forms\frmAdvancedImport.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\frmFilter.Designer.vb">
<DependentUpon>frmFilter.vb</DependentUpon>
</Compile>
<Compile Include="Forms\frmFilter.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\frmGameManager.Designer.vb">
<DependentUpon>frmGameManager.vb</DependentUpon>
</Compile>
@@ -134,6 +144,12 @@
<Compile Include="Forms\frmFileFolderSearch.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\frmGameTags.Designer.vb">
<DependentUpon>frmGameTags.vb</DependentUpon>
</Compile>
<Compile Include="Forms\frmGameTags.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\frmStartUpWizard.Designer.vb">
<DependentUpon>frmStartUpWizard.vb</DependentUpon>
</Compile>
@@ -165,6 +181,12 @@
<DependentUpon>frmMain.vb</DependentUpon>
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\frmTags.Designer.vb">
<DependentUpon>frmTags.vb</DependentUpon>
</Compile>
<Compile Include="Forms\frmTags.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\frmVariableManager.Designer.vb">
<DependentUpon>frmVariableManager.vb</DependentUpon>
</Compile>
@@ -172,6 +194,7 @@
<SubType>Form</SubType>
</Compile>
<Compile Include="Managers\mgrCommon.vb" />
<Compile Include="Managers\mgrGameTags.vb" />
<Compile Include="Managers\mgrHash.vb" />
<Compile Include="Managers\mgrManifest.vb" />
<Compile Include="Managers\mgrMonitorList.vb" />
@@ -180,6 +203,7 @@
<Compile Include="Managers\mgrSettings.vb" />
<Compile Include="Managers\mgrBackup.vb" />
<Compile Include="Managers\mgrSQLite.vb" />
<Compile Include="Managers\mgrTags.vb" />
<Compile Include="Managers\mgrVariables.vb" />
<Compile Include="Managers\mgrXML.vb" />
<Compile Include="Managers\mgrProcesses.vb" />
@@ -203,12 +227,18 @@
<EmbeddedResource Include="Forms\frmAdvancedImport.resx">
<DependentUpon>frmAdvancedImport.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\frmFilter.resx">
<DependentUpon>frmFilter.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\frmGameManager.resx">
<DependentUpon>frmGameManager.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\frmFileFolderSearch.resx">
<DependentUpon>frmFileFolderSearch.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\frmGameTags.resx">
<DependentUpon>frmGameTags.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\frmStartUpWizard.resx">
<DependentUpon>frmStartUpWizard.vb</DependentUpon>
<SubType>Designer</SubType>
@@ -226,6 +256,9 @@
<DependentUpon>frmMain.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\frmTags.resx">
<DependentUpon>frmTags.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\frmVariableManager.resx">
<DependentUpon>frmVariableManager.vb</DependentUpon>
</EmbeddedResource>
+6 -6
View File
@@ -173,11 +173,11 @@ Public Class mgrBackup
prs7z.StartInfo.RedirectStandardOutput = True
prs7z.StartInfo.CreateNoWindow = True
prs7z.Start()
RaiseEvent UpdateLog("Backup of " & sSavePath & " in progress...", True, ToolTipIcon.Info, True)
RaiseEvent UpdateLog("Backup of " & sSavePath & " in progress...", False, ToolTipIcon.Info, True)
While Not prs7z.StandardOutput.EndOfStream
If CancelOperation Then
prs7z.Kill()
RaiseEvent UpdateLog("Backup Aborted by user. The backup file for " & oGame.Name & " will be unusable.", False, ToolTipIcon.Error, True)
RaiseEvent UpdateLog("Backup Aborted. The backup file for " & oGame.Name & " will be unusable.", True, ToolTipIcon.Error, True)
Exit While
End If
RaiseEvent UpdateLog(prs7z.StandardOutput.ReadLine, False, ToolTipIcon.Info, False)
@@ -188,13 +188,13 @@ Public Class mgrBackup
RaiseEvent UpdateLog(oGame.Name & " backup completed.", False, ToolTipIcon.Info, True)
bBackupCompleted = True
Else
RaiseEvent UpdateLog(oGame.Name & " backup operation finished with warnings or errors.", False, ToolTipIcon.Error, True)
RaiseEvent UpdateLog(oGame.Name & " backup finished with warnings or errors.", True, ToolTipIcon.Warning, True)
bBackupCompleted = False
End If
End If
prs7z.Dispose()
Else
RaiseEvent UpdateLog("Backup Aborted. The path " & sSavePath & " for " & oGame.Name & " does not exist.", False, ToolTipIcon.Error, True)
RaiseEvent UpdateLog("Backup Aborted. The saved game path for " & oGame.Name & " does not exist.", True, ToolTipIcon.Error, True)
bBackupCompleted = False
End If
@@ -206,7 +206,7 @@ Public Class mgrBackup
End If
If Not DoManifestUpdate(oGame, sBackupFile, dTimeStamp, sHash) Then
RaiseEvent UpdateLog("The manifest update for " & oGame.Name & " failed.", False, ToolTipIcon.Error, True)
RaiseEvent UpdateLog("The manifest update for " & oGame.Name & " failed.", True, ToolTipIcon.Error, True)
End If
'Write the process path if we have it
@@ -215,7 +215,7 @@ Public Class mgrBackup
End If
End If
Catch ex As Exception
RaiseEvent UpdateLog("An unexpected error occured during the backup process of " & oGame.Name & vbCrLf & ex.Message, False, ToolTipIcon.Error, True)
RaiseEvent UpdateLog("An unexpected error occured during the backup of " & oGame.Name & vbCrLf & ex.Message, False, ToolTipIcon.Error, True)
End Try
End If
+284
View File
@@ -0,0 +1,284 @@
Public Class mgrGameTags
Public Shared Sub DoGameTagAdd(ByVal oGameTag As clsGameTag, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local)
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String
Dim hshParams As New Hashtable
sSQL = "INSERT INTO gametags VALUES (@TagID, @MonitorID)"
hshParams.Add("TagID", oGameTag.TagID)
hshParams.Add("MonitorID", oGameTag.MonitorID)
oDatabase.RunParamQuery(sSQL, hshParams)
End Sub
Public Shared Sub DoGameTagAddBatch(ByVal oGameTags As List(Of clsGameTag))
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSQL As String
Dim hshParams As Hashtable
Dim oParamList As New List(Of Hashtable)
sSQL = "INSERT INTO gametags VALUES (@TagID, @MonitorID);"
For Each oGameTag As clsGameTag In oGameTags
hshParams = New Hashtable
hshParams.Add("TagID", oGameTag.TagID)
hshParams.Add("MonitorID", oGameTag.MonitorID)
oParamList.Add(hshParams)
Next
oDatabase.RunMassParamQuery(sSQL, oParamList)
End Sub
Public Shared Sub DoGameTagDelete(ByVal oGameTags As List(Of clsGameTag))
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSQL As String
Dim hshParams As Hashtable
Dim oParamList As New List(Of Hashtable)
sSQL = "DELETE FROM gametags "
sSQL &= "WHERE TagID = @TagID AND MonitorID = @MonitorID;"
For Each oGameTag As clsGameTag In oGameTags
hshParams = New Hashtable
hshParams.Add("TagID", oGameTag.TagID)
hshParams.Add("MonitorID", oGameTag.MonitorID)
oParamList.Add(hshParams)
Next
oDatabase.RunMassParamQuery(sSQL, oParamList)
End Sub
Public Shared Sub DoGameTagDeleteByGame(ByVal sMonitorID As String)
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSQL As String
Dim hshParams As New Hashtable
sSQL = "DELETE FROM gametags "
sSQL &= "WHERE MonitorID = @ID;"
hshParams.Add("ID", sMonitorID)
oDatabase.RunParamQuery(sSQL, hshParams)
End Sub
Public Shared Sub DoGameTagDeleteByTag(ByVal sTagID As String)
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSQL As String
Dim hshParams As New Hashtable
sSQL = "DELETE FROM gametags "
sSQL &= "WHERE TagID = @ID;"
hshParams.Add("ID", sTagID)
oDatabase.RunParamQuery(sSQL, hshParams)
End Sub
Public Shared Function GetTagsByGame(ByVal sMonitorID As String) As Hashtable
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim oData As DataSet
Dim sSQL As String
Dim hshList As New Hashtable
Dim hshParams As New Hashtable
Dim oTag As clsTag
sSQL = "SELECT TagID, tags.Name FROM gametags NATURAL JOIN tags WHERE MonitorID = @ID"
hshParams.Add("ID", sMonitorID)
oData = oDatabase.ReadParamData(sSQL, hshParams)
For Each dr As DataRow In oData.Tables(0).Rows
oTag = New clsTag
oTag.ID = CStr(dr("TagID"))
oTag.Name = CStr(dr("Name"))
hshList.Add(oTag.Name, oTag)
Next
Return hshList
End Function
Public Shared Function GetTagsByGameForExport(ByVal sMonitorID As String) As List(Of Tag)
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim oData As DataSet
Dim sSQL As String
Dim oList As New List(Of Tag)
Dim hshParams As New Hashtable
Dim oTag As Tag
sSQL = "SELECT TagID, tags.Name FROM gametags NATURAL JOIN tags WHERE MonitorID = @ID"
hshParams.Add("ID", sMonitorID)
oData = oDatabase.ReadParamData(sSQL, hshParams)
For Each dr As DataRow In oData.Tables(0).Rows
oTag = New Tag
oTag.Name = CStr(dr("Name"))
oList.Add(oTag)
Next
Return oList
End Function
Public Shared Function GetTagsByGameMulti(ByVal sMonitorIDs As List(Of String)) As Hashtable
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim oData As DataSet
Dim sSQL As String
Dim hshList As New Hashtable
Dim hshParams As New Hashtable
Dim oTag As clsTag
Dim iCounter As Integer
sSQL = "SELECT DISTINCT TagID, tags.Name FROM gametags NATURAL JOIN tags WHERE MonitorID IN ("
For Each s As String In sMonitorIDs
sSQL &= "@MonitorID" & iCounter & ","
hshParams.Add("MonitorID" & iCounter, s)
iCounter += 1
Next
sSQL = sSQL.TrimEnd(",")
sSQL &= ")"
oData = oDatabase.ReadParamData(sSQL, hshParams)
For Each dr As DataRow In oData.Tables(0).Rows
oTag = New clsTag
oTag.ID = CStr(dr(0))
oTag.Name = CStr(dr(1))
hshList.Add(oTag.Name, oTag)
Next
Return hshList
End Function
Public Shared Function ReadGameTags(Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) As Hashtable
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim oData As DataSet
Dim sSQL As String
Dim sCompoundKey As String
Dim hshList As New Hashtable
Dim oGameTag As clsGameTag
sSQL = "SELECT * from gametags"
oData = oDatabase.ReadParamData(sSQL, New Hashtable)
For Each dr As DataRow In oData.Tables(0).Rows
oGameTag = New clsGameTag
oGameTag.TagID = CStr(dr("TagID"))
oGameTag.MonitorID = CStr(dr("MonitorID"))
sCompoundKey = oGameTag.TagID & ":" & oGameTag.MonitorID
hshList.Add(sCompoundKey, oGameTag)
Next
Return hshList
End Function
Public Shared Sub DoGameTagAddSync(ByVal hshTags As Hashtable, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local)
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String
Dim hshParams As Hashtable
Dim oParamList As New List(Of Hashtable)
sSQL = "INSERT INTO gametags VALUES (@TagID, @MonitorID);"
For Each oGameTag As clsGameTag In hshTags.Values
hshParams = New Hashtable
hshParams.Add("TagID", oGameTag.TagID)
hshParams.Add("MonitorID", oGameTag.MonitorID)
oParamList.Add(hshParams)
Next
oDatabase.RunMassParamQuery(sSQL, oParamList)
End Sub
Public Shared Sub DoGameTagDeleteSync(ByVal hshTags As Hashtable, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local)
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String
Dim hshParams As Hashtable
Dim oParamList As New List(Of Hashtable)
sSQL = "DELETE FROM gametags "
sSQL &= "WHERE TagID = @TagID AND MonitorID = @MonitorID;"
For Each oGameTag As clsGameTag In hshTags.Values
hshParams = New Hashtable
hshParams.Add("TagID", oGameTag.TagID)
hshParams.Add("MonitorID", oGameTag.MonitorID)
oParamList.Add(hshParams)
Next
oDatabase.RunMassParamQuery(sSQL, oParamList)
End Sub
Public Shared Function SyncGameTags(Optional ByVal bToRemote As Boolean = True) As Integer
Dim hshCompareFrom As Hashtable
Dim hshCompareTo As Hashtable
Dim hshSyncItems As Hashtable
Dim hshDeleteItems As Hashtable
Dim oFromItem As clsGameTag
Dim oToItem As clsGameTag
Dim sCompoundKey As String
'Add / Update Sync
If bToRemote Then
hshCompareFrom = ReadGameTags(mgrSQLite.Database.Local)
hshCompareTo = ReadGameTags(mgrSQLite.Database.Remote)
Else
hshCompareFrom = ReadGameTags(mgrSQLite.Database.Remote)
hshCompareTo = ReadGameTags(mgrSQLite.Database.Local)
End If
hshSyncItems = hshCompareFrom.Clone
For Each oFromItem In hshCompareFrom.Values
sCompoundKey = oFromItem.TagID & ":" & oFromItem.MonitorID
If hshCompareTo.Contains(sCompoundKey) Then
oToItem = DirectCast(hshCompareTo(sCompoundKey), clsGameTag)
If oFromItem.CoreEquals(oToItem) Then
hshSyncItems.Remove(sCompoundKey)
End If
End If
Next
If bToRemote Then
DoGameTagAddSync(hshSyncItems, mgrSQLite.Database.Remote)
Else
DoGameTagAddSync(hshSyncItems, mgrSQLite.Database.Local)
End If
'Delete Sync
If bToRemote Then
hshCompareFrom = ReadGameTags(mgrSQLite.Database.Local)
hshCompareTo = ReadGameTags(mgrSQLite.Database.Remote)
Else
hshCompareFrom = ReadGameTags(mgrSQLite.Database.Remote)
hshCompareTo = ReadGameTags(mgrSQLite.Database.Local)
End If
hshDeleteItems = hshCompareTo.Clone
For Each oToItem In hshCompareTo.Values
sCompoundKey = oToItem.TagID & ":" & oToItem.MonitorID
If hshCompareFrom.Contains(sCompoundKey) Then
oFromItem = DirectCast(hshCompareFrom(sCompoundKey), clsGameTag)
If oToItem.CoreEquals(oFromItem) Then
hshDeleteItems.Remove(sCompoundKey)
End If
End If
Next
If bToRemote Then
DoGameTagDeleteSync(hshDeleteItems, mgrSQLite.Database.Remote)
Else
DoGameTagDeleteSync(hshDeleteItems, mgrSQLite.Database.Local)
End If
Return hshDeleteItems.Count + hshSyncItems.Count
End Function
End Class
+16 -16
View File
@@ -14,14 +14,14 @@ Public Class mgrManifest
For Each dr As DataRow In oData.Tables(0).Rows
oBackupItem = New clsBackup
oBackupItem.ID = CStr(dr(0))
oBackupItem.Name = CStr(dr(1))
oBackupItem.FileName = CStr(dr(2))
oBackupItem.RestorePath = CStr(dr(3))
oBackupItem.AbsolutePath = CBool(dr(4))
oBackupItem.DateUpdated = mgrCommon.UnixToDate(dr(5))
oBackupItem.UpdatedBy = CStr(dr(6))
If Not IsDBNull(dr(7)) Then oBackupItem.CheckSum = CStr(dr(7))
oBackupItem.ID = CStr(dr("ManifestID"))
oBackupItem.Name = CStr(dr("Name"))
oBackupItem.FileName = CStr(dr("FileName"))
oBackupItem.RestorePath = CStr(dr("RestorePath"))
oBackupItem.AbsolutePath = CBool(dr("AbsolutePath"))
oBackupItem.DateUpdated = mgrCommon.UnixToDate(dr("DateUpdated"))
oBackupItem.UpdatedBy = CStr(dr("UpdatedBy"))
If Not IsDBNull(dr("CheckSum")) Then oBackupItem.CheckSum = CStr(dr("CheckSum"))
slList.Add(oBackupItem.Name, oBackupItem)
Next
@@ -66,14 +66,14 @@ Public Class mgrManifest
For Each dr As DataRow In oData.Tables(0).Rows
oBackupItem = New clsBackup
oBackupItem.ID = CStr(dr(0))
oBackupItem.Name = CStr(dr(1))
oBackupItem.FileName = CStr(dr(2))
oBackupItem.RestorePath = CStr(dr(3))
oBackupItem.AbsolutePath = CBool(dr(4))
oBackupItem.DateUpdated = mgrCommon.UnixToDate(dr(5))
oBackupItem.UpdatedBy = CStr(dr(6))
If Not IsDBNull(dr(7)) Then oBackupItem.CheckSum = CStr(dr(7))
oBackupItem.ID = CStr(dr("ManifestID"))
oBackupItem.Name = CStr(dr("Name"))
oBackupItem.FileName = CStr(dr("FileName"))
oBackupItem.RestorePath = CStr(dr("RestorePath"))
oBackupItem.AbsolutePath = CBool(dr("AbsolutePath"))
oBackupItem.DateUpdated = mgrCommon.UnixToDate(dr("DateUpdated"))
oBackupItem.UpdatedBy = CStr(dr("UpdatedBy"))
If Not IsDBNull(dr("CheckSum")) Then oBackupItem.CheckSum = CStr(dr("CheckSum"))
Next
Return oBackupItem
+355 -205
View File
@@ -5,7 +5,6 @@ Public Class mgrMonitorList
Public Enum eListTypes As Integer
FullList = 1
ScanList = 2
ListByKey = 3
End Enum
Public Shared Event UpdateLog(sLogUpdate As String, bTrayUpdate As Boolean, objIcon As System.Windows.Forms.ToolTipIcon, bTimeStamp As Boolean)
@@ -39,13 +38,164 @@ Public Class mgrMonitorList
End If
End Sub
Public Shared Sub ExportMonitorList(ByVal sLocation As String)
Dim frm As New frmFilter
Dim oList As List(Of Game)
Dim bSuccess As Boolean = False
frm.ShowDialog()
oList = ReadListForExport(frm.Filters, frm.FilterType)
bSuccess = mgrXML.SerializeAndExport(oList, sLocation)
If bSuccess Then
MsgBox("Export Complete. " & oList.Count & " item(s) have been exported.", MsgBoxStyle.Information, "Game Backup Monitor")
End If
End Sub
Public Shared Sub DoListAddUpdateSync(ByVal hshGames As Hashtable, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local)
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String
Dim hshParams As Hashtable
Dim oParamList As New List(Of Hashtable)
sSQL = "INSERT OR REPLACE INTO monitorlist (MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, Hours, Enabled, MonitorOnly) "
sSQL &= "VALUES (@ID, @Name, @Process, @Path, @AbsolutePath, @FolderSave, @FileType, "
sSQL &= "@TimeStamp, @ExcludeList, @Hours, @Enabled, @MonitorOnly);"
For Each oGame As clsGame In hshGames.Values
hshParams = New Hashtable
'Parameters
hshParams.Add("ID", oGame.ID)
hshParams.Add("Name", oGame.Name)
hshParams.Add("Process", oGame.TrueProcess)
hshParams.Add("Path", oGame.TruePath)
hshParams.Add("AbsolutePath", oGame.AbsolutePath)
hshParams.Add("FolderSave", oGame.FolderSave)
hshParams.Add("FileType", oGame.FileType)
hshParams.Add("TimeStamp", oGame.AppendTimeStamp)
hshParams.Add("ExcludeList", oGame.ExcludeList)
hshParams.Add("Hours", oGame.Hours)
'Required Defaults
hshParams.Add("Enabled", True)
hshParams.Add("MonitorOnly", False)
oParamList.Add(hshParams)
Next
oDatabase.RunMassParamQuery(sSQL, oParamList)
End Sub
Public Shared Sub DoListDeleteSync(ByVal hshGames As Hashtable, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local)
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String
Dim hshParams As Hashtable
Dim oParamList As New List(Of Hashtable)
sSQL = "DELETE FROM gametags "
sSQL &= "WHERE MonitorID = @MonitorID;"
sSQL &= "DELETE FROM monitorlist "
sSQL &= "WHERE Name = @Name AND Process= @Process;"
For Each oGame As clsGame In hshGames.Values
hshParams = New Hashtable
hshParams.Add("MonitorID", oGame.ID)
hshParams.Add("Name", oGame.Name)
hshParams.Add("Process", oGame.TrueProcess)
oParamList.Add(hshParams)
Next
oDatabase.RunMassParamQuery(sSQL, oParamList)
End Sub
Public Shared Sub SyncMonitorLists(Optional ByVal bToRemote As Boolean = True)
Dim hshCompareFrom As Hashtable
Dim hshCompareTo As Hashtable
Dim hshSyncItems As Hashtable
Dim hshDeleteItems As Hashtable
Dim oFromItem As clsGame
Dim oToItem As clsGame
Dim iChanges As Integer
Cursor.Current = Cursors.WaitCursor
If bToRemote Then
RaiseEvent UpdateLog("A sync to the master game list has been triggered.", False, ToolTipIcon.Info, True)
Else
RaiseEvent UpdateLog("A sync from the master game list has been triggered.", False, ToolTipIcon.Info, True)
End If
'Add / Update Sync
If bToRemote Then
hshCompareFrom = ReadList(eListTypes.FullList, mgrSQLite.Database.Local)
hshCompareTo = ReadList(eListTypes.FullList, mgrSQLite.Database.Remote)
Else
hshCompareFrom = ReadList(eListTypes.FullList, mgrSQLite.Database.Remote)
hshCompareTo = ReadList(eListTypes.FullList, mgrSQLite.Database.Local)
End If
hshSyncItems = hshCompareFrom.Clone
For Each oFromItem In hshCompareFrom.Values
If hshCompareTo.Contains(oFromItem.ProcessName) Then
oToItem = DirectCast(hshCompareTo(oFromItem.ProcessName), clsGame)
If oFromItem.SyncEquals(oToItem) Then
hshSyncItems.Remove(oFromItem.ProcessName)
End If
End If
Next
If bToRemote Then
DoListAddUpdateSync(hshSyncItems, mgrSQLite.Database.Remote)
Else
DoListAddUpdateSync(hshSyncItems, mgrSQLite.Database.Local)
End If
'Sync Tags
iChanges = mgrTags.SyncTags(bToRemote)
iChanges += mgrGameTags.SyncGameTags(bToRemote)
'Delete Sync
If bToRemote Then
hshCompareFrom = ReadList(eListTypes.FullList, mgrSQLite.Database.Local)
hshCompareTo = ReadList(eListTypes.FullList, mgrSQLite.Database.Remote)
Else
hshCompareFrom = ReadList(eListTypes.FullList, mgrSQLite.Database.Remote)
hshCompareTo = ReadList(eListTypes.FullList, mgrSQLite.Database.Local)
End If
hshDeleteItems = hshCompareTo.Clone
For Each oToItem In hshCompareTo.Values
If hshCompareFrom.Contains(oToItem.ProcessName) Then
oFromItem = DirectCast(hshCompareFrom(oToItem.ProcessName), clsGame)
If oToItem.MinimalEquals(oFromItem) Then
hshDeleteItems.Remove(oToItem.ProcessName)
End If
End If
Next
If bToRemote Then
DoListDeleteSync(hshDeleteItems, mgrSQLite.Database.Remote)
Else
DoListDeleteSync(hshDeleteItems, mgrSQLite.Database.Local)
End If
RaiseEvent UpdateLog(hshDeleteItems.Count + hshSyncItems.Count + iChanges & " change(s) synced.", False, ToolTipIcon.Info, True)
Cursor.Current = Cursors.Default
Application.DoEvents()
End Sub
Private Shared Sub ImportMonitorList(ByVal sLocation As String, Optional ByVal bWebRead As Boolean = False)
Dim hshCompareFrom As Hashtable
Dim hshCompareTo As Hashtable
Dim hshSyncItems As Hashtable
Dim oFromItem As clsGame
Dim oToItem As clsGame
Dim iItems As Integer = 0
Cursor.Current = Cursors.WaitCursor
@@ -71,14 +221,12 @@ Public Class mgrMonitorList
frm.ImportData = hshSyncItems
If frm.ShowDialog() = DialogResult.OK Then
Cursor.Current = Cursors.WaitCursor
For Each oGame As clsGame In frm.ImportData.Values
If Not DoDuplicateListCheck(oGame.Name, oGame.TrueProcess) Then
DoListAdd(oGame, mgrSQLite.Database.Local)
iItems += 1
End If
Next
DoListAddUpdateSync(frm.ImportData)
mgrTags.DoTagAddImport(frm.ImportData)
Cursor.Current = Cursors.Default
MsgBox("Import Complete. " & iItems & " entries have been imported.", MsgBoxStyle.Information, "Game Backup Monitor")
MsgBox("Import Complete.", MsgBoxStyle.Information, "Game Backup Monitor")
End If
Else
MsgBox("This list does not contain any new games to import.", MsgBoxStyle.Information, "Game Backup Monitor")
@@ -87,107 +235,6 @@ Public Class mgrMonitorList
Application.DoEvents()
End Sub
Public Shared Sub ExportMonitorList(ByVal sLocation As String)
Dim hshList As Hashtable = ReadList(eListTypes.FullList, mgrSQLite.Database.Local)
Dim bSuccess As Boolean
bSuccess = mgrXML.ExportMonitorList(hshList, sLocation)
If bSuccess Then
MsgBox("Export Complete. " & hshList.Count & " entries have been exported.", MsgBoxStyle.Information, "Game Backup Monitor")
End If
End Sub
Public Shared Sub SyncMonitorLists(Optional ByVal bToRemote As Boolean = True)
Dim hshCompareFrom As Hashtable
Dim hshCompareTo As Hashtable
Dim hshSyncItems As Hashtable
Dim hshDeleteItems As Hashtable
Dim oFromItem As clsGame
Dim oToItem As clsGame
Cursor.Current = Cursors.WaitCursor
If bToRemote Then
RaiseEvent UpdateLog("A sync to the master game list has been triggered.", False, ToolTipIcon.Info, True)
Else
RaiseEvent UpdateLog("A sync from the master game list has been triggered.", False, ToolTipIcon.Info, True)
End If
'Delete Sync
If bToRemote Then
hshCompareFrom = ReadList(eListTypes.FullList, mgrSQLite.Database.Local)
hshCompareTo = ReadList(eListTypes.FullList, mgrSQLite.Database.Remote)
Else
hshCompareFrom = ReadList(eListTypes.FullList, mgrSQLite.Database.Remote)
hshCompareTo = ReadList(eListTypes.FullList, mgrSQLite.Database.Local)
End If
hshDeleteItems = hshCompareTo.Clone
For Each oToItem In hshCompareTo.Values
If hshCompareFrom.Contains(oToItem.ProcessName) Then
oFromItem = DirectCast(hshCompareFrom(oToItem.ProcessName), clsGame)
If oToItem.CoreEquals(oFromItem) Then
hshDeleteItems.Remove(oToItem.ProcessName)
End If
End If
Next
For Each oGame As clsGame In hshDeleteItems.Values
If bToRemote Then
DoListDeleteSync(oGame, mgrSQLite.Database.Remote)
Else
DoListDeleteSync(oGame, mgrSQLite.Database.Local)
End If
Next
'Add / Update Sync
If bToRemote Then
hshCompareFrom = ReadList(eListTypes.FullList, mgrSQLite.Database.Local)
hshCompareTo = ReadList(eListTypes.FullList, mgrSQLite.Database.Remote)
Else
hshCompareFrom = ReadList(eListTypes.FullList, mgrSQLite.Database.Remote)
hshCompareTo = ReadList(eListTypes.FullList, mgrSQLite.Database.Local)
End If
hshSyncItems = hshCompareFrom.Clone
For Each oFromItem In hshCompareFrom.Values
If hshCompareTo.Contains(oFromItem.ProcessName) Then
oToItem = DirectCast(hshCompareTo(oFromItem.ProcessName), clsGame)
If oFromItem.SyncEquals(oToItem) Then
hshSyncItems.Remove(oFromItem.ProcessName)
End If
End If
Next
For Each oGame As clsGame In hshSyncItems.Values
'Clear Extra Data
oGame.Version = String.Empty
oGame.Company = String.Empty
oGame.ProcessPath = String.Empty
oGame.Icon = String.Empty
If bToRemote Then
If DoDuplicateListCheck(oGame.Name, oGame.TrueProcess, mgrSQLite.Database.Remote) Then
DoListUpdateSync(oGame, mgrSQLite.Database.Remote)
Else
DoListAdd(oGame, mgrSQLite.Database.Remote)
End If
Else
If DoDuplicateListCheck(oGame.Name, oGame.TrueProcess, mgrSQLite.Database.Local) Then
DoListUpdateSync(oGame, mgrSQLite.Database.Local)
Else
DoListAdd(oGame, mgrSQLite.Database.Local)
End If
End If
Next
RaiseEvent UpdateLog(hshDeleteItems.Count + hshSyncItems.Count & " change(s) synced.", False, ToolTipIcon.Info, True)
Cursor.Current = Cursors.Default
Application.DoEvents()
End Sub
Public Shared Function DoImport(ByVal sPath As String) As Boolean
If (sPath.IndexOf("http://", 0, StringComparison.CurrentCultureIgnoreCase) > -1) Or _
(sPath.IndexOf("https://", 0, StringComparison.CurrentCultureIgnoreCase) > -1) Then
@@ -207,6 +254,76 @@ Public Class mgrMonitorList
Return False
End If
End If
Return True
End Function
Public Shared Function ReadFilteredList(ByVal oFilters As List(Of clsTag), ByVal eFilterType As frmFilter.eFilterType, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) As Hashtable
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim oData As DataSet
Dim sSQL As String = String.Empty
Dim hshList As New Hashtable
Dim oGame As clsGame
Dim hshParams As New Hashtable
Dim iCounter As Integer = 0
If oFilters.Count > 0 Then
Select Case eFilterType
Case frmFilter.eFilterType.Any
sSQL = "SELECT DISTINCT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly FROM monitorlist "
sSQL &= "NATURAL JOIN gametags WHERE gametags.TagID IN ("
For Each oTag As clsTag In oFilters
sSQL &= "@TagID" & iCounter & ","
hshParams.Add("TagID" & iCounter, oTag.ID)
iCounter += 1
Next
sSQL = sSQL.TrimEnd(",")
sSQL &= ") ORDER BY Name Asc"
Case frmFilter.eFilterType.All
sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly FROM monitorlist WHERE MonitorID IN "
For Each oTag As clsTag In oFilters
sSQL &= "(SELECT MonitorID FROM gametags WHERE monitorlist.MonitorID = gametags.MonitorID And TagID = @TagID" & iCounter & ")"
If iCounter <> oFilters.Count - 1 Then
sSQL &= " AND MonitorID IN "
End If
hshParams.Add("TagID" & iCounter, oTag.ID)
iCounter += 1
Next
sSQL &= " ORDER BY Name Asc"
End Select
Else
sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly FROM monitorlist ORDER BY Name Asc"
End If
oData = oDatabase.ReadParamData(sSQL, hshParams)
For Each dr As DataRow In oData.Tables(0).Rows
oGame = New clsGame
oGame.ID = CStr(dr("MonitorID"))
oGame.Name = CStr(dr("Name"))
oGame.ProcessName = CStr(dr("Process"))
If Not IsDBNull(dr("Path")) Then oGame.Path = CStr(dr("Path"))
oGame.AbsolutePath = CBool(dr("AbsolutePath"))
oGame.FolderSave = CBool(dr("FolderSave"))
If Not IsDBNull(dr("FileType")) Then oGame.FileType = CStr(dr("FileType"))
oGame.AppendTimeStamp = CBool(dr("TimeStamp"))
If Not IsDBNull(dr("ExcludeList")) Then oGame.ExcludeList = CStr(dr("ExcludeList"))
If Not IsDBNull(dr("ProcessPath")) Then oGame.ProcessPath = CStr(dr("ProcessPath"))
If Not IsDBNull(dr("Icon")) Then oGame.Icon = CStr(dr("Icon"))
oGame.Hours = CDbl(dr("Hours"))
If Not IsDBNull(dr("Version")) Then oGame.Version = CStr(dr("Version"))
If Not IsDBNull(dr("Company")) Then oGame.Company = CStr(dr("Company"))
oGame.Enabled = CBool(dr("Enabled"))
oGame.MonitorOnly = CBool(dr("MonitorOnly"))
hshList.Add(oGame.ID, oGame)
Next
Return hshList
End Function
Public Shared Function ReadList(ByVal eListType As eListTypes, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) As Hashtable
@@ -218,27 +335,27 @@ Public Class mgrMonitorList
Dim oGame As clsGame
Dim oDupeGame As clsGame
sSQL = "SELECT * from monitorlist ORDER BY Name Asc"
sSQL = "Select * from monitorlist ORDER BY Name Asc"
oData = oDatabase.ReadParamData(sSQL, New Hashtable)
For Each dr As DataRow In oData.Tables(0).Rows
oGame = New clsGame
oGame.ID = CStr(dr(0))
oGame.Name = CStr(dr(1))
oGame.ProcessName = CStr(dr(2))
If Not IsDBNull(dr(3)) Then oGame.Path = CStr(dr(3))
oGame.AbsolutePath = CBool(dr(4))
oGame.FolderSave = CBool(dr(5))
If Not IsDBNull(dr(6)) Then oGame.FileType = CStr(dr(6))
oGame.AppendTimeStamp = CBool(dr(7))
If Not IsDBNull(dr(8)) Then oGame.ExcludeList = CStr(dr(8))
If Not IsDBNull(dr(9)) Then oGame.ProcessPath = CStr(dr(9))
If Not IsDBNull(dr(10)) Then oGame.Icon = CStr(dr(10))
oGame.Hours = CDbl(dr(11))
If Not IsDBNull(dr(12)) Then oGame.Version = CStr(dr(12))
If Not IsDBNull(dr(13)) Then oGame.Company = CStr(dr(13))
oGame.Enabled = CBool(dr(14))
oGame.MonitorOnly = CBool(dr(15))
oGame.ID = CStr(dr("MonitorID"))
oGame.Name = CStr(dr("Name"))
oGame.ProcessName = CStr(dr("Process"))
If Not IsDBNull(dr("Path")) Then oGame.Path = CStr(dr("Path"))
oGame.AbsolutePath = CBool(dr("AbsolutePath"))
oGame.FolderSave = CBool(dr("FolderSave"))
If Not IsDBNull(dr("FileType")) Then oGame.FileType = CStr(dr("FileType"))
oGame.AppendTimeStamp = CBool(dr("TimeStamp"))
If Not IsDBNull(dr("ExcludeList")) Then oGame.ExcludeList = CStr(dr("ExcludeList"))
If Not IsDBNull(dr("ProcessPath")) Then oGame.ProcessPath = CStr(dr("ProcessPath"))
If Not IsDBNull(dr("Icon")) Then oGame.Icon = CStr(dr("Icon"))
oGame.Hours = CDbl(dr("Hours"))
If Not IsDBNull(dr("Version")) Then oGame.Version = CStr(dr("Version"))
If Not IsDBNull(dr("Company")) Then oGame.Company = CStr(dr("Company"))
oGame.Enabled = CBool(dr("Enabled"))
oGame.MonitorOnly = CBool(dr("MonitorOnly"))
Select Case eListType
Case eListTypes.FullList
@@ -264,14 +381,73 @@ Public Class mgrMonitorList
End If
If oGame.Enabled Then hshList.Add(oGame.ProcessName, oGame)
Case eListTypes.ListByKey
hshList.Add(oGame.ID, oGame)
End Select
Next
Return hshList
End Function
Public Shared Function ReadListForExport(ByVal oFilters As List(Of clsTag), ByVal eFilterType As frmFilter.eFilterType, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) As List(Of Game)
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim oData As DataSet
Dim sSQL As String = String.Empty
Dim sID As String
Dim oList As New List(Of Game)
Dim oGame As Game
Dim hshParams As New Hashtable
Dim iCounter As Integer = 0
If oFilters.Count > 0 Then
Select Case eFilterType
Case frmFilter.eFilterType.Any
sSQL = "SELECT DISTINCT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly FROM monitorlist "
sSQL &= "NATURAL JOIN gametags WHERE gametags.TagID IN ("
For Each oTag As clsTag In oFilters
sSQL &= "@TagID" & iCounter & ","
hshParams.Add("TagID" & iCounter, oTag.ID)
iCounter += 1
Next
sSQL = sSQL.TrimEnd(",")
sSQL &= ") ORDER BY Name Asc"
Case frmFilter.eFilterType.All
sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly FROM monitorlist WHERE MonitorID IN "
For Each oTag As clsTag In oFilters
sSQL &= "(SELECT MonitorID FROM gametags WHERE monitorlist.MonitorID = gametags.MonitorID And TagID = @TagID" & iCounter & ")"
If iCounter <> oFilters.Count - 1 Then
sSQL &= " AND MonitorID IN "
End If
hshParams.Add("TagID" & iCounter, oTag.ID)
iCounter += 1
Next
sSQL &= " ORDER BY Name Asc"
End Select
Else
sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly FROM monitorlist ORDER BY Name Asc"
End If
oData = oDatabase.ReadParamData(sSQL, hshParams)
For Each dr As DataRow In oData.Tables(0).Rows
oGame = New Game
sID = CStr(dr("MonitorID"))
oGame.Name = CStr(dr("Name"))
oGame.ProcessName = CStr(dr("Process"))
If Not IsDBNull(dr("Path")) Then oGame.Path = CStr(dr("Path"))
oGame.AbsolutePath = CBool(dr("AbsolutePath"))
oGame.FolderSave = CBool(dr("FolderSave"))
If Not IsDBNull(dr("FileType")) Then oGame.FileType = CStr(dr("FileType"))
If Not IsDBNull(dr("ExcludeList")) Then oGame.ExcludeList = CStr(dr("ExcludeList"))
oGame.Tags = mgrGameTags.GetTagsByGameForExport(sID)
oList.Add(oGame)
Next
Return oList
End Function
Public Shared Sub DoListAdd(ByVal oGame As clsGame, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local)
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String
@@ -358,53 +534,15 @@ Public Class mgrMonitorList
End Sub
Public Shared Sub DoListUpdateSync(ByVal oGame As clsGame, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local)
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String
Dim hshParams As New Hashtable
sSQL = "UPDATE monitorlist SET Name=@Name, Process=@Process, Path=@Path, AbsolutePath=@AbsolutePath, FolderSave=@FolderSave, "
sSQL &= "FileType=@FileType, TimeStamp=@TimeStamp, ExcludeList=@ExcludeList, Hours=@Hours "
sSQL &= "WHERE Name=@QueryName AND Process=@QueryProcess"
'Parameters
hshParams.Add("Name", oGame.Name)
hshParams.Add("Process", oGame.TrueProcess)
hshParams.Add("Path", oGame.TruePath)
hshParams.Add("AbsolutePath", oGame.AbsolutePath)
hshParams.Add("FolderSave", oGame.FolderSave)
hshParams.Add("FileType", oGame.FileType)
hshParams.Add("TimeStamp", oGame.AppendTimeStamp)
hshParams.Add("ExcludeList", oGame.ExcludeList)
hshParams.Add("Hours", oGame.Hours)
hshParams.Add("QueryName", oGame.Name)
hshParams.Add("QueryProcess", oGame.TrueProcess)
oDatabase.RunParamQuery(sSQL, hshParams)
End Sub
Public Shared Sub DoListDeleteSync(ByVal oGame As clsGame, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local)
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String
Dim hshParams As New Hashtable
sSQL = "DELETE FROM monitorlist "
sSQL &= "WHERE Name = @Name AND Process= @Process"
hshParams.Add("Name", oGame.Name)
hshParams.Add("Process", oGame.TrueProcess)
oDatabase.RunParamQuery(sSQL, hshParams)
End Sub
Public Shared Sub DoListDelete(ByVal sMonitorID As String, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local)
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String
Dim hshParams As New Hashtable
sSQL = "DELETE FROM monitorlist "
sSQL &= "WHERE MonitorID = @MonitorID"
sSQL = "DELETE FROM gametags "
sSQL &= "WHERE MonitorID = @MonitorID;"
sSQL &= "DELETE FROM monitorlist "
sSQL &= "WHERE MonitorID = @MonitorID;"
hshParams.Add("MonitorID", sMonitorID)
@@ -418,7 +556,7 @@ Public Class mgrMonitorList
Dim hshParams As New Hashtable
Dim iCounter As Integer
sSQL = "DELETE FROM monitorlist "
sSQL = "DELETE FROM gametags "
sSQL &= "WHERE MonitorID IN ("
For Each s As String In sMonitorIDs
@@ -428,7 +566,19 @@ Public Class mgrMonitorList
Next
sSQL = sSQL.TrimEnd(",")
sSQL &= ")"
sSQL &= ");"
sSQL &= "DELETE FROM monitorlist "
sSQL &= "WHERE MonitorID IN ("
For Each s As String In sMonitorIDs
sSQL &= "@MonitorID" & iCounter & ","
hshParams.Add("MonitorID" & iCounter, s)
iCounter += 1
Next
sSQL = sSQL.TrimEnd(",")
sSQL &= ");"
oDatabase.RunParamQuery(sSQL, hshParams)
End Sub
@@ -449,22 +599,22 @@ Public Class mgrMonitorList
For Each dr As DataRow In oData.Tables(0).Rows
oGame = New clsGame
oGame.ID = CStr(dr(0))
oGame.Name = CStr(dr(1))
oGame.ProcessName = CStr(dr(2))
If Not IsDBNull(dr(3)) Then oGame.Path = CStr(dr(3))
oGame.AbsolutePath = CBool(dr(4))
oGame.FolderSave = CBool(dr(5))
If Not IsDBNull(dr(6)) Then oGame.FileType = CStr(dr(6))
oGame.AppendTimeStamp = CBool(dr(7))
If Not IsDBNull(dr(8)) Then oGame.ExcludeList = CStr(dr(8))
If Not IsDBNull(dr(9)) Then oGame.ProcessPath = CStr(dr(9))
If Not IsDBNull(dr(10)) Then oGame.Icon = CStr(dr(10))
oGame.Hours = CDbl(dr(11))
If Not IsDBNull(dr(12)) Then oGame.Version = CStr(dr(12))
If Not IsDBNull(dr(13)) Then oGame.Company = CStr(dr(13))
oGame.Enabled = CBool(dr(14))
oGame.MonitorOnly = CBool(dr(15))
oGame.ID = CStr(dr("MonitorID"))
oGame.Name = CStr(dr("Name"))
oGame.ProcessName = CStr(dr("Process"))
If Not IsDBNull(dr("Path")) Then oGame.Path = CStr(dr("Path"))
oGame.AbsolutePath = CBool(dr("AbsolutePath"))
oGame.FolderSave = CBool(dr("FolderSave"))
If Not IsDBNull(dr("FileType")) Then oGame.FileType = CStr(dr("FileType"))
oGame.AppendTimeStamp = CBool(dr("TimeStamp"))
If Not IsDBNull(dr("ExcludeList")) Then oGame.ExcludeList = CStr(dr("ExcludeList"))
If Not IsDBNull(dr("ProcessPath")) Then oGame.ProcessPath = CStr(dr("ProcessPath"))
If Not IsDBNull(dr("Icon")) Then oGame.Icon = CStr(dr("Icon"))
oGame.Hours = CDbl(dr("Hours"))
If Not IsDBNull(dr("Version")) Then oGame.Version = CStr(dr("Version"))
If Not IsDBNull(dr("Company")) Then oGame.Company = CStr(dr("Company"))
oGame.Enabled = CBool(dr("Enabled"))
oGame.MonitorOnly = CBool(dr("MonitorOnly"))
Next
Return oGame
@@ -488,22 +638,22 @@ Public Class mgrMonitorList
For Each dr As DataRow In oData.Tables(0).Rows
oGame = New clsGame
oGame.ID = CStr(dr(0))
oGame.Name = CStr(dr(1))
oGame.ProcessName = CStr(dr(2))
If Not IsDBNull(dr(3)) Then oGame.Path = CStr(dr(3))
oGame.AbsolutePath = CBool(dr(4))
oGame.FolderSave = CBool(dr(5))
If Not IsDBNull(dr(6)) Then oGame.FileType = CStr(dr(6))
oGame.AppendTimeStamp = CBool(dr(7))
If Not IsDBNull(dr(8)) Then oGame.ExcludeList = CStr(dr(8))
If Not IsDBNull(dr(9)) Then oGame.ProcessPath = CStr(dr(9))
If Not IsDBNull(dr(10)) Then oGame.Icon = CStr(dr(10))
oGame.Hours = CDbl(dr(11))
If Not IsDBNull(dr(12)) Then oGame.Version = CStr(dr(12))
If Not IsDBNull(dr(13)) Then oGame.Company = CStr(dr(13))
oGame.Enabled = CBool(dr(14))
oGame.MonitorOnly = CBool(dr(15))
oGame.ID = CStr(dr("MonitorID"))
oGame.Name = CStr(dr("Name"))
oGame.ProcessName = CStr(dr("Process"))
If Not IsDBNull(dr("Path")) Then oGame.Path = CStr(dr("Path"))
oGame.AbsolutePath = CBool(dr("AbsolutePath"))
oGame.FolderSave = CBool(dr("FolderSave"))
If Not IsDBNull(dr("FileType")) Then oGame.FileType = CStr(dr("FileType"))
oGame.AppendTimeStamp = CBool(dr("TimeStamp"))
If Not IsDBNull(dr("ExcludeList")) Then oGame.ExcludeList = CStr(dr("ExcludeList"))
If Not IsDBNull(dr("ProcessPath")) Then oGame.ProcessPath = CStr(dr("ProcessPath"))
If Not IsDBNull(dr("Icon")) Then oGame.Icon = CStr(dr("Icon"))
oGame.Hours = CDbl(dr("Hours"))
If Not IsDBNull(dr("Version")) Then oGame.Version = CStr(dr("Version"))
If Not IsDBNull(dr("Company")) Then oGame.Company = CStr(dr("Company"))
oGame.Enabled = CBool(dr("Enabled"))
oGame.MonitorOnly = CBool(dr("MonitorOnly"))
hshGames.Add(iCounter, oGame)
iCounter += 1
Next
+3 -3
View File
@@ -8,9 +8,9 @@ Public Class mgrPath
Private Shared sDBLocation As String = sSettingsRoot & "\gbm.s3db"
Private Shared sIncludeFile As String = sSettingsRoot & "\gbm_include.txt"
Private Shared sExcludeFile As String = sSettingsRoot & "\gbm_exclude.txt"
Private Shared sOfficialImportURL As String = "http://backupmonitor.sourceforge.net/GBM_Official.xml"
Private Shared sOfficialManualURL As String = "http://backupmonitor.sourceforge.net/manual.php"
Private Shared sOfficialUpdatesURL As String = "http://backupmonitor.sourceforge.net/"
Private Shared sOfficialImportURL As String = "http://mikemaximus.github.io/gbm-web/GBM_Official.xml"
Private Shared sOfficialManualURL As String = "http://mikemaximus.github.io/gbm-web/manual.html"
Private Shared sOfficialUpdatesURL As String = "https://github.com/MikeMaximus/gbm/releases"
Private Shared sRemoteDatabaseLocation As String
Private Shared hshCustomVariables As Hashtable
Private Shared oReleaseType As ProcessorArchitecture = AssemblyName.GetAssemblyName(Application.ExecutablePath()).ProcessorArchitecture
+5 -5
View File
@@ -208,11 +208,11 @@ Public Class mgrRestore
prs7z.StartInfo.RedirectStandardOutput = True
prs7z.StartInfo.CreateNoWindow = True
prs7z.Start()
RaiseEvent UpdateLog("Restore to " & sExtractPath & " in progress...", True, ToolTipIcon.Info, True)
RaiseEvent UpdateLog("Restore to " & sExtractPath & " in progress...", False, ToolTipIcon.Info, True)
While Not prs7z.StandardOutput.EndOfStream
If CancelOperation Then
prs7z.Kill()
RaiseEvent UpdateLog("Restored Aborted by user. The save games for " & oBackupInfo.Name & " will be damaged or invalid.", False, ToolTipIcon.Error, True)
RaiseEvent UpdateLog("Restored Aborted. The saved games for " & oBackupInfo.Name & " may now be invalid.", True, ToolTipIcon.Error, True)
Exit While
End If
RaiseEvent UpdateLog(prs7z.StandardOutput.ReadLine, False, ToolTipIcon.Info, False)
@@ -220,16 +220,16 @@ Public Class mgrRestore
prs7z.WaitForExit()
If Not CancelOperation Then
If prs7z.ExitCode = 0 Then
RaiseEvent UpdateLog(oBackupInfo.Name & " backup restored.", True, ToolTipIcon.Info, True)
RaiseEvent UpdateLog(oBackupInfo.Name & " backup restored.", False, ToolTipIcon.Info, True)
bRestoreCompleted = True
Else
RaiseEvent UpdateLog(oBackupInfo.Name & " restore operation finished with warnings or errors.", False, ToolTipIcon.Info, True)
RaiseEvent UpdateLog(oBackupInfo.Name & " restore finished with warnings or errors.", True, ToolTipIcon.Warning, True)
bRestoreCompleted = False
End If
End If
prs7z.Dispose()
Else
RaiseEvent UpdateLog("Restore Aborted. The backup file could not be found. Ensure the backup location is available.", False, ToolTipIcon.Error, True)
RaiseEvent UpdateLog("Restore Aborted. The backup file could not be found.", True, ToolTipIcon.Error, True)
End If
If bRestoreCompleted Then
+70 -1
View File
@@ -71,7 +71,7 @@ Public Class mgrSQLite
'Add Tables (Settings)
sSql = "CREATE TABLE settings (SettingsID INTEGER NOT NULL PRIMARY KEY, MonitorOnStartup BOOLEAN NOT NULL, StartToTray BOOLEAN NOT NULL, ShowDetectionToolTips BOOLEAN NOT NULL, " & _
"DisableConfirmation BOOLEAN NOT NULL, CreateSubFolder BOOLEAN NOT NULL, ShowOverwriteWarning BOOLEAN NOT NULL, RestoreOnLaunch BOOLEAN NOT NULL, " & _
"BackupFolder TEXT NOT NULL, Sync BOOLEAN NOT NULL, CheckSum BOOLEAN NOT NULL, StartWithWindows BOOLEAN NOT NULL);"
"BackupFolder TEXT NOT NULL, Sync BOOLEAN NOT NULL, CheckSum BOOLEAN NOT NULL, StartWithWindows BOOLEAN NOT NULL, TimeTracking BOOLEAN NOT NULL);"
'Add Tables (Monitor List)
sSql &= "CREATE TABLE monitorlist (MonitorID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL, Process TEXT NOT NULL, Path TEXT, " & _
@@ -79,6 +79,12 @@ Public Class mgrSQLite
"ProcessPath TEXT, Icon TEXT, Hours REAL, Version TEXT, Company TEXT, Enabled BOOLEAN NOT NULL, MonitorOnly BOOLEAN NOT NULL, " & _
"PRIMARY KEY(Name, Process));"
'Add Tables (Tags)
sSql &= "CREATE TABLE tags (TagID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL PRIMARY KEY); "
'Add Tables (Game Tags)
sSql &= "CREATE TABLE gametags (TagID TEXT NOT NULL, MonitorID TEXT NOT NULL, PRIMARY KEY(TagID, MonitorID)); "
'Add Tables (Variables)
sSql &= "CREATE TABLE variables (VariableID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL PRIMARY KEY, Path TEXT NOT NULL);"
@@ -114,6 +120,12 @@ Public Class mgrSQLite
sSql &= "CREATE TABLE manifest (ManifestID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL PRIMARY KEY, FileName TEXT NOT NULL, RestorePath TEXT NOT NULL, " & _
"AbsolutePath BOOLEAN NOT NULL, DateUpdated TEXT NOT NULL, UpdatedBy TEXT NOT NULL, CheckSum TEXT);"
'Add Tables (Remote Tags)
sSql &= "CREATE TABLE tags (TagID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL PRIMARY KEY); "
'Add Tables (Remote Game Tags)
sSql &= "CREATE TABLE gametags (TagID TEXT NOT NULL, MonitorID TEXT NOT NULL, PRIMARY KEY(TagID, MonitorID)); "
'Set Version
sSql &= "PRAGMA user_version=" & mgrCommon.AppVersion
@@ -182,6 +194,32 @@ Public Class mgrSQLite
Return True
End Function
Public Function RunMassParamQuery(ByVal sSQL As String, ByVal oParamList As List(Of Hashtable)) As Boolean
Dim trans As SQLiteTransaction
Dim command As SQLiteCommand
Connect()
command = New SQLiteCommand(sSQL, db)
trans = db.BeginTransaction()
Try
For Each hshParams In oParamList
BuildParams(command, hshParams)
command.ExecuteNonQuery()
Next
trans.Commit()
Catch e As Exception
trans.Rollback()
MsgBox("An error has occured attempting run the query." & vbCrLf & vbCrLf & sSQL & vbCrLf & vbCrLf & e.Message)
Return False
Finally
command.Dispose()
Disconnect()
End Try
Return True
End Function
Public Function ReadParamData(ByVal sSQL As String, ByVal hshParams As Hashtable) As DataSet
Dim adapter As SQLiteDataAdapter
Dim command As SQLiteCommand
@@ -411,6 +449,37 @@ Public Class mgrSQLite
End If
End If
'0.94 Upgrade
If GetDatabaseVersion() < 94 Then
If eDatabase = Database.Local Then
'Backup DB before starting
BackupDB("v93")
'Add Tags Tables
sSQL = "CREATE TABLE tags (TagID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL PRIMARY KEY); "
sSQL &= "CREATE TABLE gametags (TagID TEXT NOT NULL, MonitorID TEXT NOT NULL, PRIMARY KEY(TagID, MonitorID)); "
'Add new setting
sSQL &= "ALTER TABLE settings ADD COLUMN TimeTracking BOOLEAN NOT NULL DEFAULT 1;"
sSQL &= "PRAGMA user_version=94"
RunParamQuery(sSQL, New Hashtable)
End If
If eDatabase = Database.Remote Then
'Backup DB before starting
BackupDB("v93")
'Add Tags Tables
sSQL = "CREATE TABLE tags (TagID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL PRIMARY KEY); "
sSQL &= "CREATE TABLE gametags (TagID TEXT NOT NULL, MonitorID TEXT NOT NULL, PRIMARY KEY(TagID, MonitorID)); "
sSQL &= "PRAGMA user_version=94"
RunParamQuery(sSQL, New Hashtable)
End If
End If
End Sub
Public Function GetDBSize() As Long
+24 -12
View File
@@ -11,6 +11,7 @@ Public Class mgrSettings
Private bRestoreOnLaunch As Boolean = False
Private bSync As Boolean = True
Private bCheckSum As Boolean = True
Private bTimeTracking As Boolean = True
Private sBackupFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments).TrimEnd(New Char() {"\", "/"})
Property StartWithWindows As Boolean
@@ -103,6 +104,15 @@ Public Class mgrSettings
End Set
End Property
Property TimeTracking As Boolean
Get
Return bTimeTracking
End Get
Set(value As Boolean)
bTimeTracking = value
End Set
End Property
Property BackupFolder As String
Get
Return sBackupFolder
@@ -121,7 +131,7 @@ Public Class mgrSettings
oDatabase.RunParamQuery(sSQL, New Hashtable)
sSQL = "INSERT INTO settings VALUES (1, @MonitorOnStartup, @StartToTray, @ShowDetectionToolTips, @DisableConfirmation, "
sSQL &= "@CreateSubFolder, @ShowOverwriteWarning, @RestoreOnLaunch, @BackupFolder, @Sync, @CheckSum, @StartWithWindows)"
sSQL &= "@CreateSubFolder, @ShowOverwriteWarning, @RestoreOnLaunch, @BackupFolder, @Sync, @CheckSum, @StartWithWindows, @TimeTracking)"
hshParams.Add("MonitorOnStartup", MonitorOnStartup)
hshParams.Add("StartToTray", StartToTray)
@@ -134,6 +144,7 @@ Public Class mgrSettings
hshParams.Add("Sync", Sync)
hshParams.Add("CheckSum", CheckSum)
hshParams.Add("StartWithWindows", StartWithWindows)
hshParams.Add("TimeTracking", TimeTracking)
oDatabase.RunParamQuery(sSQL, hshParams)
End Sub
@@ -149,17 +160,18 @@ Public Class mgrSettings
oData = oDatabase.ReadParamData(sSQL, New Hashtable)
For Each dr As DataRow In oData.Tables(0).Rows
MonitorOnStartup = CBool(dr(1))
StartToTray = CBool(dr(2))
ShowDetectionToolTips = CBool(dr(3))
DisableConfirmation = CBool(dr(4))
CreateSubFolder = CBool(dr(5))
ShowOverwriteWarning = CBool(dr(6))
RestoreOnLaunch = CBool(dr(7))
BackupFolder = CStr(dr(8))
Sync = CBool(dr(9))
CheckSum = CBool(dr(10))
StartWithWindows = CBool(dr(11))
MonitorOnStartup = CBool(dr("MonitorOnStartup"))
StartToTray = CBool(dr("StartToTray"))
ShowDetectionToolTips = CBool(dr("ShowDetectionToolTips"))
DisableConfirmation = CBool(dr("DisableConfirmation"))
CreateSubFolder = CBool(dr("CreateSubFolder"))
ShowOverwriteWarning = CBool(dr("ShowOverwriteWarning"))
RestoreOnLaunch = CBool(dr("RestoreOnLaunch"))
BackupFolder = CStr(dr("BackupFolder"))
Sync = CBool(dr("Sync"))
CheckSum = CBool(dr("CheckSum"))
StartWithWindows = CBool(dr("StartWithWindows"))
TimeTracking = CBool(dr("TimeTracking"))
Next
oDatabase.Disconnect()
+264
View File
@@ -0,0 +1,264 @@
Public Class mgrTags
Public Shared Sub DoTagAdd(ByVal oTag As clsTag, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local)
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String
Dim hshParams As New Hashtable
sSQL = "INSERT INTO tags VALUES (@ID, @Name)"
hshParams.Add("ID", oTag.ID)
hshParams.Add("Name", oTag.Name)
oDatabase.RunParamQuery(sSQL, hshParams)
End Sub
Public Shared Sub DoTagUpdate(ByVal oTag As clsTag, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local)
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String
Dim hshParams As New Hashtable
sSQL = "UPDATE tags SET Name=@Name "
sSQL &= "WHERE TagID = @ID"
hshParams.Add("Name", oTag.Name)
hshParams.Add("ID", oTag.ID)
oDatabase.RunParamQuery(sSQL, hshParams)
End Sub
Public Shared Sub DoTagDelete(ByVal sTagID As String)
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSQL As String
Dim hshParams As New Hashtable
sSQL = "DELETE FROM gametags "
sSQL &= "WHERE TagID = @ID;"
sSQL = "DELETE FROM tags "
sSQL &= "WHERE TagID = @ID;"
hshParams.Add("ID", sTagID)
oDatabase.RunParamQuery(sSQL, hshParams)
End Sub
Public Shared Function DoTagGetbyID(ByVal sTagID As String) As clsTag
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSQL As String
Dim oData As DataSet
Dim oTag As New clsTag
Dim hshParams As New Hashtable
sSQL = "SELECT * FROM tags "
sSQL &= "WHERE TagID = @ID"
hshParams.Add("ID", sTagID)
oData = oDatabase.ReadParamData(sSQL, hshParams)
For Each dr As DataRow In oData.Tables(0).Rows
oTag = New clsTag
oTag.ID = CStr(dr("TagID"))
oTag.Name = CStr(dr("Name"))
Next
Return oTag
End Function
Public Shared Function DoTagGetbyName(ByVal sTagName As String) As clsTag
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSQL As String
Dim oData As DataSet
Dim oTag As New clsTag
Dim hshParams As New Hashtable
sSQL = "SELECT * FROM tags "
sSQL &= "WHERE Name = @Name"
hshParams.Add("Name", sTagName)
oData = oDatabase.ReadParamData(sSQL, hshParams)
For Each dr As DataRow In oData.Tables(0).Rows
oTag = New clsTag
oTag.ID = CStr(dr("TagID"))
oTag.Name = CStr(dr("Name"))
Next
Return oTag
End Function
Public Shared Function DoCheckDuplicate(ByVal sTagName As String, Optional ByVal sExcludeID As String = "", Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) As Boolean
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String
Dim oData As DataSet
Dim hshParams As New Hashtable
sSQL = "SELECT * FROM tags "
sSQL &= "WHERE Name = @Name"
hshParams.Add("Name", sTagName)
If sExcludeID <> String.Empty Then
sSQL &= " AND TagID <> @TagID"
hshParams.Add("TagID", sExcludeID)
End If
oData = oDatabase.ReadParamData(sSQL, hshParams)
If oData.Tables(0).Rows.Count > 0 Then
Return True
Else
Return False
End If
End Function
Public Shared Function ReadTags(Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) As Hashtable
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim oData As DataSet
Dim sSQL As String
Dim hshList As New Hashtable
Dim oTag As clsTag
sSQL = "SELECT * from tags"
oData = oDatabase.ReadParamData(sSQL, New Hashtable)
For Each dr As DataRow In oData.Tables(0).Rows
oTag = New clsTag
oTag.ID = CStr(dr("TagID"))
oTag.Name = CStr(dr("Name"))
hshList.Add(oTag.Name, oTag)
Next
Return hshList
End Function
Public Shared Sub DoTagAddImport(ByVal hshTags As Hashtable, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local)
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String
Dim sMonitorID As String
Dim oTag As clsTag
Dim hshParams As Hashtable
Dim oParamList As New List(Of Hashtable)
sSQL = "INSERT OR REPLACE INTO tags VALUES (COALESCE((SELECT TagID FROM tags WHERE Name = @Name), @ID), @Name); INSERT INTO gametags VALUES ((SELECT TagID from tags WHERE Name=@Name), @MonitorID);"
For Each oGame As clsGame In hshTags.Values
sMonitorID = oGame.ID
For Each t As Tag In oGame.ImportTags
hshParams = New Hashtable
oTag = New clsTag
oTag.Name = t.Name
hshParams.Add("ID", oTag.ID)
hshParams.Add("Name", oTag.Name)
hshParams.Add("MonitorID", sMonitorID)
oParamList.Add(hshParams)
Next
Next
oDatabase.RunMassParamQuery(sSQL, oParamList)
End Sub
Public Shared Sub DoTagAddUpdateSync(ByVal hshTags As Hashtable, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local)
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String
Dim hshParams As Hashtable
Dim oParamList As New List(Of Hashtable)
sSQL = "INSERT OR REPLACE INTO tags VALUES (@ID, @Name);"
For Each oTag As clsTag In hshTags.Values
hshParams = New Hashtable
hshParams.Add("ID", oTag.ID)
hshParams.Add("Name", oTag.Name)
oParamList.Add(hshParams)
Next
oDatabase.RunMassParamQuery(sSQL, oParamList)
End Sub
Private Shared Sub DoTagDeleteSync(ByVal hshTags As Hashtable, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local)
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String
Dim hshParams As Hashtable
Dim oParamList As New List(Of Hashtable)
sSQL = "DELETE FROM gametags "
sSQL &= "WHERE TagID = @ID;"
sSQL = "DELETE FROM tags "
sSQL &= "WHERE TagID = @ID;"
For Each oTag As clsTag In hshTags.Values
hshParams = New Hashtable
hshParams.Add("ID", oTag.ID)
oParamList.Add(hshParams)
Next
oDatabase.RunMassParamQuery(sSQL, oParamList)
End Sub
Public Shared Function SyncTags(Optional ByVal bToRemote As Boolean = True) As Integer
Dim hshCompareFrom As Hashtable
Dim hshCompareTo As Hashtable
Dim hshSyncItems As Hashtable
Dim hshDeleteItems As Hashtable
Dim oFromItem As clsTag
Dim oToItem As clsTag
'Add / Update Sync
If bToRemote Then
hshCompareFrom = ReadTags(mgrSQLite.Database.Local)
hshCompareTo = ReadTags(mgrSQLite.Database.Remote)
Else
hshCompareFrom = ReadTags(mgrSQLite.Database.Remote)
hshCompareTo = ReadTags(mgrSQLite.Database.Local)
End If
hshSyncItems = hshCompareFrom.Clone
For Each oFromItem In hshCompareFrom.Values
If hshCompareTo.Contains(oFromItem.Name) Then
oToItem = DirectCast(hshCompareTo(oFromItem.Name), clsTag)
If oFromItem.CoreEquals(oToItem) Then
hshSyncItems.Remove(oFromItem.Name)
End If
End If
Next
If bToRemote Then
DoTagAddUpdateSync(hshSyncItems, mgrSQLite.Database.Remote)
Else
DoTagAddUpdateSync(hshSyncItems, mgrSQLite.Database.Local)
End If
'Delete Sync
If bToRemote Then
hshCompareFrom = ReadTags(mgrSQLite.Database.Local)
hshCompareTo = ReadTags(mgrSQLite.Database.Remote)
Else
hshCompareFrom = ReadTags(mgrSQLite.Database.Remote)
hshCompareTo = ReadTags(mgrSQLite.Database.Local)
End If
hshDeleteItems = hshCompareTo.Clone
For Each oToItem In hshCompareTo.Values
If hshCompareFrom.Contains(oToItem.Name) Then
oFromItem = DirectCast(hshCompareFrom(oToItem.Name), clsTag)
If oToItem.MinimalEquals(oFromItem) Then
hshDeleteItems.Remove(oToItem.Name)
End If
End If
Next
If bToRemote Then
DoTagDeleteSync(hshDeleteItems, mgrSQLite.Database.Remote)
Else
DoTagDeleteSync(hshDeleteItems, mgrSQLite.Database.Local)
End If
Return hshDeleteItems.Count + hshSyncItems.Count
End Function
End Class
+10 -12
View File
@@ -1,6 +1,4 @@
Imports System.IO
Public Class mgrVariables
Public Class mgrVariables
Public Shared Sub DoPathUpdate(ByVal sOld As String, ByVal sNew As String)
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
@@ -72,9 +70,9 @@ Public Class mgrVariables
For Each dr As DataRow In oData.Tables(0).Rows
oCustomVariable = New clsPathVariable
oCustomVariable.ID = CStr(dr(0))
oCustomVariable.Name = CStr(dr(1))
oCustomVariable.Path = CStr(dr(2))
oCustomVariable.ID = CStr(dr("VariableID"))
oCustomVariable.Name = CStr(dr("Name"))
oCustomVariable.Path = CStr(dr("Path"))
Next
Return oCustomVariable
@@ -96,9 +94,9 @@ Public Class mgrVariables
For Each dr As DataRow In oData.Tables(0).Rows
oCustomVariable = New clsPathVariable
oCustomVariable.ID = CStr(dr(0))
oCustomVariable.Name = CStr(dr(1))
oCustomVariable.Path = CStr(dr(2))
oCustomVariable.ID = CStr(dr("VariableID"))
oCustomVariable.Name = CStr(dr("Name"))
oCustomVariable.Path = CStr(dr("Path"))
Next
Return oCustomVariable
@@ -141,9 +139,9 @@ Public Class mgrVariables
For Each dr As DataRow In oData.Tables(0).Rows
oCustomVariable = New clsPathVariable
oCustomVariable.ID = CStr(dr(0))
oCustomVariable.Name = CStr(dr(1))
oCustomVariable.Path = CStr(dr(2))
oCustomVariable.ID = CStr(dr("VariableID"))
oCustomVariable.Name = CStr(dr("Name"))
oCustomVariable.Path = CStr(dr("Path"))
hshList.Add(oCustomVariable.Name, oCustomVariable)
Next
+64 -67
View File
@@ -1,11 +1,12 @@
Imports System.Xml
Imports System.Xml.Serialization
Imports System.IO
Imports System.Text
Imports System.Net
Public Class mgrXML
Public Shared Function ReadMonitorList(ByVal sLocation As String, Optional ByVal bWebRead As Boolean = False) As Hashtable
Dim xFileReader As XmlTextReader
Dim oList As List(Of Game)
Dim hshList As New Hashtable
Dim hshDupeList As New Hashtable
Dim oGame As clsGame
@@ -16,84 +17,80 @@ Public Class mgrXML
Return hshList
End If
Try
xFileReader = New XmlTextReader(sLocation)
xFileReader.WhitespaceHandling = WhitespaceHandling.None
oList = ImportandDeserialize(sLocation, bWebRead)
While (xFileReader.Read())
If xFileReader.Name = "app" Then
oGame = New clsGame
oGame.Name = xFileReader.GetAttribute("name")
xFileReader.Read()
oGame.ProcessName = xFileReader.ReadElementString("process")
oGame.AbsolutePath = xFileReader.ReadElementString("absolutepath")
oGame.Path = xFileReader.ReadElementString("savelocation")
oGame.FolderSave = xFileReader.ReadElementString("foldersave")
oGame.FileType = xFileReader.ReadElementString("filetype")
oGame.AppendTimeStamp = xFileReader.ReadElementString("appendtimestamp")
oGame.ExcludeList = xFileReader.ReadElementString("excludelist")
For Each g As Game In oList
oGame = New clsGame
oGame.Name = g.Name
oGame.ProcessName = g.ProcessName
oGame.AbsolutePath = g.AbsolutePath
oGame.Path = g.Path
oGame.FolderSave = g.FolderSave
oGame.FileType = g.FileType
oGame.ExcludeList = g.ExcludeList
For Each t As Tag In g.Tags
oGame.ImportTags.Add(t)
Next
If hshList.Contains(oGame.ProcessName) Or hshDupeList.Contains(oGame.ProcessName) Then
oDupeGame = DirectCast(hshList.Item(oGame.ProcessName), clsGame)
If Not hshDupeList.Contains(oGame.ProcessName) Then
hshDupeList.Add(oGame.ProcessName, oDupeGame)
hshList.Remove(oDupeGame.ProcessName)
oDupeGame.Duplicate = True
oDupeGame.ProcessName = oDupeGame.ProcessName & ":" & oDupeGame.Name
hshList.Add(oDupeGame.ProcessName, oDupeGame)
End If
oGame.ProcessName = oGame.ProcessName & ":" & oGame.Name
oGame.Duplicate = True
End If
hshList.Add(oGame.ProcessName, oGame)
If hshList.Contains(oGame.ProcessName) Or hshDupeList.Contains(oGame.ProcessName) Then
oDupeGame = DirectCast(hshList.Item(oGame.ProcessName), clsGame)
If Not hshDupeList.Contains(oGame.ProcessName) Then
hshDupeList.Add(oGame.ProcessName, oDupeGame)
hshList.Remove(oDupeGame.ProcessName)
oDupeGame.Duplicate = True
oDupeGame.ProcessName = oDupeGame.ProcessName & ":" & oDupeGame.Name
hshList.Add(oDupeGame.ProcessName, oDupeGame)
End If
End While
oGame.ProcessName = oGame.ProcessName & ":" & oGame.Name
oGame.Duplicate = True
End If
xFileReader.Close()
'We need to trigger a manual garbage collection here to prevent issues with the reader freezing up with multiple uses.
'There's no way to properly dispose a xml text reader in .NET 4, that's only fixed in 4.5+.
GC.Collect()
Catch ex As Exception
MsgBox("An error occured reading the monitor list import file." & vbCrLf & ex.Message, MsgBoxStyle.Exclamation, "Game Backup Monitor")
End Try
hshList.Add(oGame.ProcessName, oGame)
Next
Return hshList
End Function
Public Shared Function ExportMonitorList(ByVal hshList As Hashtable, ByVal sLocation As String) As Boolean
Dim xFileWriter As XmlTextWriter
Public Shared Function ImportandDeserialize(ByVal sLocation As String, Optional ByVal bWebRead As Boolean = False) As List(Of Game)
Dim oReader As StreamReader
Dim oWebClient As WebClient
Dim oSerializer As XmlSerializer
Dim oList As New List(Of Game)
Try
xFileWriter = New XmlTextWriter(sLocation, System.Text.Encoding.Unicode)
xFileWriter.Formatting = Formatting.Indented
xFileWriter.WriteStartDocument()
xFileWriter.WriteComment("GBM Export: " & Date.Now)
xFileWriter.WriteComment("Entries: " & hshList.Count)
xFileWriter.WriteStartElement("aMon")
For Each o As clsGame In hshList.Values
xFileWriter.WriteStartElement("app")
xFileWriter.WriteAttributeString("name", o.Name)
xFileWriter.WriteElementString("process", o.TrueProcess)
xFileWriter.WriteElementString("absolutepath", o.AbsolutePath)
xFileWriter.WriteElementString("savelocation", o.TruePath)
xFileWriter.WriteElementString("foldersave", o.FolderSave)
xFileWriter.WriteElementString("filetype", o.FileType)
xFileWriter.WriteElementString("appendtimestamp", o.AppendTimeStamp)
xFileWriter.WriteElementString("excludelist", o.ExcludeList)
xFileWriter.WriteEndElement()
Next
xFileWriter.WriteEndElement()
xFileWriter.WriteEndDocument()
xFileWriter.Flush()
xFileWriter.Close()
If bWebRead Then
oWebClient = New WebClient
oReader = New StreamReader(oWebClient.OpenRead(sLocation))
Else
oReader = New StreamReader(sLocation)
End If
oSerializer = New XmlSerializer(oList.GetType(), New XmlRootAttribute("gbm"))
oList = oSerializer.Deserialize(oReader)
oReader.Close()
Catch ex As Exception
MsgBox("The XML file cannot be read, it may be an invalid format or corrupted." & vbCrLf & vbCrLf & ex.Message, MsgBoxStyle.Exclamation, "Game Backup Monitor")
End Try
Return oList
End Function
Public Shared Function SerializeAndExport(ByVal oList As List(Of Game), ByVal sLocation As String) As Boolean
Dim oSerializer As XmlSerializer
Dim oWriter As StreamWriter
Try
oSerializer = New XmlSerializer(oList.GetType(), New XmlRootAttribute("gbm"))
oWriter = New StreamWriter(sLocation)
oSerializer.Serialize(oWriter.BaseStream, oList)
oWriter.Flush()
oWriter.Close()
Return True
Catch ex As Exception
MsgBox("An error occured exporting the monitor list. " & ex.Message, MsgBoxStyle.Exclamation, "Game Backup Monitor")
MsgBox("An error occured exporting the XML data." & vbCrLf & vbCrLf & ex.Message, MsgBoxStyle.Exclamation, "Game Backup Monitor")
Return False
End Try
End Function
End Class
+14 -22
View File
@@ -1,7 +1,7 @@
Game Backup Monitor v0.93 Readme
http://backupmonitor.sourceforge.net/
Game Backup Monitor v0.94 Readme
http://mikemaximus.github.io/gbm-web/
October 13, 2015
November 17, 2015
Disclaimer:
@@ -13,26 +13,18 @@ This application is designed to run in the system tray and monitor for games you
GBM has been designed with mostly classic gaming in mind, but it can be used for any application!
Important Upgrade Information:
New in 0.94
1. You may notice one or more backup dates are incorrect after upgrading to v0.93. This is due to fallback behavior during the upgrade process when a date cannot be converted correctly.
2. Due to core changes to how GBM handles backups, some game configurations that exclude sub-folders may break in v0.93, including official configurations.
If you have any issues with the following game backups after upgrading to v0.93, delete them from the Game Manager and re-import them from the official list.
Call of Cthulhu - Dark Corners of The Earth
Dead State
Democracy 3
Grand Theft Auto - San Andreas
Kerbal Space Program
POD Gold
Simcity 4 Deluxe
The Settlers: Rise of an Empire
Tropico 4
Victor Vran
Please check the Game Manager section of the manual if you're having problems with your custom game entries.
- Added the ability to organize your games with Tags. Users can create and customize their own list of Tags.
- Added the ability to filter by Tag in the Game Manager.
- Added the ability to filter by Tag when doing an XML export.
- Added the ability to disable Time Tracking. Enabling or disabling this setting has no effect on data already recorded.
- Added the ability to restart GBM as Administrator from the status bar.
- Redesigned notifications, GBM is now silent unless a problem occurs.
- Enhanced the sync logic and performance.
- The backup "Timestamp" setting is no longer included in XML imports or exports.
- Redesigned the XML import and export core. Sorry, this invalidates all prior XML exports files, but it will ensure future backwards compatability.
- Various bug fixes.
New in 0.93
+10 -8
View File
@@ -1,12 +1,14 @@
# Game Backup Monitor
# [Game Backup Monitor] (http://mikemaximus.github.io/gbm-web/)
<b>Important Notice:</b> This project is currently in the process of being transferred from Sourceforge. Releases and documentation will be available soon, for now the latest release and documentation for this project are available at http://backupmonitor.sourceforge.net.
![Screenshot] (http://mikemaximus.github.io/gbm-web/images/manual/manual_01.jpg)
Game Backup Monitor is a Windows system tray application that automatically detects games as you play them. When you're finished playing, a compressed backup of the save data will be automatically created in a location you've specified, such as a cloud folder, network folder or external drive.
Game Backup Monitor is a simple, but flexible application that detects games as you play them. Once you finish playing a game, a backup of the saved games will be made automatically using 7-Zip compression. GBM can be used on a single computer, or on multiple computers to effectively add cloud support to any Windows game or application.
If you use Game Backup Monitor on multiple computers and share the same backup folder, you can effectively add cloud support to any game or application. GBM can notify you of new files to be restored when you move to each computer.
Game Backup Monitor was designed with classic DRM-free gaming in mind, but it can be used to monitor any application on your PC!
Game Backup Monitor is currently only available in English.
**License**: GNU General Public License version 3.0 (GPLv3)<br />
**Language**: English Only<br />
**Platform**: Windows Only (.NET 4)
[Game Backup Monitor FAQ] (http://mikemaximus.github.io/gbm-web/faq.html) <br />
[Game Backup Monitor Manual] (http://mikemaximus.github.io/gbm-web/manual.html) <br />
[List of Preconfigured Games] (http://mikemaximus.github.io/gbm-web/GBM_Official.xml) <br /> <br />
Updates regarding this project are available via the [Game Backup Monitor web site] (http://mikemaximus.github.io/gbm-web/).