Custom Filter Enhancement Phase #1
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
Public Class Tag
|
||||
<Serializable()>
|
||||
Public Class Tag
|
||||
Private sTagName As String
|
||||
|
||||
Property Name As String
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Public Class clsGame
|
||||
<Serializable()>
|
||||
Public Class clsGame
|
||||
Private sGameID As String = Guid.NewGuid.ToString
|
||||
Private sGameName As String = String.Empty
|
||||
Private sProcessName As String = String.Empty
|
||||
|
||||
Generated
+70
-3
@@ -45,10 +45,16 @@ Partial Class frmFilter
|
||||
Me.lblProcess = New System.Windows.Forms.Label()
|
||||
Me.lblName = New System.Windows.Forms.Label()
|
||||
Me.txtName = New System.Windows.Forms.TextBox()
|
||||
Me.grpSorting = New System.Windows.Forms.GroupBox()
|
||||
Me.lblOrderBy = New System.Windows.Forms.Label()
|
||||
Me.cboSortField = New System.Windows.Forms.ComboBox()
|
||||
Me.optSortAsc = New System.Windows.Forms.RadioButton()
|
||||
Me.optSortDesc = New System.Windows.Forms.RadioButton()
|
||||
Me.grpTagFilter.SuspendLayout()
|
||||
Me.grpTagOptions.SuspendLayout()
|
||||
Me.grpGameFilter.SuspendLayout()
|
||||
Me.grpGameInfoOptions.SuspendLayout()
|
||||
Me.grpSorting.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'optGameInfo
|
||||
@@ -176,10 +182,10 @@ Partial Class frmFilter
|
||||
'
|
||||
'btnOK
|
||||
'
|
||||
Me.btnOK.Location = New System.Drawing.Point(322, 484)
|
||||
Me.btnOK.Location = New System.Drawing.Point(322, 551)
|
||||
Me.btnOK.Name = "btnOK"
|
||||
Me.btnOK.Size = New System.Drawing.Size(75, 23)
|
||||
Me.btnOK.TabIndex = 4
|
||||
Me.btnOK.TabIndex = 5
|
||||
Me.btnOK.Text = "&OK"
|
||||
Me.btnOK.UseVisualStyleBackColor = True
|
||||
'
|
||||
@@ -278,11 +284,65 @@ Partial Class frmFilter
|
||||
Me.txtName.Size = New System.Drawing.Size(309, 20)
|
||||
Me.txtName.TabIndex = 1
|
||||
'
|
||||
'grpSorting
|
||||
'
|
||||
Me.grpSorting.Controls.Add(Me.optSortDesc)
|
||||
Me.grpSorting.Controls.Add(Me.optSortAsc)
|
||||
Me.grpSorting.Controls.Add(Me.cboSortField)
|
||||
Me.grpSorting.Controls.Add(Me.lblOrderBy)
|
||||
Me.grpSorting.Location = New System.Drawing.Point(12, 484)
|
||||
Me.grpSorting.Name = "grpSorting"
|
||||
Me.grpSorting.Size = New System.Drawing.Size(385, 61)
|
||||
Me.grpSorting.TabIndex = 4
|
||||
Me.grpSorting.TabStop = False
|
||||
Me.grpSorting.Text = "Sorting"
|
||||
'
|
||||
'lblOrderBy
|
||||
'
|
||||
Me.lblOrderBy.AutoSize = True
|
||||
Me.lblOrderBy.Location = New System.Drawing.Point(6, 28)
|
||||
Me.lblOrderBy.Name = "lblOrderBy"
|
||||
Me.lblOrderBy.Size = New System.Drawing.Size(51, 13)
|
||||
Me.lblOrderBy.TabIndex = 0
|
||||
Me.lblOrderBy.Text = "Order By:"
|
||||
'
|
||||
'cboSortField
|
||||
'
|
||||
Me.cboSortField.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
|
||||
Me.cboSortField.FormattingEnabled = True
|
||||
Me.cboSortField.Location = New System.Drawing.Point(63, 25)
|
||||
Me.cboSortField.Name = "cboSortField"
|
||||
Me.cboSortField.Size = New System.Drawing.Size(147, 21)
|
||||
Me.cboSortField.TabIndex = 1
|
||||
'
|
||||
'optSortAsc
|
||||
'
|
||||
Me.optSortAsc.AutoSize = True
|
||||
Me.optSortAsc.Location = New System.Drawing.Point(216, 26)
|
||||
Me.optSortAsc.Name = "optSortAsc"
|
||||
Me.optSortAsc.Size = New System.Drawing.Size(75, 17)
|
||||
Me.optSortAsc.TabIndex = 2
|
||||
Me.optSortAsc.TabStop = True
|
||||
Me.optSortAsc.Text = "Ascending"
|
||||
Me.optSortAsc.UseVisualStyleBackColor = True
|
||||
'
|
||||
'optSortDesc
|
||||
'
|
||||
Me.optSortDesc.AutoSize = True
|
||||
Me.optSortDesc.Location = New System.Drawing.Point(297, 26)
|
||||
Me.optSortDesc.Name = "optSortDesc"
|
||||
Me.optSortDesc.Size = New System.Drawing.Size(82, 17)
|
||||
Me.optSortDesc.TabIndex = 3
|
||||
Me.optSortDesc.TabStop = True
|
||||
Me.optSortDesc.Text = "Descending"
|
||||
Me.optSortDesc.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(409, 516)
|
||||
Me.ClientSize = New System.Drawing.Size(409, 586)
|
||||
Me.Controls.Add(Me.grpSorting)
|
||||
Me.Controls.Add(Me.grpGameFilter)
|
||||
Me.Controls.Add(Me.grpTagFilter)
|
||||
Me.Controls.Add(Me.btnOK)
|
||||
@@ -301,6 +361,8 @@ Partial Class frmFilter
|
||||
Me.grpGameFilter.ResumeLayout(False)
|
||||
Me.grpGameFilter.PerformLayout()
|
||||
Me.grpGameInfoOptions.ResumeLayout(False)
|
||||
Me.grpSorting.ResumeLayout(False)
|
||||
Me.grpSorting.PerformLayout()
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
@@ -328,4 +390,9 @@ Partial Class frmFilter
|
||||
Friend WithEvents grpGameInfoOptions As System.Windows.Forms.GroupBox
|
||||
Friend WithEvents optOr As System.Windows.Forms.RadioButton
|
||||
Friend WithEvents optAnd As System.Windows.Forms.RadioButton
|
||||
Friend WithEvents grpSorting As GroupBox
|
||||
Friend WithEvents optSortDesc As RadioButton
|
||||
Friend WithEvents optSortAsc As RadioButton
|
||||
Friend WithEvents cboSortField As ComboBox
|
||||
Friend WithEvents lblOrderBy As Label
|
||||
End Class
|
||||
|
||||
@@ -14,6 +14,8 @@ Public Class frmFilter
|
||||
Dim oTagFilters As New List(Of clsTag)
|
||||
Dim hshStringFilters As New Hashtable
|
||||
Dim eCurrentFilterType As eFilterType = eFilterType.AnyTag
|
||||
Dim bSortAsc As Boolean = True
|
||||
Dim sSortField As String = "Name"
|
||||
Dim hshTags As New Hashtable
|
||||
Dim bShutdown As Boolean = False
|
||||
|
||||
@@ -35,6 +37,18 @@ Public Class frmFilter
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property SortAsc As Boolean
|
||||
Get
|
||||
Return bSortAsc
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property SortField As String
|
||||
Get
|
||||
Return sSortField
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Sub AddTag()
|
||||
Dim oData As KeyValuePair(Of String, String)
|
||||
Dim oTags As List(Of KeyValuePair(Of String, String))
|
||||
@@ -145,6 +159,33 @@ Public Class frmFilter
|
||||
End If
|
||||
End If
|
||||
|
||||
'Sorting
|
||||
If optSortAsc.Checked Then
|
||||
bSortAsc = True
|
||||
Else
|
||||
bSortAsc = False
|
||||
End If
|
||||
|
||||
sSortField = cboSortField.SelectedValue
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub LoadCombos()
|
||||
Dim oSortFields As New List(Of KeyValuePair(Of String, String))
|
||||
|
||||
'cboSortField
|
||||
cboSortField.ValueMember = "Key"
|
||||
cboSortField.DisplayMember = "Value"
|
||||
|
||||
oSortFields.Add(New KeyValuePair(Of String, String)("Name", frmFilter_SortName))
|
||||
oSortFields.Add(New KeyValuePair(Of String, String)("Process", frmFilter_SortProcess))
|
||||
oSortFields.Add(New KeyValuePair(Of String, String)("Company", frmFilter_SortCompany))
|
||||
oSortFields.Add(New KeyValuePair(Of String, String)("Hours", frmFilter_SortHours))
|
||||
|
||||
cboSortField.DataSource = oSortFields
|
||||
|
||||
'Select Default
|
||||
cboSortField.SelectedIndex = 0
|
||||
End Sub
|
||||
|
||||
Private Sub SetForm()
|
||||
@@ -168,10 +209,18 @@ Public Class frmFilter
|
||||
grpTagOptions.Text = frmFilter_grpTagOptions
|
||||
optTag.Text = frmFilter_optTag
|
||||
optGameInfo.Text = frmFilter_optGameInfo
|
||||
grpSorting.Text = frmFilter_grpSorting
|
||||
lblOrderBy.Text = frmFilter_lblOrderBy
|
||||
optSortAsc.Text = frmFilter_optSortAsc
|
||||
optSortDesc.Text = frmFilter_optSortDesc
|
||||
|
||||
'Defaults
|
||||
optSortAsc.Checked = True
|
||||
End Sub
|
||||
|
||||
Private Sub frmGameTags_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
SetForm()
|
||||
LoadCombos()
|
||||
optGameInfo.Checked = True
|
||||
LoadData()
|
||||
End Sub
|
||||
|
||||
+25
-20
@@ -1,4 +1,5 @@
|
||||
Imports GBM.My.Resources
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.IO
|
||||
|
||||
Public Class frmGameManager
|
||||
@@ -13,7 +14,7 @@ Public Class frmGameManager
|
||||
Private bTriggerRestore As Boolean = False
|
||||
Private oBackupList As New List(Of clsGame)
|
||||
Private oRestoreList As New Hashtable
|
||||
Private oAppData As Hashtable
|
||||
Private oGameData As OrderedDictionary
|
||||
Private oLocalBackupData As SortedList
|
||||
Private oRemoteBackupData As SortedList
|
||||
Private bIsDirty As Boolean = False
|
||||
@@ -21,6 +22,8 @@ Public Class frmGameManager
|
||||
Private oCurrentTagFilters As New List(Of clsTag)
|
||||
Private oCurrentStringFilters As New Hashtable
|
||||
Private eCurrentFilter As frmFilter.eFilterType = frmFilter.eFilterType.NoFilter
|
||||
Private bCurrentSortAsc As Boolean = True
|
||||
Private sCurrentSortField As String = "Name"
|
||||
Private WithEvents tmFilterTimer As Timer
|
||||
|
||||
Private Enum eModes As Integer
|
||||
@@ -70,12 +73,12 @@ Public Class frmGameManager
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property AppData As Hashtable
|
||||
Private Property GameData As OrderedDictionary
|
||||
Get
|
||||
Return oAppData
|
||||
Return oGameData
|
||||
End Get
|
||||
Set(value As Hashtable)
|
||||
oAppData = value
|
||||
Set(value As OrderedDictionary)
|
||||
oGameData = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -226,37 +229,41 @@ Public Class frmGameManager
|
||||
oCurrentTagFilters = frm.TagFilters
|
||||
oCurrentStringFilters = frm.StringFilters
|
||||
eCurrentFilter = frm.FilterType
|
||||
bCurrentSortAsc = frm.SortAsc
|
||||
sCurrentSortField = frm.SortField
|
||||
End If
|
||||
Else
|
||||
oCurrentTagFilters.Clear()
|
||||
oCurrentStringFilters.Clear()
|
||||
eCurrentFilter = frmFilter.eFilterType.NoFilter
|
||||
bCurrentSortAsc = True
|
||||
sCurrentSortField = "Name"
|
||||
End If
|
||||
|
||||
AppData = mgrMonitorList.ReadFilteredList(oCurrentTagFilters, oCurrentStringFilters, eCurrentFilter)
|
||||
GameData = mgrMonitorList.ReadFilteredList(oCurrentTagFilters, oCurrentStringFilters, eCurrentFilter, bCurrentSortAsc, sCurrentSortField)
|
||||
|
||||
If optPendingRestores.Checked Then
|
||||
oRestoreData = mgrRestore.CompareManifests
|
||||
|
||||
'Only show games with data to restore
|
||||
Dim oTemporaryList As Hashtable = AppData.Clone
|
||||
Dim oTemporaryList As OrderedDictionary = mgrCommon.GenericClone(GameData)
|
||||
For Each de As DictionaryEntry In oTemporaryList
|
||||
oGame = DirectCast(de.Value, clsGame)
|
||||
If Not oRestoreData.ContainsKey(oGame.Name) Then
|
||||
AppData.Remove(de.Key)
|
||||
GameData.Remove(de.Key)
|
||||
Else
|
||||
oRestoreData.Remove(oGame.Name)
|
||||
End If
|
||||
Next
|
||||
ElseIf optBackupData.Checked Then
|
||||
'Only show games with backup data
|
||||
Dim oTemporaryList As Hashtable = AppData.Clone
|
||||
Dim oTemporaryList As OrderedDictionary = mgrCommon.GenericClone(GameData)
|
||||
oRestoreData = oRemoteBackupData.Clone
|
||||
|
||||
For Each de As DictionaryEntry In oTemporaryList
|
||||
oGame = DirectCast(de.Value, clsGame)
|
||||
If Not oRemoteBackupData.ContainsKey(oGame.Name) Then
|
||||
AppData.Remove(de.Key)
|
||||
GameData.Remove(de.Key)
|
||||
Else
|
||||
oRestoreData.Remove(oGame.Name)
|
||||
End If
|
||||
@@ -269,7 +276,7 @@ Public Class frmGameManager
|
||||
oGame = New clsGame
|
||||
oGame.Name = oBackup.Name
|
||||
oGame.Temporary = True
|
||||
AppData.Add(oGame.ID, oGame)
|
||||
GameData.Add(oGame.ID, oGame)
|
||||
Next
|
||||
End If
|
||||
|
||||
@@ -387,7 +394,7 @@ Public Class frmGameManager
|
||||
Dim oList As New List(Of KeyValuePair(Of String, String))
|
||||
Dim sFilter As String = txtQuickFilter.Text
|
||||
|
||||
For Each de As DictionaryEntry In AppData
|
||||
For Each de As DictionaryEntry In GameData
|
||||
oApp = DirectCast(de.Value, clsGame)
|
||||
oData = New KeyValuePair(Of String, String)(oApp.ID, oApp.Name)
|
||||
'Apply the quick filter if applicable
|
||||
@@ -400,8 +407,6 @@ Public Class frmGameManager
|
||||
End If
|
||||
Next
|
||||
|
||||
oList.Sort(AddressOf mgrCommon.CompareByListBoxItemByValue)
|
||||
|
||||
lstGames.BeginUpdate()
|
||||
lstGames.ValueMember = "Key"
|
||||
lstGames.DisplayMember = "Value"
|
||||
@@ -545,7 +550,7 @@ Public Class frmGameManager
|
||||
frm.TagList = oTagsToSave
|
||||
Else
|
||||
For Each oData In lstGames.SelectedItems
|
||||
oApp = DirectCast(AppData(oData.Key), clsGame)
|
||||
oApp = DirectCast(GameData(oData.Key), clsGame)
|
||||
sMonitorIDs.Add(oApp.ID)
|
||||
Next
|
||||
frm.GameName = CurrentGame.Name
|
||||
@@ -731,7 +736,7 @@ Public Class frmGameManager
|
||||
IsLoading = True
|
||||
|
||||
Dim oData As KeyValuePair(Of String, String) = lstGames.SelectedItems(0)
|
||||
Dim oApp As clsGame = DirectCast(AppData(oData.Key), clsGame)
|
||||
Dim oApp As clsGame = DirectCast(GameData(oData.Key), clsGame)
|
||||
|
||||
'Core
|
||||
txtID.Text = oApp.ID
|
||||
@@ -1195,7 +1200,7 @@ Public Class frmGameManager
|
||||
|
||||
If lstGames.SelectedItems.Count = 1 Then
|
||||
oData = lstGames.SelectedItems(0)
|
||||
oApp = DirectCast(AppData(oData.Key), clsGame)
|
||||
oApp = DirectCast(GameData(oData.Key), clsGame)
|
||||
|
||||
If mgrCommon.ShowMessage(frmGameManager_ConfirmGameDelete, oApp.Name, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
|
||||
mgrMonitorList.DoListDelete(oApp.ID)
|
||||
@@ -1207,7 +1212,7 @@ Public Class frmGameManager
|
||||
Dim sMonitorIDs As New List(Of String)
|
||||
|
||||
For Each oData In lstGames.SelectedItems
|
||||
oApp = DirectCast(AppData(oData.Key), clsGame)
|
||||
oApp = DirectCast(GameData(oData.Key), clsGame)
|
||||
sMonitorIDs.Add(oApp.ID)
|
||||
Next
|
||||
|
||||
@@ -1334,7 +1339,7 @@ Public Class frmGameManager
|
||||
BackupList.Clear()
|
||||
|
||||
For Each oData In lstGames.SelectedItems
|
||||
oGame = DirectCast(AppData(oData.Key), clsGame)
|
||||
oGame = DirectCast(GameData(oData.Key), clsGame)
|
||||
BackupList.Add(oGame)
|
||||
Next
|
||||
|
||||
@@ -1377,7 +1382,7 @@ Public Class frmGameManager
|
||||
Else
|
||||
For Each oData In lstGames.SelectedItems
|
||||
If oRemoteBackupData.Contains(oData.Value) Then
|
||||
oGame = DirectCast(AppData(oData.Key), clsGame)
|
||||
oGame = DirectCast(GameData(oData.Key), clsGame)
|
||||
oBackup = DirectCast(oRemoteBackupData(oData.Value), clsBackup)
|
||||
RestoreList.Add(oGame, oBackup)
|
||||
End If
|
||||
|
||||
@@ -3,6 +3,8 @@ Imports System.Net
|
||||
Imports System.IO
|
||||
Imports System.Security.Principal
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports System.Runtime.Serialization
|
||||
Imports System.Runtime.Serialization.Formatters.Binary
|
||||
|
||||
Public Class mgrCommon
|
||||
|
||||
@@ -35,6 +37,28 @@ Public Class mgrCommon
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'Source - https://stackoverflow.com/questions/18873152/deep-copy-of-ordereddictionary
|
||||
Public Shared Function GenericClone(ByVal oOriginal As Object) As Object
|
||||
'Construct a temporary memory stream
|
||||
Dim oStream As MemoryStream = New MemoryStream()
|
||||
|
||||
'Construct a serialization formatter that does all the hard work
|
||||
Dim oFormatter As BinaryFormatter = New BinaryFormatter()
|
||||
|
||||
'This line Is explained in the "Streaming Contexts" section
|
||||
oFormatter.Context = New StreamingContext(StreamingContextStates.Clone)
|
||||
|
||||
'Serialize the object graph into the memory stream
|
||||
oFormatter.Serialize(oStream, oOriginal)
|
||||
|
||||
'Seek back to the start of the memory stream before deserializing
|
||||
oStream.Position = 0
|
||||
|
||||
'Deserialize the graph into a New set of objects
|
||||
'Return the root of the graph (deep copy) to the caller
|
||||
Return oFormatter.Deserialize(oStream)
|
||||
End Function
|
||||
|
||||
Public Shared Function CheckAddress(ByVal URL As String) As Boolean
|
||||
Try
|
||||
Dim request As WebRequest = WebRequest.Create(URL)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports GBM.My.Resources
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.IO
|
||||
|
||||
Public Class mgrMonitorList
|
||||
@@ -496,14 +497,22 @@ Public Class mgrMonitorList
|
||||
End Sub
|
||||
|
||||
'Filter Functions
|
||||
Private Shared Function BuildFilterQuery(ByVal oTagFilters As List(Of clsTag), ByVal hshStringFilters As Hashtable, eFilterType As frmFilter.eFilterType, ByRef hshParams As Hashtable) As String
|
||||
Private Shared Function BuildFilterQuery(ByVal oTagFilters As List(Of clsTag), ByVal hshStringFilters As Hashtable, ByVal eFilterType As frmFilter.eFilterType, ByVal bSortAsc As Boolean,
|
||||
ByVal sSortField As String, ByRef hshParams As Hashtable) As String
|
||||
Dim sSQL As String = String.Empty
|
||||
Dim iCounter As Integer = 0
|
||||
Dim sBaseSelect As String = "MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter FROM monitorlist"
|
||||
Dim sSort As String = " ORDER BY " & sSortField
|
||||
|
||||
If bSortAsc Then
|
||||
sSort &= " ASC"
|
||||
Else
|
||||
sSort &= " DESC"
|
||||
End If
|
||||
|
||||
Select Case eFilterType
|
||||
Case frmFilter.eFilterType.NoFilter
|
||||
sSQL = "SELECT " & sBaseSelect & " ORDER BY Name Asc"
|
||||
sSQL = "SELECT " & sBaseSelect & sSort
|
||||
Case frmFilter.eFilterType.FieldAnd, frmFilter.eFilterType.FieldOr
|
||||
sSQL = "SELECT " & sBaseSelect
|
||||
|
||||
@@ -525,7 +534,7 @@ Public Class mgrMonitorList
|
||||
Next
|
||||
sSQL &= ")"
|
||||
End If
|
||||
sSQL &= " ORDER BY Name Asc"
|
||||
sSQL &= sSort
|
||||
Case frmFilter.eFilterType.AnyTag
|
||||
sSQL = "SELECT DISTINCT " & sBaseSelect
|
||||
sSQL &= " NATURAL JOIN gametags WHERE gametags.TagID IN ("
|
||||
@@ -537,7 +546,7 @@ Public Class mgrMonitorList
|
||||
Next
|
||||
|
||||
sSQL = sSQL.TrimEnd(",")
|
||||
sSQL &= ") ORDER BY Name Asc"
|
||||
sSQL &= ")" & sSort
|
||||
Case frmFilter.eFilterType.AllTags
|
||||
sSQL = "SELECT " & sBaseSelect & " WHERE MonitorID IN "
|
||||
|
||||
@@ -550,40 +559,42 @@ Public Class mgrMonitorList
|
||||
iCounter += 1
|
||||
Next
|
||||
|
||||
sSQL &= " ORDER BY Name Asc"
|
||||
sSQL &= sSort
|
||||
Case frmFilter.eFilterType.NoTags
|
||||
sSQL = "SELECT " & sBaseSelect & " WHERE MonitorID NOT IN (SELECT MonitorID FROM gametags) ORDER BY Name Asc"
|
||||
sSQL = "SELECT " & sBaseSelect & " WHERE MonitorID NOT IN (SELECT MonitorID FROM gametags)" & sSort
|
||||
End Select
|
||||
|
||||
Return sSQL
|
||||
|
||||
End Function
|
||||
|
||||
Public Shared Function ReadFilteredList(ByVal oTagFilters As List(Of clsTag), ByVal hshStringFilters As Hashtable, eFilterType As frmFilter.eFilterType, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) As Hashtable
|
||||
Public Shared Function ReadFilteredList(ByVal oTagFilters As List(Of clsTag), ByVal hshStringFilters As Hashtable, ByVal eFilterType As frmFilter.eFilterType, ByVal bSortAsc As Boolean,
|
||||
ByVal sSortField As String, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) As OrderedDictionary
|
||||
Dim oDatabase As New mgrSQLite(iSelectDB)
|
||||
Dim oData As DataSet
|
||||
Dim sSQL As String = String.Empty
|
||||
Dim hshList As New Hashtable
|
||||
Dim oList As New OrderedDictionary
|
||||
Dim oGame As clsGame
|
||||
Dim hshParams As New Hashtable
|
||||
Dim iCounter As Integer = 0
|
||||
|
||||
sSQL = BuildFilterQuery(oTagFilters, hshStringFilters, eFilterType, hshParams)
|
||||
sSQL = BuildFilterQuery(oTagFilters, hshStringFilters, eFilterType, bSortAsc, sSortField, hshParams)
|
||||
|
||||
oData = oDatabase.ReadParamData(sSQL, hshParams)
|
||||
|
||||
For Each dr As DataRow In oData.Tables(0).Rows
|
||||
oGame = MapToObject(dr)
|
||||
|
||||
hshList.Add(oGame.ID, oGame)
|
||||
oList.Add(oGame.ID, oGame)
|
||||
Next
|
||||
|
||||
Return hshList
|
||||
Return oList
|
||||
End Function
|
||||
|
||||
|
||||
'Import / Export Functions
|
||||
Public Shared Function ReadListForExport(ByVal oTagFilters As List(Of clsTag), ByVal hshStringFilters As Hashtable, ByVal eFilterType As frmFilter.eFilterType, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) As List(Of Game)
|
||||
Public Shared Function ReadListForExport(ByVal oTagFilters As List(Of clsTag), ByVal hshStringFilters As Hashtable, ByVal eFilterType As frmFilter.eFilterType, ByVal bSortAsc As Boolean,
|
||||
ByVal sSortField As String, 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
|
||||
@@ -592,7 +603,7 @@ Public Class mgrMonitorList
|
||||
Dim oGame As Game
|
||||
Dim hshParams As New Hashtable
|
||||
|
||||
sSQL = BuildFilterQuery(oTagFilters, hshStringFilters, eFilterType, hshParams)
|
||||
sSQL = BuildFilterQuery(oTagFilters, hshStringFilters, eFilterType, bSortAsc, sSortField, hshParams)
|
||||
|
||||
oData = oDatabase.ReadParamData(sSQL, hshParams)
|
||||
|
||||
@@ -687,6 +698,8 @@ Public Class mgrMonitorList
|
||||
Dim oTagFilters As New List(Of clsTag)
|
||||
Dim oStringFilters As New Hashtable
|
||||
Dim eCurrentFilter As frmFilter.eFilterType = frmFilter.eFilterType.NoFilter
|
||||
Dim bSortAsc As Boolean = True
|
||||
Dim sSortField As String = "Name"
|
||||
|
||||
If mgrCommon.ShowMessage(mgrMonitorList_ConfirmApplyFilter, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
|
||||
Dim frm As New frmFilter
|
||||
@@ -694,9 +707,11 @@ Public Class mgrMonitorList
|
||||
oTagFilters = frm.TagFilters
|
||||
oStringFilters = frm.StringFilters
|
||||
eCurrentFilter = frm.FilterType
|
||||
bSortAsc = frm.SortAsc
|
||||
sSortField = frm.SortField
|
||||
End If
|
||||
|
||||
oList = ReadListForExport(oTagFilters, oStringFilters, eCurrentFilter)
|
||||
oList = ReadListForExport(oTagFilters, oStringFilters, eCurrentFilter, bSortAsc, sSortField)
|
||||
|
||||
bSuccess = mgrXML.SerializeAndExport(oList, sLocation)
|
||||
|
||||
|
||||
Generated
+72
@@ -960,6 +960,15 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Sorting.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmFilter_grpSorting() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmFilter_grpSorting", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Options.
|
||||
'''</summary>
|
||||
@@ -996,6 +1005,15 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Order By:.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmFilter_lblOrderBy() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmFilter_lblOrderBy", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Process:.
|
||||
'''</summary>
|
||||
@@ -1059,6 +1077,24 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Ascending.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmFilter_optSortAsc() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmFilter_optSortAsc", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Descending.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmFilter_optSortDesc() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmFilter_optSortDesc", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Tag.
|
||||
'''</summary>
|
||||
@@ -1068,6 +1104,42 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Company.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmFilter_SortCompany() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmFilter_SortCompany", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Time Played.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmFilter_SortHours() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmFilter_SortHours", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Name.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmFilter_SortName() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmFilter_SortName", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Process.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmFilter_SortProcess() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmFilter_SortProcess", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to [PARAM] ([PARAM]).
|
||||
'''</summary>
|
||||
|
||||
@@ -1801,4 +1801,28 @@
|
||||
<data name="App_ErrorFocus" xml:space="preserve">
|
||||
<value>GBM is busy with an open window on your desktop.</value>
|
||||
</data>
|
||||
<data name="frmFilter_grpSorting" xml:space="preserve">
|
||||
<value>Sorting</value>
|
||||
</data>
|
||||
<data name="frmFilter_lblOrderBy" xml:space="preserve">
|
||||
<value>Order By:</value>
|
||||
</data>
|
||||
<data name="frmFilter_optSortAsc" xml:space="preserve">
|
||||
<value>Ascending</value>
|
||||
</data>
|
||||
<data name="frmFilter_optSortDesc" xml:space="preserve">
|
||||
<value>Descending</value>
|
||||
</data>
|
||||
<data name="frmFilter_SortCompany" xml:space="preserve">
|
||||
<value>Company</value>
|
||||
</data>
|
||||
<data name="frmFilter_SortHours" xml:space="preserve">
|
||||
<value>Time Played</value>
|
||||
</data>
|
||||
<data name="frmFilter_SortName" xml:space="preserve">
|
||||
<value>Name</value>
|
||||
</data>
|
||||
<data name="frmFilter_SortProcess" xml:space="preserve">
|
||||
<value>Process</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user