Common: Work on Watcher
This commit is contained in:
@@ -40,17 +40,20 @@ Public Class frmDocumentResultList
|
||||
|
||||
' Helper Classes
|
||||
Private _IDBClient As Client
|
||||
Private ReadOnly _LogConfig As LogConfig
|
||||
Private ReadOnly _Logger As Logger
|
||||
Private ReadOnly _Config As ConfigManager(Of DocumentResultList.Config)
|
||||
Private ReadOnly _Environment As Environment
|
||||
Private ReadOnly _Params As DocumentResultList.Params
|
||||
Private ReadOnly _ResultLists As List(Of DocumentResultList.DocumentResult)
|
||||
Private ReadOnly _Helpers As DocumentResultList.Helpers
|
||||
Private ReadOnly _Filesystem As Modules.Filesystem.File
|
||||
Private ReadOnly _GridBuilder As GridBuilder
|
||||
Private ReadOnly _File As Modules.Windows.File
|
||||
Private ReadOnly _Cache As New DocumentResultList.Cache(50000000)
|
||||
Private ReadOnly LogConfig As LogConfig
|
||||
Private ReadOnly Logger As Logger
|
||||
Private ReadOnly Config As ConfigManager(Of DocumentResultList.Config)
|
||||
Private ReadOnly Environment As Environment
|
||||
Private ReadOnly ResultLists As List(Of DocumentResultList.DocumentResult)
|
||||
Private ReadOnly Filesystem As Modules.Filesystem.File
|
||||
Private ReadOnly GridBuilder As GridBuilder
|
||||
Private ReadOnly FileEx As Modules.Windows.File
|
||||
Private ReadOnly Cache As New DocumentResultList.Cache(50000000)
|
||||
|
||||
Private ReadOnly Helpers As DocumentResultList.Helpers
|
||||
Private ReadOnly Params As DocumentResultList.Params
|
||||
Private WithEvents Watcher As DocumentResultList.Watcher
|
||||
|
||||
Private _Documentloader As DocumentResultList.Loader
|
||||
|
||||
' Runtime variables
|
||||
@@ -60,50 +63,53 @@ Public Class frmDocumentResultList
|
||||
Private _DragBoxFromMouseDown As Rectangle
|
||||
Private _ScreenOffset As Point
|
||||
Private _CurrentDocument As DocumentResultList.Document = Nothing
|
||||
Private _FileOpenList As New Dictionary(Of Integer, String)
|
||||
Private ReadOnly _FileOpenList As New Dictionary(Of Integer, String)
|
||||
Private ReadOnly _Language As String
|
||||
|
||||
Private Property OperationMode As OperationMode Implements IResultForm.OperationMode
|
||||
|
||||
Public Property ShouldReturnToPreviousForm As Boolean = False Implements IResultForm.ShouldReturnToPreviousForm
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, Environment As Environment, Params As DocumentResultList.Params)
|
||||
Public Sub New(pLogConfig As LogConfig, pEnvironment As Environment, pParams As DocumentResultList.Params)
|
||||
' Dieser Aufruf ist für den Designer erforderlich.
|
||||
InitializeComponent()
|
||||
|
||||
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
|
||||
Dim oConfigPath As String = Path.Combine(Application.UserAppDataPath, "ResultList", Params.WindowGuid)
|
||||
Dim oConfigPath As String = Path.Combine(Application.UserAppDataPath, "ResultList", pParams.WindowGuid)
|
||||
|
||||
COLUMN_DOCID = Params.ColumnNames.ObjectIdColumn
|
||||
COLUMN_FILENAME = Params.ColumnNames.FilenameColumn
|
||||
COLUMN_FILEPATH = Params.ColumnNames.FullPathColumn
|
||||
COLUMN_ICON = Params.ColumnNames.IconColumn
|
||||
COLUMN_DOCID = pParams.ColumnNames.ObjectIdColumn
|
||||
COLUMN_FILENAME = pParams.ColumnNames.FilenameColumn
|
||||
COLUMN_FILEPATH = pParams.ColumnNames.FullPathColumn
|
||||
COLUMN_ICON = pParams.ColumnNames.IconColumn
|
||||
|
||||
_LogConfig = LogConfig
|
||||
_Logger = LogConfig.GetLogger()
|
||||
_Config = New ConfigManager(Of DocumentResultList.Config)(LogConfig, oConfigPath, oConfigPath)
|
||||
_Helpers = New DocumentResultList.Helpers(LogConfig)
|
||||
_Filesystem = New Modules.Filesystem.File(_LogConfig)
|
||||
_GridBuilder = New GridBuilder(New List(Of GridView) From {GridView1, GridView2, GridView3})
|
||||
_Environment = Environment
|
||||
_Params = Params
|
||||
_File = New Modules.Windows.File(LogConfig)
|
||||
_ResultLists = Params.Results
|
||||
LogConfig = pLogConfig
|
||||
Logger = pLogConfig.GetLogger()
|
||||
|
||||
_Language = Utils.NotNull(_Environment.User.Language, State.UserState.LANG_EN_US)
|
||||
Config = New ConfigManager(Of DocumentResultList.Config)(pLogConfig, oConfigPath, oConfigPath)
|
||||
Helpers = New DocumentResultList.Helpers(pLogConfig)
|
||||
Filesystem = New Modules.Filesystem.File(pLogConfig)
|
||||
GridBuilder = New GridBuilder(New List(Of GridView) From {GridView1, GridView2, GridView3})
|
||||
FileEx = New Modules.Windows.File(pLogConfig)
|
||||
Watcher = New DocumentResultList.Watcher(pLogConfig)
|
||||
|
||||
Environment = pEnvironment
|
||||
Params = pParams
|
||||
ResultLists = pParams.Results
|
||||
|
||||
_Language = Utils.NotNull(Me.Environment.User.Language, State.UserState.LANG_EN_US)
|
||||
End Sub
|
||||
|
||||
Private Function GetOperationMode() As OperationMode
|
||||
Dim oOperationMode As OperationMode
|
||||
|
||||
If _Environment.Service.IsActive AndAlso _Environment.Service.Address <> String.Empty Then
|
||||
If Environment.Service.IsActive AndAlso Environment.Service.Address <> String.Empty Then
|
||||
oOperationMode = OperationMode.WithAppServer
|
||||
Else
|
||||
oOperationMode = OperationMode.NoAppServer
|
||||
End If
|
||||
|
||||
If _Params.OperationModeOverride <> OperationMode.None Then
|
||||
oOperationMode = _Params.OperationModeOverride
|
||||
If Params.OperationModeOverride <> OperationMode.None Then
|
||||
oOperationMode = Params.OperationModeOverride
|
||||
End If
|
||||
|
||||
Return oOperationMode
|
||||
@@ -118,33 +124,32 @@ Public Class frmDocumentResultList
|
||||
InitAppServer()
|
||||
End If
|
||||
|
||||
_Documentloader = New DocumentResultList.Loader(_LogConfig, OperationMode, _IDBClient, _Environment.User)
|
||||
_Documentloader = New DocumentResultList.Loader(LogConfig, OperationMode, _IDBClient, Environment.User)
|
||||
|
||||
|
||||
If _Params.WindowTitle <> "" Then
|
||||
Text = $"{Text} - {_Params.WindowTitle}"
|
||||
If Params.WindowTitle <> "" Then
|
||||
Text = $"{Text} - {Params.WindowTitle}"
|
||||
End If
|
||||
|
||||
' Initialize Viewer with GDPicture.NET License
|
||||
If _Environment.Settings.GdPictureKey = String.Empty Then
|
||||
If Environment.Settings.GdPictureKey = String.Empty Then
|
||||
Throw New ApplicationException("GDPicture Licensekey is missing!")
|
||||
End If
|
||||
DocumentViewer1.Init(_LogConfig, _Environment.Settings.GdPictureKey)
|
||||
DocumentViewer1.Init(LogConfig, Environment.Settings.GdPictureKey)
|
||||
|
||||
'Load config
|
||||
SplitContainerControl1.SplitterPosition = _Config.Config.SplitContainer1Distance
|
||||
SwitchMainContainerHorizontal.Checked = _Config.Config.SplitContainer1Horizontal
|
||||
SplitContainerControl2.SplitterPosition = _Config.Config.SplitContainer2Distance
|
||||
SwitchDetailContainerHorizontal.Checked = _Config.Config.SplitContainer2Horizontal
|
||||
SplitContainerControl1.SplitterPosition = Config.Config.SplitContainer1Distance
|
||||
SwitchMainContainerHorizontal.Checked = Config.Config.SplitContainer1Horizontal
|
||||
SplitContainerControl2.SplitterPosition = Config.Config.SplitContainer2Distance
|
||||
SwitchDetailContainerHorizontal.Checked = Config.Config.SplitContainer2Horizontal
|
||||
|
||||
If OperationMode <> OperationMode.NoAppServer Then
|
||||
' Location and size will be managed by the ZooFlow Search Window
|
||||
If Utils.IsVisibleOnAnyScreen(_Config.Config.WindowLocation) Then
|
||||
If Utils.LocationIsVisible(_Config.Config.WindowLocation) Then
|
||||
Location = _Config.Config.WindowLocation
|
||||
If Utils.IsVisibleOnAnyScreen(Config.Config.WindowLocation) Then
|
||||
If Utils.LocationIsVisible(Config.Config.WindowLocation) Then
|
||||
Location = Config.Config.WindowLocation
|
||||
End If
|
||||
If Utils.SizeIsVisible(_Config.Config.WindowSize) Then
|
||||
Size = _Config.Config.WindowSize
|
||||
If Utils.SizeIsVisible(Config.Config.WindowSize) Then
|
||||
Size = Config.Config.WindowSize
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -152,7 +157,7 @@ Public Class frmDocumentResultList
|
||||
SwitchDetailContainerHorizontal.Visibility = BarItemVisibility.Never
|
||||
End If
|
||||
|
||||
_GridBuilder.
|
||||
GridBuilder.
|
||||
WithDefaults().
|
||||
WithReadOnlyOptions()
|
||||
|
||||
@@ -163,7 +168,7 @@ Public Class frmDocumentResultList
|
||||
UpdateTotalResults()
|
||||
UpdateGridData()
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Logger.Error(ex)
|
||||
MessageBox.Show("Error while loading results:" & vbNewLine & vbNewLine & ex.Message, Text)
|
||||
Finally
|
||||
_IsLoading = False
|
||||
@@ -174,25 +179,25 @@ Public Class frmDocumentResultList
|
||||
Try
|
||||
GridViewSave_Layout(_ActiveGrid.MainView)
|
||||
|
||||
_Config.Config.WindowLocation = Location
|
||||
_Config.Config.WindowSize = Size
|
||||
_Config.Save()
|
||||
Config.Config.WindowLocation = Location
|
||||
Config.Config.WindowSize = Size
|
||||
Config.Save()
|
||||
|
||||
DocumentViewer1.Done()
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub GridView_FocusedRowChanged(sender As GridView, e As FocusedRowChangedEventArgs)
|
||||
_Helpers.SetRowHandle(e)
|
||||
Helpers.SetRowHandle(e)
|
||||
|
||||
Try
|
||||
Reset_Errors()
|
||||
Cursor = Cursors.WaitCursor
|
||||
|
||||
If e.FocusedRowHandle >= 0 Then
|
||||
Dim oRow = sender.GetDataRow(_Helpers.ActiveRowHandle)
|
||||
Dim oRow = sender.GetDataRow(Helpers.ActiveRowHandle)
|
||||
Dim oObjectId = oRow.ItemEx(Of Long)(COLUMN_DOCID, 0)
|
||||
Dim oFullPath = oRow.ItemEx(Of String)(COLUMN_FILEPATH, "")
|
||||
Dim oDocumentInfo As DocumentResultList.Document = Nothing
|
||||
@@ -223,22 +228,29 @@ Public Class frmDocumentResultList
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Logger.Error(ex)
|
||||
Show_CriticalError(ex.Message)
|
||||
Finally
|
||||
Cursor = Cursors.Default
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Sub Watcher_FileChanged(sender As Object, e As DocumentResultList.Watcher.FileChangedArgs) Handles Watcher.FileChanged
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function InitAppServer() As Boolean
|
||||
Dim oSplit As List(Of String) = _Environment.Service.Address.Split(":").ToList()
|
||||
Dim oSplit As List(Of String) = Environment.Service.Address.Split(":").ToList()
|
||||
Dim oAddress As String = oSplit.Item(0)
|
||||
Dim oPort As Integer = oSplit.Item(1)
|
||||
|
||||
_IDBClient = New Client(_LogConfig, oAddress, oPort)
|
||||
_IDBClient = New Client(LogConfig, oAddress, oPort)
|
||||
' TODO: INitialize databasewithfallback
|
||||
'_Database
|
||||
|
||||
If Not _IDBClient.Connect() Then
|
||||
_Logger.Warn("Client could not connect to Service at [{0}]", _Environment.Service.Address)
|
||||
Logger.Warn("Client could not connect to Service at [{0}]", Environment.Service.Address)
|
||||
Return False
|
||||
End If
|
||||
|
||||
@@ -254,7 +266,7 @@ Public Class frmDocumentResultList
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Logger.Error(ex)
|
||||
MessageBox.Show("Error while loading results:" & vbNewLine & vbNewLine & ex.Message, Text)
|
||||
Return False
|
||||
Finally
|
||||
@@ -277,31 +289,31 @@ Public Class frmDocumentResultList
|
||||
|
||||
Private Sub UpdateGridData()
|
||||
' Load Grids
|
||||
For oIndex = 0 To _ResultLists.Count - 1
|
||||
For oIndex = 0 To ResultLists.Count - 1
|
||||
Select Case oIndex
|
||||
Case 0
|
||||
Dim oResult As DocumentResultList.DocumentResult = _ResultLists.Item(0)
|
||||
Dim oResult As DocumentResultList.DocumentResult = ResultLists.Item(0)
|
||||
|
||||
LoadGridData(oResult)
|
||||
CreateDocumentGrid(GridView1, oResult)
|
||||
RestoreLayout(GridView1)
|
||||
UpdateGridHeader(_ResultLists, oIndex, oResult.Datatable.Rows.Count)
|
||||
UpdateGridHeader(ResultLists, oIndex, oResult.Datatable.Rows.Count)
|
||||
|
||||
Case 1
|
||||
Dim oResult As DocumentResultList.DocumentResult = _ResultLists.Item(1)
|
||||
Dim oResult As DocumentResultList.DocumentResult = ResultLists.Item(1)
|
||||
|
||||
LoadGridData(oResult)
|
||||
CreateDocumentGrid(GridView2, oResult)
|
||||
RestoreLayout(GridView2)
|
||||
UpdateGridHeader(_ResultLists, oIndex, oResult.Datatable.Rows.Count)
|
||||
UpdateGridHeader(ResultLists, oIndex, oResult.Datatable.Rows.Count)
|
||||
|
||||
Case 2
|
||||
Dim oResult As DocumentResultList.DocumentResult = _ResultLists.Item(2)
|
||||
Dim oResult As DocumentResultList.DocumentResult = ResultLists.Item(2)
|
||||
|
||||
LoadGridData(oResult)
|
||||
CreateDocumentGrid(GridView3, oResult)
|
||||
RestoreLayout(GridView3)
|
||||
UpdateGridHeader(_ResultLists, oIndex, oResult.Datatable.Rows.Count)
|
||||
UpdateGridHeader(ResultLists, oIndex, oResult.Datatable.Rows.Count)
|
||||
|
||||
Case Else
|
||||
MessageBox.Show(Constants.MESSAGE_TOO_MANY_SEARCHES, Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
|
||||
@@ -310,7 +322,7 @@ Public Class frmDocumentResultList
|
||||
Next
|
||||
|
||||
' Hide Grids depending on Result count
|
||||
Select Case _ResultLists.Count
|
||||
Select Case ResultLists.Count
|
||||
Case 0
|
||||
|
||||
SplitContainerControl1.SetPanelCollapsed(True)
|
||||
@@ -342,7 +354,7 @@ Public Class frmDocumentResultList
|
||||
Private Sub UpdateTotalResults()
|
||||
Dim oTotalResults = 0
|
||||
|
||||
For Each oList In _ResultLists
|
||||
For Each oList In ResultLists
|
||||
oTotalResults += oList.Datatable.Rows.Count
|
||||
Next
|
||||
|
||||
@@ -411,25 +423,25 @@ Public Class frmDocumentResultList
|
||||
Dim oCreatedColumn = GridView.Columns(oCreated)
|
||||
If Not IsNothing(oCreatedColumn) Then
|
||||
oCreatedColumn.DisplayFormat.FormatType = FormatType.DateTime
|
||||
oCreatedColumn.DisplayFormat.FormatString = _Environment.User.DateFormat & " HH:MM:ss"
|
||||
oCreatedColumn.DisplayFormat.FormatString = Environment.User.DateFormat & " HH:MM:ss"
|
||||
End If
|
||||
|
||||
Dim oChangedColumn = GridView.Columns(oChanged)
|
||||
If Not IsNothing(oChangedColumn) Then
|
||||
oChangedColumn.DisplayFormat.FormatType = FormatType.DateTime
|
||||
oChangedColumn.DisplayFormat.FormatString = _Environment.User.DateFormat & " HH:MM:ss"
|
||||
oChangedColumn.DisplayFormat.FormatString = Environment.User.DateFormat & " HH:MM:ss"
|
||||
End If
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
|
||||
GridView.OptionsView.BestFitMaxRowCount = 30
|
||||
GridView.BestFitColumns()
|
||||
Catch ex As ApplicationException
|
||||
MsgBox($"Error while loading grid data for search {Result.Title}: {vbNewLine}{vbNewLine}{ex.Message}", MsgBoxStyle.Critical, Text)
|
||||
_Logger.Error(ex)
|
||||
Logger.Error(ex)
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
@@ -447,14 +459,14 @@ Public Class frmDocumentResultList
|
||||
Dim oValue = oRow.Item(COLUMN_FILENAME)
|
||||
|
||||
If e.Column.FieldName = COLUMN_ICON Then
|
||||
Dim oIcon = _Helpers.GetIconByExtension(oValue)
|
||||
Dim oIcon = Helpers.GetIconByExtension(oValue)
|
||||
Dim offsetX = 0
|
||||
Dim offsetY = 0
|
||||
|
||||
e.Cache.DrawImage(oIcon, e.Bounds.X + offsetX, e.Bounds.Y + offsetY, 18, 18)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
@@ -485,7 +497,7 @@ Public Class frmDocumentResultList
|
||||
|
||||
Private Function GetActiveRow() As DataRow
|
||||
Dim oActiveGrid = GetActiveGridControl()
|
||||
Dim oActiveRowhandle = _Helpers.ActiveRowHandle
|
||||
Dim oActiveRowhandle = Helpers.ActiveRowHandle
|
||||
|
||||
If oActiveGrid IsNot Nothing And oActiveRowhandle <> Constants.NO_ROW_HANDLE Then
|
||||
Dim oView = DirectCast(oActiveGrid.DefaultView, GridView)
|
||||
@@ -529,17 +541,17 @@ Public Class frmDocumentResultList
|
||||
|
||||
Private Sub GridView1_ColumnFilterChanged(sender As GridView, e As EventArgs) Handles GridView1.ColumnFilterChanged
|
||||
Dim oRowCount = sender.RowCount
|
||||
UpdateGridHeader(_ResultLists, 0, oRowCount)
|
||||
UpdateGridHeader(ResultLists, 0, oRowCount)
|
||||
End Sub
|
||||
|
||||
Private Sub GridView2_ColumnFilterChanged(sender As GridView, e As EventArgs) Handles GridView2.ColumnFilterChanged
|
||||
Dim oRowCount = sender.RowCount
|
||||
UpdateGridHeader(_ResultLists, 1, oRowCount)
|
||||
UpdateGridHeader(ResultLists, 1, oRowCount)
|
||||
End Sub
|
||||
|
||||
Private Sub GridView3_ColumnFilterChanged(sender As GridView, e As EventArgs) Handles GridView3.ColumnFilterChanged
|
||||
Dim oRowCount = sender.RowCount
|
||||
UpdateGridHeader(_ResultLists, 2, oRowCount)
|
||||
UpdateGridHeader(ResultLists, 2, oRowCount)
|
||||
End Sub
|
||||
|
||||
Private Sub BarButtonItem4_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonBack.ItemClick
|
||||
@@ -579,7 +591,7 @@ Public Class frmDocumentResultList
|
||||
End If
|
||||
UpdateGridData()
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
End If
|
||||
End Sub
|
||||
@@ -604,6 +616,7 @@ Public Class frmDocumentResultList
|
||||
|
||||
|
||||
|
||||
|
||||
#Region "Context Menu"
|
||||
|
||||
Private Sub GridView_PopupMenuShowing(sender As Object, e As PopupMenuShowingEventArgs) Handles GridView2.PopupMenuShowing, GridView3.PopupMenuShowing, GridView1.PopupMenuShowing
|
||||
@@ -637,7 +650,7 @@ Public Class frmDocumentResultList
|
||||
_CurrentDocument.Id = Nothing
|
||||
End If
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Logger.Error(ex)
|
||||
MsgBox("Unexpected Error while preparing context menu", MsgBoxStyle.Critical, Text)
|
||||
End Try
|
||||
End Sub
|
||||
@@ -652,7 +665,7 @@ Public Class frmDocumentResultList
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
_File.OpenFileProperties(_CurrentDocument.FullPath)
|
||||
FileEx.OpenFileProperties(_CurrentDocument.FullPath)
|
||||
End Sub
|
||||
|
||||
Private Sub MenuItemFilepathCopyIDB_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemFilepathCopy.ItemClick
|
||||
@@ -678,7 +691,7 @@ Public Class frmDocumentResultList
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim oPropertyDialog As New frmObjectPropertyDialog(_LogConfig, _Environment, _IDBClient, _CurrentDocument.Id)
|
||||
Dim oPropertyDialog As New frmObjectPropertyDialog(LogConfig, Environment, _IDBClient, _CurrentDocument.Id)
|
||||
oPropertyDialog.Show()
|
||||
End Sub
|
||||
|
||||
@@ -692,7 +705,7 @@ Public Class frmDocumentResultList
|
||||
.FileName = _CurrentDocument.FullPath
|
||||
})
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
@@ -701,7 +714,7 @@ Public Class frmDocumentResultList
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim oPropertyDialog As New frmObjectPropertyDialog(_LogConfig, _Environment, _IDBClient, _CurrentDocument.Id)
|
||||
Dim oPropertyDialog As New frmObjectPropertyDialog(LogConfig, Environment, _IDBClient, _CurrentDocument.Id)
|
||||
oPropertyDialog.Show()
|
||||
End Sub
|
||||
|
||||
@@ -751,35 +764,35 @@ Public Class frmDocumentResultList
|
||||
#Region "Layout"
|
||||
Private Sub SplitContainerControl1_SplitterPositionChanged(sender As Object, e As EventArgs) Handles SplitContainerControl1.SplitterPositionChanged
|
||||
If _IsLoading = False Then
|
||||
_Config.Config.SplitContainer1Distance = SplitContainerControl1.SplitterPosition
|
||||
Config.Config.SplitContainer1Distance = SplitContainerControl1.SplitterPosition
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub SplitContainerControl2_SplitterPositionChanged(sender As Object, e As EventArgs) Handles SplitContainerControl2.SplitterPositionChanged
|
||||
If _IsLoading = False Then
|
||||
_Config.Config.SplitContainer2Distance = SplitContainerControl2.SplitterPosition
|
||||
Config.Config.SplitContainer2Distance = SplitContainerControl2.SplitterPosition
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub SwitchMainContainerHorizontal_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles SwitchMainContainerHorizontal.CheckedChanged
|
||||
SplitContainerControl1.Horizontal = SwitchMainContainerHorizontal.Checked
|
||||
|
||||
If _Config IsNot Nothing And _IsLoading = False Then
|
||||
_Config.Config.SplitContainer1Horizontal = SwitchMainContainerHorizontal.Checked
|
||||
If Config IsNot Nothing And _IsLoading = False Then
|
||||
Config.Config.SplitContainer1Horizontal = SwitchMainContainerHorizontal.Checked
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub SwitchDetailContainerHorizontal2_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles SwitchDetailContainerHorizontal.CheckedChanged
|
||||
SplitContainerControl2.Horizontal = SwitchDetailContainerHorizontal.Checked
|
||||
|
||||
If _Config IsNot Nothing And _IsLoading = False Then
|
||||
_Config.Config.SplitContainer2Horizontal = SwitchDetailContainerHorizontal.Checked
|
||||
If Config IsNot Nothing And _IsLoading = False Then
|
||||
Config.Config.SplitContainer2Horizontal = SwitchDetailContainerHorizontal.Checked
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function GetDevexpressGrid_LayoutName(pGridView As GridView)
|
||||
Dim Filename As String = $"DevExpressGridViewDocResult_{pGridView.Name}UserLayout.xml"
|
||||
Return Path.Combine(_Config.UserConfigPath.Replace("UserConfig.xml", ""), Filename)
|
||||
Return Path.Combine(Config.UserConfigPath.Replace("UserConfig.xml", ""), Filename)
|
||||
End Function
|
||||
|
||||
|
||||
@@ -788,8 +801,8 @@ Public Class frmDocumentResultList
|
||||
Dim oXml As String = GetDevexpressGrid_LayoutName(pGridView)
|
||||
pGridView.SaveLayoutToXml(oXml, OptionsLayoutBase.FullLayout)
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
_Logger.Info("Error while saving GridLayout: " & ex.Message)
|
||||
Logger.Error(ex)
|
||||
Logger.Info("Error while saving GridLayout: " & ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub RestoreLayout(pGridView As GridView)
|
||||
@@ -799,8 +812,8 @@ Public Class frmDocumentResultList
|
||||
pGridView.RestoreLayoutFromXml(oLayoutFile, OptionsLayoutBase.FullLayout)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
_Logger.Info("Error while restoring layout: " & ex.Message)
|
||||
Logger.Error(ex)
|
||||
Logger.Info("Error while restoring layout: " & ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user