ms
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
Namespace Globix
|
||||
Imports System.IO
|
||||
|
||||
Namespace Globix
|
||||
Public Class State
|
||||
Public Property DT_FUNCTION_REGEX As DataTable
|
||||
Public Property DTACTUAL_FILES As DataTable
|
||||
@@ -7,13 +9,18 @@
|
||||
Public Property TEMP_FILES As List(Of String) = New List(Of String)
|
||||
Public Property CurrMessageID As String
|
||||
Public Property CURRENT_FILENAME As String
|
||||
Public Property CURRENT_FOLDERWATCH As String
|
||||
Public Property CURRENT_SCAN_FOLDERWATCH As String
|
||||
Public Property CURRENT_WORKFILE_GUID As Long
|
||||
Public Property CURRENT_WORKFILE As String
|
||||
Public Property CURRENT_WORKFILE_EXTENSION As String
|
||||
Public Property CURRENT_NEWFILENAME As String
|
||||
Public Property CURRENT_DOC_ID As Long
|
||||
Public Property ABORT_INDEXING As Boolean = False
|
||||
Public Property CURRENT_MESSAGEDATE As String
|
||||
|
||||
Public Property CURRENT_MESSAGESUBJECT As String
|
||||
Public Property CURRENT_IDB_OBJ_ID As Long
|
||||
Public Property INDEXING_ACTIVE As Boolean = False
|
||||
Public Property ABORT_INDEXING As Boolean = False
|
||||
Public Property CURRENT_ISATTACHMENT As Boolean = False
|
||||
Public Property CURR_DELETE_ORIGIN As Boolean = False
|
||||
Public Property CURRENT_DROPTYPE As String
|
||||
@@ -32,7 +39,10 @@
|
||||
Public Property VERSION_DELIMITER As String
|
||||
Public Property CURRENT_MESSAGEID As String
|
||||
Public Property CURRENT_BusinessEntity As String
|
||||
Public Property Folderwatchstarted As Boolean = False
|
||||
|
||||
Public Property DTEXCLUDE_FILES As DataTable
|
||||
Public PATH_FileExclusions As String = Path.Combine(Application.UserAppDataPath(), "FileExclusions.xml")
|
||||
Public Function FileExistsinDropTable(Filename As String) As Boolean
|
||||
Dim oSQL As String
|
||||
Try
|
||||
@@ -53,6 +63,71 @@
|
||||
End Try
|
||||
|
||||
End Function
|
||||
Public Function LoadFileExclusion() As Boolean
|
||||
Dim rowresult As String = ""
|
||||
Try
|
||||
'if file doesn't exist, create the file with its default xml table
|
||||
If Not File.Exists(PATH_FileExclusions) Then
|
||||
DTEXCLUDE_FILES = CreateExclusionTable()
|
||||
DTEXCLUDE_FILES.WriteXml(PATH_FileExclusions)
|
||||
End If
|
||||
DTEXCLUDE_FILES = GetTablefromXML()
|
||||
|
||||
'For Each Row As DataRow In DT.Rows
|
||||
' rowresult &= Row.Item("FILE_CONTAIN")
|
||||
' Select Case Row.Item("FILE_^^CONTAIN")
|
||||
|
||||
' End Select
|
||||
|
||||
'Next
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
MsgBox("Error in ModuleUserSavings-LoadFileExclusion" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
Return False
|
||||
End Try
|
||||
Return True
|
||||
|
||||
End Function
|
||||
Private Function CreateExclusionTable() As DataTable
|
||||
Try
|
||||
' Create sample Customers table, in order
|
||||
' to demonstrate the behavior of the DataTableReader.
|
||||
Dim oMyExclusions As New DataTable
|
||||
oMyExclusions.TableName = "TBEXCLUSION"
|
||||
|
||||
' Create two columns, ID and Name.
|
||||
oMyExclusions.Columns.Add("FILE_CONTAIN", GetType(System.String))
|
||||
Dim newRow As DataRow = oMyExclusions.NewRow()
|
||||
newRow("FILE_CONTAIN") = "Thumbs"
|
||||
oMyExclusions.Rows.Add(newRow)
|
||||
Dim newRow1 As DataRow = oMyExclusions.NewRow()
|
||||
newRow1("FILE_CONTAIN") = "\~$"
|
||||
oMyExclusions.Rows.Add(newRow1)
|
||||
Dim newRow2 As DataRow = oMyExclusions.NewRow()
|
||||
newRow2("FILE_CONTAIN") = ".db"
|
||||
oMyExclusions.Rows.Add(newRow2)
|
||||
Dim newRow3 As DataRow = oMyExclusions.NewRow()
|
||||
newRow3("FILE_CONTAIN") = "desktop.ini"
|
||||
oMyExclusions.Rows.Add(newRow3)
|
||||
oMyExclusions.AcceptChanges()
|
||||
Return oMyExclusions
|
||||
Catch ex As Exception
|
||||
MsgBox("Error in CreateExclusionTable" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
Private Function GetTablefromXML() As DataTable
|
||||
Try
|
||||
Dim DS As New DataSet
|
||||
DS.ReadXml(PATH_FileExclusions)
|
||||
Return DS.Tables(0)
|
||||
Catch ex As Exception
|
||||
MsgBox("Error in GetTablefromXML" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
Return Nothing
|
||||
End Try
|
||||
|
||||
End Function
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
|
||||
Reference in New Issue
Block a user