diff --git a/GUIs.Common/Common.vbproj b/GUIs.Common/Common.vbproj index e4ccd8e6..e7ec975b 100644 --- a/GUIs.Common/Common.vbproj +++ b/GUIs.Common/Common.vbproj @@ -106,6 +106,7 @@ Form + @@ -284,5 +285,17 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/GUIs.Common/DocumentResultList/DocumentLoader.vb b/GUIs.Common/DocumentResultList/DocumentLoader.vb new file mode 100644 index 00000000..5ed3dcdb --- /dev/null +++ b/GUIs.Common/DocumentResultList/DocumentLoader.vb @@ -0,0 +1,92 @@ +Imports System.IO +Imports DigitalData.Modules.EDMI.API +Imports DigitalData.Modules.EDMI.API.Client +Imports DigitalData.Modules.EDMI.API.EDMIServiceReference +Imports DigitalData.Modules.Logging +Imports DigitalData.Modules.ZooFlow.Constants + +Public Class DocumentLoader + Inherits Modules.ZooFlow.Base.BaseClass + + Private ReadOnly Client As Client + Private ReadOnly Mode As OperationMode + Private ReadOnly User As DigitalData.Modules.ZooFlow.State.UserState + + Public Sub New(pLogConfig As LogConfig, pMode As OperationMode, pClient As Client, pUser As DigitalData.Modules.ZooFlow.State.UserState) + MyBase.New(pLogConfig) + Client = pClient + Mode = pMode + User = pUser + End Sub + + Public Function Load(pObjectId As Long, pFullPath As String) As DocumentResultInfo + Select Case Mode + Case OperationMode.NoAppServer + Return Load_FromWindream(pObjectId, pFullPath) + + Case OperationMode.WithAppServer + Return Load_FromIDB(pObjectId) + + + Case OperationMode.ZooFlow + Return Load_FromZooflow(pObjectId) + + Case Else + Return Nothing + End Select + End Function + + Private Function Load_FromWindream(pObjectId As Long, pFullPath As String) As DocumentResultInfo + Dim oFileInfo As New FileInfo(pFullPath) + Dim oResultDocumentInfo = New DocumentResultInfo(pObjectId) With { + .Contents = Load_FromDisk(pFullPath), + .AccessRight = Rights.AccessRight.FULL, + .FullPath = pFullPath, + .Extension = oFileInfo.Extension.Substring(1) + } + + Return oResultDocumentInfo + End Function + + Private Function Load_FromIDB(pObjectId As Long) As DocumentResultInfo + Dim oDocumentInfo As DocumentInfo = Client.GetDocumentInfo(User.UserId, pObjectId) + Dim oFileInfo As New FileInfo(oDocumentInfo.FullPath) + Dim oResultDocumentInfo As New DocumentResultInfo(pObjectId) With { + .Contents = Load_FromDisk(oDocumentInfo.FullPath), + .AccessRight = oDocumentInfo.AccessRight, + .FullPath = oDocumentInfo.FullPath, + .Extension = oFileInfo.Extension.Substring(1) + } + + Return oResultDocumentInfo + End Function + + Private Function Load_FromZooflow(pObjectId As Long) As DocumentResultInfo + Dim oFileObject As FileObject = Client.GetFileObject(pObjectId, pLoadFileContents:=True) + Dim oResultDocumentInfo As New DocumentResultInfo(pObjectId) With { + .Contents = oFileObject._FileContents, + .Extension = oFileObject._FileExtension, + .AccessRight = Rights.AccessRight.FULL, + .FullPath = Nothing + } + + Return oResultDocumentInfo + End Function + + Private Function Load_FromDisk(pFullPath) As Byte() + Try + Logger.Debug("Loading file [{0}]", pFullPath) + Using oStream = File.OpenRead(pFullPath) + Using oMemoryStream = New MemoryStream() + oStream.CopyTo(oMemoryStream) + Logger.Debug("Loaded file [{0}] successfully.", pFullPath) + Return oMemoryStream.ToArray() + End Using + End Using + Catch ex As Exception + Logger.Warn("Loading file [{0}] failed.", pFullPath) + Logger.Error(ex) + Return Nothing + End Try + End Function +End Class diff --git a/GUIs.Common/DocumentResultList/DocumentResultCache.vb b/GUIs.Common/DocumentResultList/DocumentResultCache.vb index 0edd3291..a9068712 100644 --- a/GUIs.Common/DocumentResultList/DocumentResultCache.vb +++ b/GUIs.Common/DocumentResultList/DocumentResultCache.vb @@ -37,11 +37,11 @@ Public Class DocumentResultCache End Get End Property - Public Sub Add(item As DocumentResultInfo) Implements ICollection(Of DocumentResultInfo).Add + Public Sub Add(pItem As DocumentResultInfo) Implements ICollection(Of DocumentResultInfo).Add SyncLock Lock - If Index.ContainsKey(item.FullPath) Then - List.Remove(Index(item.FullPath)) - Index(item.FullPath) = List.AddLast(item) + If Index.ContainsKey(pItem.Id) Then + List.Remove(Index(pItem.Id)) + Index(pItem.Id) = List.AddLast(pItem) Return End If @@ -50,23 +50,22 @@ Public Class DocumentResultCache Remove(Oldest) End If - Index.Add(item.FullPath, List.AddLast(item)) + Index.Add(pItem.Id, List.AddLast(pItem)) - If item.Contents IsNot Nothing Then - Count = Count + item.Contents?.Length + If pItem.Contents IsNot Nothing Then + Count += pItem.Contents?.Length End If End SyncLock End Sub - Public Function Contains(item As DocumentResultInfo) As Boolean Implements ICollection(Of DocumentResultInfo).Contains - Return Index.ContainsKey(item.FullPath) + Public Function Contains(pItem As DocumentResultInfo) As Boolean Implements ICollection(Of DocumentResultInfo).Contains + Return Index.ContainsKey(pItem.Id) End Function - Public Sub CopyTo(array As DocumentResultInfo(), ByVal arrayIndex As Integer) Implements ICollection(Of DocumentResultInfo).CopyTo + Public Sub CopyTo(pArray As DocumentResultInfo(), pIndex As Integer) Implements ICollection(Of DocumentResultInfo).CopyTo SyncLock Lock - For Each item As DocumentResultInfo In Me - array(Math.Min(System.Threading.Interlocked.Increment(arrayIndex), arrayIndex - 1)) = item + pArray(Math.Min(System.Threading.Interlocked.Increment(pIndex), pIndex - 1)) = item Next End SyncLock End Sub @@ -84,15 +83,15 @@ Public Class DocumentResultCache End Get End Property - Public Function Remove(item As DocumentResultInfo) As Boolean Implements ICollection(Of DocumentResultInfo).Remove + Public Function Remove(pItem As DocumentResultInfo) As Boolean Implements ICollection(Of DocumentResultInfo).Remove SyncLock Lock - If Index.ContainsKey(item.FullPath) Then - List.Remove(Index(item.FullPath)) - Index.Remove(item.FullPath) + If Index.ContainsKey(pItem.Id) Then + List.Remove(Index(pItem.Id)) + Index.Remove(pItem.Id) - If item.Contents IsNot Nothing Then - Count -= item.Contents.Length + If pItem.Contents IsNot Nothing Then + Count -= pItem.Contents.Length End If Return True diff --git a/GUIs.Common/DocumentResultList/DocumentResultInfo.vb b/GUIs.Common/DocumentResultList/DocumentResultInfo.vb index d6e90ef8..1a085877 100644 --- a/GUIs.Common/DocumentResultList/DocumentResultInfo.vb +++ b/GUIs.Common/DocumentResultList/DocumentResultInfo.vb @@ -1,8 +1,32 @@ Imports DigitalData.Modules.EDMI.API.Client +Imports DigitalData.Modules.EDMI.API.Rights Public Class DocumentResultInfo - Inherits DocumentInfo + ''' + ''' Primary identifier of the Document. + ''' Can be a Windream DocId or an IDB ObjectId. + ''' + Public Property Id As Long - Public Contents As Byte() - Public LastWriteTime As Date + Public Property AccessRight As AccessRight + + ''' + ''' Extension is needed for determining the type of file + ''' and showing it in the DocumentViewer + ''' + Public Property Extension As String + ''' + ''' Binary contents of the file. + ''' + Public Property Contents As Byte() + + + + ' Optional properties + Public Property LastWriteTime As Date = Nothing + Public Property FullPath As String = Nothing + + Public Sub New(pPrimaryKey As Long) + Id = pPrimaryKey + End Sub End Class \ No newline at end of file diff --git a/GUIs.Common/DocumentResultList/DocumentResultList.vb b/GUIs.Common/DocumentResultList/DocumentResultList.vb index ac72e588..b52c6ac5 100644 --- a/GUIs.Common/DocumentResultList/DocumentResultList.vb +++ b/GUIs.Common/DocumentResultList/DocumentResultList.vb @@ -4,9 +4,9 @@ Imports DevExpress.XtraGrid.Views.Base Imports DigitalData.Modules.Logging Public Class DocumentResultList - Private Logger As Logger + Private ReadOnly Logger As Logger - Public ActiveRowHandle As Integer = Constants.NO_ROW_HANDLE + Public Property ActiveRowHandle As Integer = Constants.NO_ROW_HANDLE Public Sub New(LogConfig As LogConfig) Logger = LogConfig.GetLogger() diff --git a/GUIs.Common/DocumentResultList/frmDocumentResultList.Designer.vb b/GUIs.Common/DocumentResultList/frmDocumentResultList.Designer.vb index 097d871f..45208a5e 100644 --- a/GUIs.Common/DocumentResultList/frmDocumentResultList.Designer.vb +++ b/GUIs.Common/DocumentResultList/frmDocumentResultList.Designer.vb @@ -32,9 +32,7 @@ Partial Class frmDocumentResultList Me.BarStaticItem1 = New DevExpress.XtraBars.BarStaticItem() Me.labelResultCount = New DevExpress.XtraBars.BarStaticItem() Me.BarButtonBack = New DevExpress.XtraBars.BarButtonItem() - Me.BarButtonItem5 = New DevExpress.XtraBars.BarButtonItem() - Me.RepositoryItemTextEdit1 = New DevExpress.XtraEditors.Repository.RepositoryItemTextEdit() - Me.RepositoryItemTextEdit2 = New DevExpress.XtraEditors.Repository.RepositoryItemTextEdit() + Me.BarButtonResetLayout = New DevExpress.XtraBars.BarButtonItem() Me.labelCriticalError = New DevExpress.XtraBars.BarStaticItem() Me.labelWarning = New DevExpress.XtraBars.BarStaticItem() Me.MenuItemFileOpen = New DevExpress.XtraBars.BarButtonItem() @@ -43,10 +41,14 @@ Partial Class frmDocumentResultList Me.MenuItemFilepathCopy = New DevExpress.XtraBars.BarButtonItem() Me.MenuItemFolderpathCopy = New DevExpress.XtraBars.BarButtonItem() Me.MenuItemPropertiesECM = New DevExpress.XtraBars.BarButtonItem() + Me.MenuItemsOpenFileZooFlow = New DevExpress.XtraBars.BarButtonItem() + Me.MenuItemPropertiesZooFlow = New DevExpress.XtraBars.BarButtonItem() Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.RibbonPageGroup_Navigation = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonPageGroup_Layout = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonPageGroup_Export = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() + Me.RepositoryItemTextEdit1 = New DevExpress.XtraEditors.Repository.RepositoryItemTextEdit() + Me.RepositoryItemTextEdit2 = New DevExpress.XtraEditors.Repository.RepositoryItemTextEdit() Me.RibbonStatusBar = New DevExpress.XtraBars.Ribbon.RibbonStatusBar() Me.SplitContainerControl2 = New DevExpress.XtraEditors.SplitContainerControl() Me.GridControl2 = New DevExpress.XtraGrid.GridControl() @@ -61,7 +63,12 @@ Partial Class frmDocumentResultList Me.MenuFullAccess_IDB = New DevExpress.XtraBars.PopupMenu(Me.components) Me.MenuViewAccess_IDB = New DevExpress.XtraBars.PopupMenu(Me.components) Me.MenuFullAccess_EDM = New DevExpress.XtraBars.PopupMenu(Me.components) + Me.MenuFullAccess_ZOOFLOW = New DevExpress.XtraBars.PopupMenu(Me.components) CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.SplitContainerControl1.Panel1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SplitContainerControl1.Panel1.SuspendLayout() + CType(Me.SplitContainerControl1.Panel2, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SplitContainerControl1.Panel2.SuspendLayout() Me.SplitContainerControl1.SuspendLayout() CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.GridView1, System.ComponentModel.ISupportInitialize).BeginInit() @@ -69,16 +76,25 @@ Partial Class frmDocumentResultList CType(Me.RepositoryItemTextEdit1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.RepositoryItemTextEdit2, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.SplitContainerControl2, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.SplitContainerControl2.Panel1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SplitContainerControl2.Panel1.SuspendLayout() + CType(Me.SplitContainerControl2.Panel2, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SplitContainerControl2.Panel2.SuspendLayout() Me.SplitContainerControl2.SuspendLayout() CType(Me.GridControl2, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.GridView2, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.GridControl3, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.GridView3, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.SplitContainerControl3, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.SplitContainerControl3.Panel1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SplitContainerControl3.Panel1.SuspendLayout() + CType(Me.SplitContainerControl3.Panel2, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SplitContainerControl3.Panel2.SuspendLayout() Me.SplitContainerControl3.SuspendLayout() CType(Me.MenuFullAccess_IDB, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.MenuViewAccess_IDB, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.MenuFullAccess_EDM, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MenuFullAccess_ZOOFLOW, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'SplitContainerControl1 @@ -86,8 +102,14 @@ Partial Class frmDocumentResultList Me.SplitContainerControl1.CollapsePanel = DevExpress.XtraEditors.SplitCollapsePanel.Panel2 resources.ApplyResources(Me.SplitContainerControl1, "SplitContainerControl1") Me.SplitContainerControl1.Name = "SplitContainerControl1" + ' + 'SplitContainerControl1.Panel1 + ' Me.SplitContainerControl1.Panel1.Controls.Add(Me.GridControl1) resources.ApplyResources(Me.SplitContainerControl1.Panel1, "SplitContainerControl1.Panel1") + ' + 'SplitContainerControl1.Panel2 + ' Me.SplitContainerControl1.Panel2.Controls.Add(Me.SplitContainerControl2) resources.ApplyResources(Me.SplitContainerControl1.Panel2, "SplitContainerControl1.Panel2") Me.SplitContainerControl1.SplitterPosition = 382 @@ -128,9 +150,9 @@ Partial Class frmDocumentResultList 'RibbonControl ' Me.RibbonControl.ExpandCollapseItem.Id = 0 - Me.RibbonControl.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl.ExpandCollapseItem, Me.RibbonControl.SearchEditItem, Me.SwitchMainContainerHorizontal, Me.SwitchDetailContainerHorizontal, Me.BarButtonItemExportGrid1, Me.BarStaticItem1, Me.labelResultCount, Me.BarButtonBack, Me.BarButtonItem5, Me.labelCriticalError, Me.labelWarning, Me.MenuItemFileOpen, Me.MenuItemPropertiesIDB, Me.MenuItemFolderOpen, Me.MenuItemFilepathCopy, Me.MenuItemFolderpathCopy, Me.MenuItemPropertiesECM}) + Me.RibbonControl.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl.ExpandCollapseItem, Me.RibbonControl.SearchEditItem, Me.SwitchMainContainerHorizontal, Me.SwitchDetailContainerHorizontal, Me.BarButtonItemExportGrid1, Me.BarStaticItem1, Me.labelResultCount, Me.BarButtonBack, Me.BarButtonResetLayout, Me.labelCriticalError, Me.labelWarning, Me.MenuItemFileOpen, Me.MenuItemPropertiesIDB, Me.MenuItemFolderOpen, Me.MenuItemFilepathCopy, Me.MenuItemFolderpathCopy, Me.MenuItemPropertiesECM, Me.MenuItemsOpenFileZooFlow, Me.MenuItemPropertiesZooFlow}) resources.ApplyResources(Me.RibbonControl, "RibbonControl") - Me.RibbonControl.MaxItemId = 27 + Me.RibbonControl.MaxItemId = 29 Me.RibbonControl.Name = "RibbonControl" Me.RibbonControl.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1}) Me.RibbonControl.RepositoryItems.AddRange(New DevExpress.XtraEditors.Repository.RepositoryItem() {Me.RepositoryItemTextEdit1, Me.RepositoryItemTextEdit2}) @@ -183,23 +205,13 @@ Partial Class frmDocumentResultList Me.BarButtonBack.ImageOptions.LargeImage = CType(resources.GetObject("BarButtonBack.ImageOptions.LargeImage"), System.Drawing.Image) Me.BarButtonBack.Name = "BarButtonBack" ' - 'BarButtonItem5 + 'BarButtonResetLayout ' - resources.ApplyResources(Me.BarButtonItem5, "BarButtonItem5") - Me.BarButtonItem5.Id = 10 - Me.BarButtonItem5.ImageOptions.SvgImage = CType(resources.GetObject("BarButtonItem5.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) - Me.BarButtonItem5.Name = "BarButtonItem5" - Me.BarButtonItem5.Visibility = DevExpress.XtraBars.BarItemVisibility.OnlyInCustomizing - ' - 'RepositoryItemTextEdit1 - ' - resources.ApplyResources(Me.RepositoryItemTextEdit1, "RepositoryItemTextEdit1") - Me.RepositoryItemTextEdit1.Name = "RepositoryItemTextEdit1" - ' - 'RepositoryItemTextEdit2 - ' - resources.ApplyResources(Me.RepositoryItemTextEdit2, "RepositoryItemTextEdit2") - Me.RepositoryItemTextEdit2.Name = "RepositoryItemTextEdit2" + resources.ApplyResources(Me.BarButtonResetLayout, "BarButtonResetLayout") + Me.BarButtonResetLayout.Id = 10 + Me.BarButtonResetLayout.ImageOptions.SvgImage = CType(resources.GetObject("BarButtonItem5.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) + Me.BarButtonResetLayout.Name = "BarButtonResetLayout" + Me.BarButtonResetLayout.Visibility = DevExpress.XtraBars.BarItemVisibility.OnlyInCustomizing ' 'labelCriticalError ' @@ -231,7 +243,7 @@ Partial Class frmDocumentResultList ' resources.ApplyResources(Me.MenuItemFileOpen, "MenuItemFileOpen") Me.MenuItemFileOpen.Id = 16 - Me.MenuItemFileOpen.ImageOptions.SvgImage = CType(resources.GetObject("MenuItemFileOpen.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) + Me.MenuItemFileOpen.ImageOptions.SvgImage = Global.DigitalData.GUIs.Common.My.Resources.Resources.singlepageview Me.MenuItemFileOpen.Name = "MenuItemFileOpen" ' 'MenuItemPropertiesIDB @@ -269,6 +281,20 @@ Partial Class frmDocumentResultList Me.MenuItemPropertiesECM.ImageOptions.SvgImage = CType(resources.GetObject("MenuItemPropertiesECM.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) Me.MenuItemPropertiesECM.Name = "MenuItemPropertiesECM" ' + 'MenuItemsOpenFileZooFlow + ' + resources.ApplyResources(Me.MenuItemsOpenFileZooFlow, "MenuItemsOpenFileZooFlow") + Me.MenuItemsOpenFileZooFlow.Id = 27 + Me.MenuItemsOpenFileZooFlow.ImageOptions.SvgImage = Global.DigitalData.GUIs.Common.My.Resources.Resources.singlepageview1 + Me.MenuItemsOpenFileZooFlow.Name = "MenuItemsOpenFileZooFlow" + ' + 'MenuItemPropertiesZooFlow + ' + resources.ApplyResources(Me.MenuItemPropertiesZooFlow, "MenuItemPropertiesZooFlow") + Me.MenuItemPropertiesZooFlow.Id = 28 + Me.MenuItemPropertiesZooFlow.ImageOptions.SvgImage = Global.DigitalData.GUIs.Common.My.Resources.Resources.editcolors + Me.MenuItemPropertiesZooFlow.Name = "MenuItemPropertiesZooFlow" + ' 'RibbonPage1 ' Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup_Navigation, Me.RibbonPageGroup_Layout, Me.RibbonPageGroup_Export}) @@ -287,7 +313,7 @@ Partial Class frmDocumentResultList Me.RibbonPageGroup_Layout.Alignment = DevExpress.XtraBars.Ribbon.RibbonPageGroupAlignment.Far Me.RibbonPageGroup_Layout.ItemLinks.Add(Me.SwitchMainContainerHorizontal) Me.RibbonPageGroup_Layout.ItemLinks.Add(Me.SwitchDetailContainerHorizontal) - Me.RibbonPageGroup_Layout.ItemLinks.Add(Me.BarButtonItem5) + Me.RibbonPageGroup_Layout.ItemLinks.Add(Me.BarButtonResetLayout) Me.RibbonPageGroup_Layout.Name = "RibbonPageGroup_Layout" resources.ApplyResources(Me.RibbonPageGroup_Layout, "RibbonPageGroup_Layout") ' @@ -298,6 +324,16 @@ Partial Class frmDocumentResultList Me.RibbonPageGroup_Export.Name = "RibbonPageGroup_Export" resources.ApplyResources(Me.RibbonPageGroup_Export, "RibbonPageGroup_Export") ' + 'RepositoryItemTextEdit1 + ' + resources.ApplyResources(Me.RepositoryItemTextEdit1, "RepositoryItemTextEdit1") + Me.RepositoryItemTextEdit1.Name = "RepositoryItemTextEdit1" + ' + 'RepositoryItemTextEdit2 + ' + resources.ApplyResources(Me.RepositoryItemTextEdit2, "RepositoryItemTextEdit2") + Me.RepositoryItemTextEdit2.Name = "RepositoryItemTextEdit2" + ' 'RibbonStatusBar ' Me.RibbonStatusBar.ItemLinks.Add(Me.labelResultCount) @@ -313,8 +349,14 @@ Partial Class frmDocumentResultList resources.ApplyResources(Me.SplitContainerControl2, "SplitContainerControl2") Me.SplitContainerControl2.Horizontal = False Me.SplitContainerControl2.Name = "SplitContainerControl2" + ' + 'SplitContainerControl2.Panel1 + ' Me.SplitContainerControl2.Panel1.Controls.Add(Me.GridControl2) resources.ApplyResources(Me.SplitContainerControl2.Panel1, "SplitContainerControl2.Panel1") + ' + 'SplitContainerControl2.Panel2 + ' Me.SplitContainerControl2.Panel2.Controls.Add(Me.GridControl3) resources.ApplyResources(Me.SplitContainerControl2.Panel2, "SplitContainerControl2.Panel2") Me.SplitContainerControl2.SplitterPosition = 223 @@ -382,8 +424,14 @@ Partial Class frmDocumentResultList Me.SplitContainerControl3.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.[Default] resources.ApplyResources(Me.SplitContainerControl3, "SplitContainerControl3") Me.SplitContainerControl3.Name = "SplitContainerControl3" + ' + 'SplitContainerControl3.Panel1 + ' Me.SplitContainerControl3.Panel1.Controls.Add(Me.SplitContainerControl1) resources.ApplyResources(Me.SplitContainerControl3.Panel1, "SplitContainerControl3.Panel1") + ' + 'SplitContainerControl3.Panel2 + ' Me.SplitContainerControl3.Panel2.Controls.Add(Me.DocumentViewer1) resources.ApplyResources(Me.SplitContainerControl3.Panel2, "SplitContainerControl3.Panel2") Me.SplitContainerControl3.SplitterPosition = 762 @@ -424,6 +472,13 @@ Partial Class frmDocumentResultList Me.MenuFullAccess_EDM.Name = "MenuFullAccess_EDM" Me.MenuFullAccess_EDM.Ribbon = Me.RibbonControl ' + 'MenuFullAccess_ZOOFLOW + ' + Me.MenuFullAccess_ZOOFLOW.ItemLinks.Add(Me.MenuItemsOpenFileZooFlow) + Me.MenuFullAccess_ZOOFLOW.ItemLinks.Add(Me.MenuItemPropertiesZooFlow) + Me.MenuFullAccess_ZOOFLOW.Name = "MenuFullAccess_ZOOFLOW" + Me.MenuFullAccess_ZOOFLOW.Ribbon = Me.RibbonControl + ' 'frmDocumentResultList ' Me.AllowFormGlass = DevExpress.Utils.DefaultBoolean.[True] @@ -437,6 +492,10 @@ Partial Class frmDocumentResultList Me.Name = "frmDocumentResultList" Me.Ribbon = Me.RibbonControl Me.StatusBar = Me.RibbonStatusBar + CType(Me.SplitContainerControl1.Panel1, System.ComponentModel.ISupportInitialize).EndInit() + Me.SplitContainerControl1.Panel1.ResumeLayout(False) + CType(Me.SplitContainerControl1.Panel2, System.ComponentModel.ISupportInitialize).EndInit() + Me.SplitContainerControl1.Panel2.ResumeLayout(False) CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).EndInit() Me.SplitContainerControl1.ResumeLayout(False) CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).EndInit() @@ -444,17 +503,26 @@ Partial Class frmDocumentResultList CType(Me.RibbonControl, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.RepositoryItemTextEdit1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.RepositoryItemTextEdit2, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.SplitContainerControl2.Panel1, System.ComponentModel.ISupportInitialize).EndInit() + Me.SplitContainerControl2.Panel1.ResumeLayout(False) + CType(Me.SplitContainerControl2.Panel2, System.ComponentModel.ISupportInitialize).EndInit() + Me.SplitContainerControl2.Panel2.ResumeLayout(False) CType(Me.SplitContainerControl2, System.ComponentModel.ISupportInitialize).EndInit() Me.SplitContainerControl2.ResumeLayout(False) CType(Me.GridControl2, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.GridView2, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.GridControl3, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.GridView3, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.SplitContainerControl3.Panel1, System.ComponentModel.ISupportInitialize).EndInit() + Me.SplitContainerControl3.Panel1.ResumeLayout(False) + CType(Me.SplitContainerControl3.Panel2, System.ComponentModel.ISupportInitialize).EndInit() + Me.SplitContainerControl3.Panel2.ResumeLayout(False) CType(Me.SplitContainerControl3, System.ComponentModel.ISupportInitialize).EndInit() Me.SplitContainerControl3.ResumeLayout(False) CType(Me.MenuFullAccess_IDB, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.MenuViewAccess_IDB, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.MenuFullAccess_EDM, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MenuFullAccess_ZOOFLOW, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() @@ -484,7 +552,7 @@ Partial Class frmDocumentResultList Friend WithEvents XtraSaveFileDialog As DevExpress.XtraEditors.XtraSaveFileDialog Friend WithEvents BarButtonBack As DevExpress.XtraBars.BarButtonItem Friend WithEvents RibbonPageGroup_Navigation As DevExpress.XtraBars.Ribbon.RibbonPageGroup - Friend WithEvents BarButtonItem5 As DevExpress.XtraBars.BarButtonItem + Friend WithEvents BarButtonResetLayout As DevExpress.XtraBars.BarButtonItem Friend WithEvents RepositoryItemTextEdit1 As DevExpress.XtraEditors.Repository.RepositoryItemTextEdit Friend WithEvents RepositoryItemTextEdit2 As DevExpress.XtraEditors.Repository.RepositoryItemTextEdit Friend WithEvents labelCriticalError As DevExpress.XtraBars.BarStaticItem @@ -500,4 +568,7 @@ Partial Class frmDocumentResultList Friend WithEvents MenuViewAccess_IDB As DevExpress.XtraBars.PopupMenu Friend WithEvents MenuFullAccess_EDM As DevExpress.XtraBars.PopupMenu Friend WithEvents MenuItemPropertiesECM As DevExpress.XtraBars.BarButtonItem + Friend WithEvents MenuFullAccess_ZOOFLOW As DevExpress.XtraBars.PopupMenu + Friend WithEvents MenuItemsOpenFileZooFlow As DevExpress.XtraBars.BarButtonItem + Friend WithEvents MenuItemPropertiesZooFlow As DevExpress.XtraBars.BarButtonItem End Class diff --git a/GUIs.Common/DocumentResultList/frmDocumentResultList.resx b/GUIs.Common/DocumentResultList/frmDocumentResultList.resx index fe66188e..27b6fc8a 100644 --- a/GUIs.Common/DocumentResultList/frmDocumentResultList.resx +++ b/GUIs.Common/DocumentResultList/frmDocumentResultList.resx @@ -152,7 +152,7 @@ - AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z + AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIxLjIsIFZlcnNpb249MjEuMi40 LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAHYNAAAC77u/ PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi @@ -252,12 +252,12 @@ 9R2NAy0xdbc3UVqAub8fp91RTf0DZ0rWioS6adsAAAAASUVORK5CYII= - + Layout zurücksetzen - AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z + AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIxLjIsIFZlcnNpb249MjEuMi40 LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAALICAAAC77u/ PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi @@ -279,7 +279,7 @@ - AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z + AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIxLjIsIFZlcnNpb249MjEuMi40 LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAALMCAAAC77u/ PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi @@ -301,7 +301,7 @@ - AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z + AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIxLjIsIFZlcnNpb249MjEuMi40 LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAABkEAAAC77u/ PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi @@ -327,32 +327,12 @@ Datei öffnen - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z - LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl - dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAOMCAAAC77u/ - PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi - IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv - MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh - Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg - MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLlllbGxvd3tmaWxsOiNGRkIxMTU7fQoJ - LlJlZHtmaWxsOiNEMTFDMUM7fQoJLkJsdWV7ZmlsbDojMTE3N0Q3O30KCS5HcmVlbntmaWxsOiMwMzlD - MjM7fQoJLkJsYWNre2ZpbGw6IzcyNzI3Mjt9CgkuV2hpdGV7ZmlsbDojRkZGRkZGO30KCS5zdDB7b3Bh - Y2l0eTowLjc1O30KPC9zdHlsZT4NCiAgPGcgaWQ9IlNpbmdsZVBhZ2VWaWV3Ij4NCiAgICA8cGF0aCBk - PSJNMjcsMEgzQzIuNCwwLDIsMC40LDIsMXYyOGMwLDAuNiwwLjQsMSwxLDFoMjRjMC42LDAsMS0wLjQs - MS0xVjFDMjgsMC40LDI3LjYsMCwyNywweiBNMjYsMjhINFYyaDIyVjI4eiIgY2xhc3M9IkJsYWNrIiAv - Pg0KICAgIDxwYXRoIGQ9Ik0yMiw4SDhWNmgxNFY4eiBNMjIsMTBIOHYyaDE0VjEweiBNMjIsMTRIOHYy - aDE0VjE0eiBNMjIsMThIOHYyaDE0VjE4eiBNMjIsMjJIOHYyaDE0VjIyeiIgY2xhc3M9IkJsdWUiIC8+ - DQogIDwvZz4NCjwvc3ZnPgs= - - Eigenschaften - AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z + AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIxLjIsIFZlcnNpb249MjEuMi40 LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAACcFAAAC77u/ PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi @@ -384,7 +364,7 @@ - AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z + AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIxLjIsIFZlcnNpb249MjEuMi40 LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAAMDAAAC77u/ PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi @@ -403,7 +383,7 @@ - Dateipfad in Zwischenablage + Dateipfad kopeieren Ordnerpfad in Zwischenablage @@ -413,7 +393,7 @@ - AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z + AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIxLjIsIFZlcnNpb249MjEuMi40 LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAACcFAAAC77u/ PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi @@ -440,6 +420,12 @@ IHJ4PSIwIiByeT0iMCIgY2xhc3M9IkJsdWUiIC8+DQogICAgPC9nPg0KICA8L2c+DQo8L3N2Zz4L + + Datei öffnen + + + Eigenschaften + 0, 0 @@ -466,10 +452,10 @@ 1189, 132 - 0, 647 + 0, 649 - 1189, 24 + 1189, 22 RibbonStatusBar @@ -496,7 +482,7 @@ 2 - 382, 511 + 382, 513 0 @@ -516,6 +502,18 @@ Panel1 + + SplitContainerControl1.Panel1 + + + DevExpress.XtraEditors.SplitGroupPanel, DevExpress.Utils.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + SplitContainerControl1 + + + 0 + Fill @@ -558,6 +556,18 @@ Panel1 + + SplitContainerControl2.Panel1 + + + DevExpress.XtraEditors.SplitGroupPanel, DevExpress.Utils.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + SplitContainerControl2 + + + 0 + Fill @@ -574,7 +584,7 @@ GridBand3 - 370, 278 + 370, 280 0 @@ -594,8 +604,20 @@ Panel2 + + SplitContainerControl2.Panel2 + + + DevExpress.XtraEditors.SplitGroupPanel, DevExpress.Utils.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + SplitContainerControl2 + + + 1 + - 370, 511 + 370, 513 0 @@ -618,8 +640,20 @@ Panel2 + + SplitContainerControl1.Panel2 + + + DevExpress.XtraEditors.SplitGroupPanel, DevExpress.Utils.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + SplitContainerControl1 + + + 1 + - 762, 511 + 762, 513 2 @@ -648,6 +682,18 @@ Panel1 + + SplitContainerControl3.Panel1 + + + DevExpress.XtraEditors.SplitGroupPanel, DevExpress.Utils.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + SplitContainerControl3 + + + 0 + Fill @@ -655,7 +701,7 @@ 0, 0 - 413, 511 + 413, 513 0 @@ -675,8 +721,20 @@ Panel2 + + SplitContainerControl3.Panel2 + + + DevExpress.XtraEditors.SplitGroupPanel, DevExpress.Utils.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + SplitContainerControl3 + + + 1 + - 1189, 515 + 1189, 517 5 @@ -708,6 +766,9 @@ 522, 21 + + 692, 21 + True @@ -771,7 +832,7 @@ - AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z + AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIxLjIsIFZlcnNpb249MjEuMi40 LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAALMEAAAC77u/ PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi @@ -848,24 +909,12 @@ DevExpress.XtraBars.BarButtonItem, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - - BarButtonItem5 + + BarButtonResetLayout - + DevExpress.XtraBars.BarButtonItem, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - - RepositoryItemTextEdit1 - - - DevExpress.XtraEditors.Repository.RepositoryItemTextEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - - - RepositoryItemTextEdit2 - - - DevExpress.XtraEditors.Repository.RepositoryItemTextEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - labelCriticalError @@ -914,6 +963,18 @@ DevExpress.XtraBars.BarButtonItem, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + MenuItemsOpenFileZooFlow + + + DevExpress.XtraBars.BarButtonItem, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + MenuItemPropertiesZooFlow + + + DevExpress.XtraBars.BarButtonItem, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + RibbonPage1 @@ -938,6 +999,18 @@ DevExpress.XtraBars.Ribbon.RibbonPageGroup, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + RepositoryItemTextEdit1 + + + DevExpress.XtraEditors.Repository.RepositoryItemTextEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + RepositoryItemTextEdit2 + + + DevExpress.XtraEditors.Repository.RepositoryItemTextEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + GridView2 @@ -986,6 +1059,12 @@ DevExpress.XtraBars.PopupMenu, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + MenuFullAccess_ZOOFLOW + + + DevExpress.XtraBars.PopupMenu, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + frmDocumentResultList diff --git a/GUIs.Common/DocumentResultList/frmDocumentResultList.vb b/GUIs.Common/DocumentResultList/frmDocumentResultList.vb index f6185d2c..bc1790ba 100644 --- a/GUIs.Common/DocumentResultList/frmDocumentResultList.vb +++ b/GUIs.Common/DocumentResultList/frmDocumentResultList.vb @@ -52,19 +52,23 @@ Public Class frmDocumentResultList Private ReadOnly _Filesystem As Modules.Filesystem.File Private ReadOnly _GridBuilder As GridBuilder Private ReadOnly _File As Modules.Windows.File - Private ReadOnly _OpenDocuments As New DocumentResultCache(50000000) + Private ReadOnly _Cache As New DocumentResultCache(50000000) + ' Runtime variables Private _IsLoading As Boolean = True Private _ActiveGrid As GridControl = Nothing Private _ActiveGridBand As GridBand = Nothing + Private _documentloader As DocumentLoader ' TODO: Hashes for checking if the opened file was modified externally 'Private _HashOriginalFile As String = Nothing 'Private _HashOpenedFile As String = Nothing - Private _CurrentDocument As DocumentResultInfo = Nothing - Private _CurrentDocumentId As Long = Nothing + Private _DragBoxFromMouseDown As Rectangle + Private _ScreenOffset As Point + + Private Property _CurrentDocument As DocumentResultInfo = Nothing Private ReadOnly _Language As String Private WithEvents _FileOpenTimer As New Timer @@ -95,6 +99,7 @@ Public Class frmDocumentResultList _Params = Params _File = New Modules.Windows.File(LogConfig) _ResultLists = Params.Results + _Language = Utils.NotNull(_Environment.User.Language, State.UserState.LANG_EN_US) End Sub @@ -119,10 +124,13 @@ Public Class frmDocumentResultList ' Operation mode is either guessed from service settings ' or explictly set from OperationModeOverride in Params OperationMode = GetOperationMode() - If OperationMode = OperationMode.WithAppServer Then + If OperationMode = OperationMode.WithAppServer Or OperationMode = OperationMode.ZooFlow Then InitAppServer() End If + _documentLoader = New DocumentLoader(_LogConfig, OperationMode, _IDBClient, _Environment.User) + + If _Params.WindowTitle <> "" Then Text = $"{Text} - {_Params.WindowTitle}" End If @@ -172,6 +180,20 @@ Public Class frmDocumentResultList End Try End Sub + Private Sub frmDocumentResultList_Closing(sender As Object, e As CancelEventArgs) Handles Me.FormClosing + Try + GridViewSave_Layout(_ActiveGrid.MainView) + + _Config.Config.WindowLocation = Location + _Config.Config.WindowSize = Size + _Config.Save() + + DocumentViewer1.Done() + Catch ex As Exception + _Logger.Error(ex) + End Try + End Sub + Private Sub GridView_FocusedRowChanged(sender As GridView, e As FocusedRowChangedEventArgs) _Helpers.SetRowHandle(e) @@ -180,58 +202,27 @@ Public Class frmDocumentResultList Cursor = Cursors.WaitCursor If e.FocusedRowHandle >= 0 Then - Dim oRow = sender.GetDataRow(e.FocusedRowHandle) + 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 DocumentResultInfo = Nothing DocumentViewer1.CloseDocument() - Select Case OperationMode - Case OperationMode.NoAppServer - oDocumentInfo = LoadFile_Legacy(oRow) + oDocumentInfo = _documentloader.Load(oObjectId, oFullPath) + Dim oFileName = $"{oObjectId}.{oDocumentInfo.Extension}" - If oDocumentInfo.Contents IsNot Nothing Then - Dim oFileInfo As New FileInfo(oDocumentInfo.FullPath) - DocumentViewer1.LoadFile(oFileInfo.Name, New MemoryStream(oDocumentInfo.Contents)) - Else - DocumentViewer1.LoadFile(oDocumentInfo.FullPath) - End If + DocumentViewer1.LoadFile(oFileName, New MemoryStream(oDocumentInfo.Contents)) - Case OperationMode.WithAppServer - oDocumentInfo = LoadFile_IDB(oRow) - - If oDocumentInfo.Contents IsNot Nothing Then - Dim oFileInfo As New FileInfo(oDocumentInfo.FullPath) - DocumentViewer1.LoadFile(oFileInfo.Name, New MemoryStream(oDocumentInfo.Contents)) - Else - DocumentViewer1.LoadFile(oDocumentInfo.FullPath) - End If - - - Case OperationMode.ZooFlow - oDocumentInfo = LoadFile_ZooFlow(oRow) - - - End Select + ' Save reference to current + _CurrentDocument = oDocumentInfo + ' Check DocumentInfo If IsNothing(oDocumentInfo) Then Show_Warning("File could not be loaded!") Exit Sub End If - If Not IO.File.Exists(oDocumentInfo.FullPath) Then - Show_Warning("File does not exist!") - ' TODO: Create checksum after closing, compare and take action - '_HashOriginalFile = Nothing - Exit Sub - End If - - If oDocumentInfo.Contents IsNot Nothing Then - Dim oFileInfo As New FileInfo(oDocumentInfo.FullPath) - DocumentViewer1.LoadFile(oFileInfo.Name, New MemoryStream(oDocumentInfo.Contents)) - Else - DocumentViewer1.LoadFile(oDocumentInfo.FullPath) - End If - If oDocumentInfo.AccessRight = Rights.AccessRight.VIEW_ONLY Then DocumentViewer1.SetViewOnly(True) RibbonPageGroup_Export.Visible = False @@ -263,153 +254,63 @@ Public Class frmDocumentResultList Return True End Function - Private Function LoadFile_Legacy(GridRow As DataRow) As DocumentResultInfo - Try - Dim oFullPath = GridRow.Item(COLUMN_FILEPATH) - Dim oDocumentInfo = New DocumentResultInfo() With { - .AccessRight = Rights.AccessRight.FULL, - .FullPath = oFullPath - } + 'Private Function LoadFile_AsByteArray(DocumentInfo As DocumentResultInfo) As DocumentResultInfo + ' Try + ' _Logger.Debug("Loading File [{0}]", DocumentInfo.FullPath) + ' Dim oFullPath As String = DocumentInfo.FullPath + ' Dim oPathExists = From oFile In _Cache + ' Where oFile.FullPath = oFullPath And oFile.Contents IsNot Nothing + ' Select oFile - If IO.File.Exists(oDocumentInfo.FullPath) Then - oDocumentInfo = LoadFile_AsByteArray(oDocumentInfo) - _OpenDocuments.Add(oDocumentInfo) - _CurrentDocument = oDocumentInfo - End If + ' Dim oExistsInCache = oPathExists.Count() > 0 + ' Dim oSizeChanged = False + ' Dim oWriteTimeChanged = False - Return oDocumentInfo - Catch ex As Exception - _Logger.Error(ex) - Return Nothing - End Try - End Function + ' _Logger.Debug("File exists in Cache: [{0}]", oExistsInCache) - Private Function LoadFile_IDB(GridRow As DataRow) As DocumentResultInfo - Try - Dim oObjectId = GridRow.Item(COLUMN_DOCID) - _Logger.Debug("Loading Information for ObjectId: [{0}]", oObjectId) + ' ' Get Information about the file on the filesystem + ' Dim oFileInfo As New FileInfo(oFullPath) - ' This needs to be Sync bc otherwise the PopupMenuShowing event will fire before this method loaded the Document Info - Dim oDocumentInfo As DocumentInfo = _IDBClient.GetDocumentInfo(_Environment.User.UserId, oObjectId) - Dim oResultDocumentInfo As New DocumentResultInfo() With { - .AccessRight = oDocumentInfo.AccessRight, - .FullPath = oDocumentInfo.FullPath - } - _Logger.Debug("Successfully loaded Information for ObjectId: [{0}]", oObjectId) + ' If oExistsInCache Then + ' _Logger.Debug("Loading file from cache.") - _Logger.Debug("Loading file [{0}]", oResultDocumentInfo.FullPath) - If IO.File.Exists(oResultDocumentInfo.FullPath) Then - oResultDocumentInfo = LoadFile_AsByteArray(oResultDocumentInfo) - _OpenDocuments.Add(oResultDocumentInfo) - _CurrentDocument = oResultDocumentInfo - Else - _Logger.Warn("File [{0}] does not exist.", oResultDocumentInfo.FullPath) - End If - _Logger.Debug("Successfully loaded File [{0}]", oResultDocumentInfo.FullPath) + ' Dim oCachedItem = oPathExists.First() - Return oResultDocumentInfo + ' If oCachedItem.Contents Is Nothing Then + ' oSizeChanged = False + ' Else + ' oSizeChanged = Not (oFileInfo.Length = oCachedItem.Contents.Length) + ' End If + ' _Logger.Debug("Filesize changed: [{0}]", oSizeChanged) - Catch ex As Exception - _Logger.Error(ex) - Return Nothing + ' If oCachedItem.LastWriteTime = Nothing Then + ' oWriteTimeChanged = False + ' Else + ' oWriteTimeChanged = Not oFileInfo.LastWriteTime.Equals(oCachedItem.LastWriteTime) + ' End If + ' _Logger.Debug("Write-time changed: [{0}]", oWriteTimeChanged) - End Try - End Function + ' If oSizeChanged Or oWriteTimeChanged Then + ' _Logger.Debug("Size or Write-time changed, loading from disk.") - Private Function LoadFile_ZooFlow(GridRow As DataRow) - Try - Dim oObjectId = GridRow.Item(COLUMN_DOCID) - _Logger.Debug("Loading FileObject for ObjectId: [{0}]", oObjectId) + ' Return LoadFile_FromDisk(DocumentInfo, oFileInfo) + ' Else + ' _Logger.Debug("Loading from cache") - ' This needs to be Sync bc otherwise the PopupMenuShowing event will fire before this method loaded the FileObject - Dim oFileObject As FileObject = _IDBClient.GetFileObject(oObjectId) - Dim oResultDocumentInfo As New DocumentResultInfo() With { - .AccessRight = "", - .FullPath = "", - .Contents = oFileObject._FileContents - } - _Logger.Debug("Successfully loaded Information for ObjectId: [{0}]", oObjectId) + ' Return oCachedItem + ' End If - Catch ex As Exception - _Logger.Error(ex) - Return Nothing + ' Else + ' _Logger.Debug("File exists in cache, loading from disk.") - End Try - End Function + ' Return LoadFile_FromDisk(DocumentInfo, oFileInfo) + ' End If - Private Function LoadFile_AsByteArray(DocumentInfo As DocumentResultInfo) As DocumentResultInfo - Try - _Logger.Debug("Loading File [{0}]", DocumentInfo.FullPath) - Dim oFullPath As String = DocumentInfo.FullPath - Dim oPathExists = From oFile In _OpenDocuments - Where oFile.FullPath = oFullPath And oFile.Contents IsNot Nothing - Select oFile - - Dim oExistsInCache = oPathExists.Count() > 0 - Dim oSizeChanged = False - Dim oWriteTimeChanged = False - - _Logger.Debug("File exists in Cache: [{0}]", oExistsInCache) - - ' Get Information about the file on the filesystem - Dim oFileInfo As New FileInfo(oFullPath) - - If oExistsInCache Then - _Logger.Debug("Loading file from cache.") - - Dim oCachedItem = oPathExists.First() - - If oCachedItem.Contents Is Nothing Then - oSizeChanged = False - Else - oSizeChanged = Not (oFileInfo.Length = oCachedItem.Contents.Length) - End If - _Logger.Debug("Filesize changed: [{0}]", oSizeChanged) - - If oCachedItem.LastWriteTime = Nothing Then - oWriteTimeChanged = False - Else - oWriteTimeChanged = Not oFileInfo.LastWriteTime.Equals(oCachedItem.LastWriteTime) - End If - _Logger.Debug("Write-time changed: [{0}]", oWriteTimeChanged) - - If oSizeChanged Or oWriteTimeChanged Then - _Logger.Debug("Size or Write-time changed, loading from disk.") - - Return LoadFile_FromDisk(DocumentInfo, oFileInfo) - Else - _Logger.Debug("Loading from cache") - - Return oCachedItem - End If - - Else - _Logger.Debug("File exists in cache, loading from disk.") - - Return LoadFile_FromDisk(DocumentInfo, oFileInfo) - End If - - Catch ex As Exception - _Logger.Error(ex) - Return DocumentInfo - End Try - End Function - - Private Function LoadFile_FromDisk(pDocumentInfo As DocumentResultInfo, pFileInfo As FileInfo) As DocumentResultInfo - Using oStream = IO.File.OpenRead(pDocumentInfo.FullPath) - _Logger.Debug("File opened.") - - Using oMemoryStream = New MemoryStream() - _Logger.Debug("Copying file contents to memory stream.") - oStream.CopyTo(oMemoryStream) - pDocumentInfo.Contents = oMemoryStream.ToArray() - pDocumentInfo.LastWriteTime = pFileInfo.LastWriteTime - _Logger.Debug("Successfully copied file contents to memory stream.") - End Using - End Using - - Return pDocumentInfo - End Function + ' Catch ex As Exception + ' _Logger.Error(ex) + ' Return DocumentInfo + ' End Try + 'End Function Public Function RefreshResults(pResults As IEnumerable(Of BaseResult)) As Boolean Implements IResultForm.RefreshResults _IsLoading = True @@ -427,10 +328,6 @@ Public Class frmDocumentResultList End Try End Function - Private Sub ClearGridData() - GridControl1.DataSource = Nothing - End Sub - Private Sub LoadGridData(Result As DocumentResult) If Result.Datatable.Columns.Contains(COLUMN_DOCID) = False Then Throw New ApplicationException($"Datatable is missing DocId Column [{COLUMN_DOCID}] for search {Result.Title}!") @@ -627,30 +524,6 @@ Public Class frmDocumentResultList End Try End Sub - Private Function TryGetItem(DataRow As DataRow, ColumnName As String, Optional DefaultValue As String = "") As String - Try - Return DataRow.Item(ColumnName) - Catch ex As Exception - Return DefaultValue - End Try - End Function - - 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 - 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 - End If - End Sub - Private Sub BarButtonItemExportGrid1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItemExportGrid1.ItemClick Dim oActiveGrid = GetActiveGridControl() @@ -676,18 +549,6 @@ Public Class frmDocumentResultList End If End Sub - Private Sub SplitContainerControl1_SplitterPositionChanged(sender As Object, e As EventArgs) Handles SplitContainerControl1.SplitterPositionChanged - If _IsLoading = False Then - _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 - End If - End Sub - Private Function GetActiveRow() As DataRow Dim oActiveGrid = GetActiveGridControl() Dim oActiveRowhandle = _Helpers.ActiveRowHandle @@ -700,10 +561,7 @@ Public Class frmDocumentResultList Return Nothing End If End Function - 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) - End Function + Private Function GetActiveGridControl() As GridControl If _ActiveGrid Is Nothing Then Return Nothing @@ -711,31 +569,9 @@ Public Class frmDocumentResultList Return _ActiveGrid End Function - - Private Sub GridViewSave_Layout(pGridView As GridView) - Try - 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) - End Try - End Sub - Private Sub RestoreLayout(pGridView As GridView) - Try - Dim oLayoutFile As String = GetDevexpressGrid_LayoutName(pGridView) - If IO.File.Exists(oLayoutFile) Then - pGridView.RestoreLayoutFromXml(oLayoutFile, OptionsLayoutBase.FullLayout) - End If - Catch ex As Exception - _Logger.Error(ex) - _Logger.Info("Error while restoring layout: " & ex.Message) - End Try - End Sub - Private Sub GridControl_Enter(sender As GridControl, e As EventArgs) Handles GridControl1.Enter, GridControl2.Enter, GridControl3.Enter _ActiveGrid = sender - BarButtonItem5.Visibility = DevExpress.XtraBars.BarItemVisibility.Always + BarButtonResetLayout.Visibility = DevExpress.XtraBars.BarItemVisibility.Always BarButtonItemExportGrid1.Visibility = DevExpress.XtraBars.BarItemVisibility.Always SetActiveGridBand() End Sub @@ -757,59 +593,6 @@ Public Class frmDocumentResultList End If End Sub - Private Sub OpenFolderPath() - Try - Dim oRow = GetActiveRow() - - If oRow IsNot Nothing Then - Dim oFilename = _CurrentDocument.FullPath - Dim oDirectory = IO.Path.GetDirectoryName(oFilename) - Process.Start(oDirectory) - End If - Catch ex As Exception - _Logger.Error(ex) - End Try - End Sub - - Private Sub OpenFile() - Try - If _CurrentDocument IsNot Nothing Then - Process.Start(New ProcessStartInfo With { - .FileName = _CurrentDocument.FullPath - }) - End If - Catch ex As Exception - _Logger.Error(ex) - End Try - End Sub - - Private Sub CopyFileName() - Try - Dim oRow = GetActiveRow() - - If oRow IsNot Nothing Then - Dim oFilename = _CurrentDocument.FullPath - Clipboard.SetText(oFilename) - End If - Catch ex As Exception - _Logger.Error(ex) - End Try - End Sub - - Private Sub OpenProperties() - Try - Dim oRow = GetActiveRow() - - If oRow IsNot Nothing Then - Dim oObjectId = oRow.Item(COLUMN_DOCID) - Dim oPropertyDialog As New frmObjectPropertyDialog(_LogConfig, _Environment, _IDBClient, oObjectId) - oPropertyDialog.Show() - End If - Catch ex As Exception - _Logger.Error(ex) - End Try - End Sub - Private Sub GridView1_ColumnFilterChanged(sender As GridView, e As EventArgs) Handles GridView1.ColumnFilterChanged Dim oRowCount = sender.RowCount UpdateGridHeader(_ResultLists, 0, oRowCount) @@ -830,42 +613,30 @@ Public Class frmDocumentResultList Close() End Sub - Private Sub frmDocumentResultList_Closing(sender As Object, e As CancelEventArgs) Handles Me.FormClosing - Try - GridViewSave_Layout(_ActiveGrid.MainView) - - _Config.Config.WindowLocation = Location - _Config.Config.WindowSize = Size - _Config.Save() - - DocumentViewer1.Done() - Catch ex As Exception - _Logger.Error(ex) - End Try - End Sub - Private Sub GridControl_DoubleClick(sender As Object, e As EventArgs) Handles GridControl1.DoubleClick, GridControl2.DoubleClick, GridControl3.DoubleClick If _CurrentDocument IsNot Nothing AndAlso _CurrentDocument.AccessRight > Rights.AccessRight.VIEW_ONLY Then - OpenFile() + Process.Start(New ProcessStartInfo With { + .FileName = _CurrentDocument.FullPath + }) End If End Sub Public Sub Show_CriticalError(Message As String) - labelCriticalError.Visibility = DevExpress.XtraBars.BarItemVisibility.Always + labelCriticalError.Visibility = BarItemVisibility.Always labelCriticalError.Caption = Message End Sub Public Sub Show_Warning(Message As String) - labelWarning.Visibility = DevExpress.XtraBars.BarItemVisibility.Always + labelWarning.Visibility = BarItemVisibility.Always labelWarning.Caption = Message End Sub Public Sub Reset_Errors() - labelCriticalError.Visibility = DevExpress.XtraBars.BarItemVisibility.Never - labelWarning.Visibility = DevExpress.XtraBars.BarItemVisibility.Never + labelCriticalError.Visibility = BarItemVisibility.Never + labelWarning.Visibility = BarItemVisibility.Never End Sub - Private Sub BarButtonItem5_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem5.ItemClick + Private Sub BarButtonResetLayout_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonResetLayout.ItemClick If Not IsNothing(_ActiveGrid) Then Try Dim oFile = GetDevexpressGrid_LayoutName(_ActiveGrid.MainView) @@ -879,15 +650,171 @@ Public Class frmDocumentResultList End If End Sub - Private _DragBoxFromMouseDown As Rectangle - Private _ScreenOffset As Point + Private Function TestPathExists(pTitle As String) As Boolean + If IO.File.Exists(_CurrentDocument.FullPath) = False Then + MessageBox.Show($"Datei {_CurrentDocument.FullPath} existiert nicht oder wurde verschoben!", pTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation) + Return False + Else + Return True + End If + End Function + + Private Function TestObjectIdExists(pObjectId As Long, pTitle As String) As Boolean + If pObjectId = 0 Then + MessageBox.Show($"Objekt {pObjectId} existiert nicht oder wurde verschoben!", pTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation) + Return False + Else + Return True + End If + End Function + + + Public Sub FileOpenTimer_Elapsed() Handles _FileOpenTimer.Tick + 'Try + ' Dim oProcesses = Process.GetProcesses() + ' Dim oIds = (From oProc In oProcesses + ' Select oProc.Id). + ' ToList() + + ' Dim oNewFileOpenList As New Dictionary(Of Integer, String) + ' For Each oOpenFile In _FileOpenList + ' If oIds.Contains(oOpenFile.Key) Then + ' oNewFileOpenList.Add(oOpenFile.Key, oOpenFile.Value) + ' End If + ' Next + + ' If oNewFileOpenList.Count < _FileOpenList.Count Then + ' Dim oClosedFiles = _FileOpenList. + ' Except(oNewFileOpenList). + ' ToList() + + ' If oClosedFiles.Count = 1 Then + ' Dim oOpenFile = oClosedFiles.First() + ' DocumentViewer1.LoadFile(oOpenFile.Value) + ' Else + ' ClearGridData() + ' UpdateGridData() + ' End If + + ' _FileOpenList = oNewFileOpenList + ' End If + 'Catch ex As Exception + ' _Logger.Error(ex) + 'End Try + End Sub +#Region "Context Menu" + + Private Sub GridView_PopupMenuShowing(sender As Object, e As PopupMenuShowingEventArgs) Handles GridView2.PopupMenuShowing, GridView3.PopupMenuShowing, GridView1.PopupMenuShowing + Try + Dim oView As GridView = sender + + If e.MenuType = GridMenuType.Row Then + Dim oRowHandle = e.HitInfo.RowHandle + Dim oRow As DataRow = oView.GetDataRow(oRowHandle) + Dim oObjectId As Long = oRow.Item(COLUMN_DOCID) + Dim oPoint As Point = oView.GridControl.PointToScreen(e.HitInfo.HitPoint) + Dim oRight As Rights.AccessRight = _CurrentDocument.AccessRight + + '_CurrentDocumentId = oObjectId + _CurrentDocument.Id = oObjectId + + If OperationMode = OperationMode.WithAppServer Then + If oRight = Rights.AccessRight.FULL Or oRight = Rights.AccessRight.VIEW_EXPORT Then + MenuFullAccess_IDB.ShowPopup(oPoint) + Else + MenuViewAccess_IDB.ShowPopup(oPoint) + End If + ElseIf OperationMode = OperationMode.ZooFlow Then + MenuFullAccess_ZOOFLOW.ShowPopup(oPoint) + + Else + MenuFullAccess_EDM.ShowPopup(oPoint) + End If + Else + '_CurrentDocumentId = Nothing + _CurrentDocument.Id = Nothing + End If + Catch ex As Exception + _Logger.Error(ex) + MsgBox("Unexpected Error while preparing context menu", MsgBoxStyle.Critical, Text) + End Try + End Sub + + Private Sub MenuItemFolderpathCopyECM_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemFolderpathCopy.ItemClick + Dim oFolderPath = IO.Path.GetDirectoryName(_CurrentDocument.FullPath) + Clipboard.SetText(oFolderPath) + End Sub + + Private Sub MenuItemPropertiesECM_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemPropertiesECM.ItemClick + If TestPathExists(OPEN_PROPERTIES) = False Then + Exit Sub + End If + + _File.OpenFileProperties(_CurrentDocument.FullPath) + End Sub + + Private Sub MenuItemFilepathCopyIDB_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemFilepathCopy.ItemClick + Clipboard.SetText(_CurrentDocument.FullPath) + End Sub + + Private Sub MenuItemFolderOpen_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemFolderOpen.ItemClick + If TestPathExists(OPEN_DIRECTORY) = False Then + Exit Sub + End If + + Dim oArgs As String = $"/e, /select, ""{_CurrentDocument.FullPath}""" + Dim oInfo As New ProcessStartInfo() With { + .Arguments = oArgs, + .FileName = "explorer" + } + + Process.Start(oInfo) + End Sub + + Private Sub MenuItemPropertiesIDB_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemPropertiesIDB.ItemClick + If TestObjectIdExists(_CurrentDocument.Id, OPEN_PROPERTIES) = False Then + Exit Sub + End If + + Dim oPropertyDialog As New frmObjectPropertyDialog(_LogConfig, _Environment, _IDBClient, _CurrentDocument.Id) + oPropertyDialog.Show() + End Sub + + Private Sub MenuItemFileOpen_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemFileOpen.ItemClick + If TestPathExists(OPEN_FILE) = False Then + Exit Sub + End If + + Try + Process.Start(New ProcessStartInfo With { + .FileName = _CurrentDocument.FullPath + }) + Catch ex As Exception + _Logger.Error(ex) + End Try + End Sub + + Private Sub MenuItemPropertiesZooFlow_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemPropertiesZooFlow.ItemClick + If TestObjectIdExists(_CurrentDocument.Id, OPEN_PROPERTIES) = False Then + Exit Sub + End If + + Dim oPropertyDialog As New frmObjectPropertyDialog(_LogConfig, _Environment, _IDBClient, _CurrentDocument.Id) + oPropertyDialog.Show() + End Sub + + Private Sub MenuItemsOpenFileZooFlow_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemsOpenFileZooFlow.ItemClick + 'TODO: Save file to temp dir and then open + End Sub + +#End Region +#Region "Drag to Export" Private Sub GridView1_MouseDown(sender As GridView, e As MouseEventArgs) Handles GridView1.MouseDown If sender.FocusedRowHandle >= 0 Then Dim oDragSize As Size = SystemInformation.DragSize - _DragBoxFromMouseDown = New Rectangle(New Point(e.X - (oDragSize.Width / 2), - e.Y - (oDragSize.Height / 2)), oDragSize) + _DragBoxFromMouseDown = New Rectangle(New Point(e.X - (oDragSize.Width / 2), e.Y - (oDragSize.Height / 2)), oDragSize) Else _DragBoxFromMouseDown = Rectangle.Empty @@ -918,109 +845,67 @@ Public Class frmDocumentResultList End If End If End Sub +#End Region +#Region "Layout" + Private Sub SplitContainerControl1_SplitterPositionChanged(sender As Object, e As EventArgs) Handles SplitContainerControl1.SplitterPositionChanged + If _IsLoading = False Then + _Config.Config.SplitContainer1Distance = SplitContainerControl1.SplitterPosition + End If + End Sub - Private Sub GridView_PopupMenuShowing(sender As Object, e As PopupMenuShowingEventArgs) _ - Handles GridView2.PopupMenuShowing, GridView3.PopupMenuShowing, GridView1.PopupMenuShowing + Private Sub SplitContainerControl2_SplitterPositionChanged(sender As Object, e As EventArgs) Handles SplitContainerControl2.SplitterPositionChanged + If _IsLoading = False Then + _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 + 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 + 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) + End Function + + + Private Sub GridViewSave_Layout(pGridView As GridView) Try - Dim oView As GridView = sender - - If e.MenuType = GridMenuType.Row Then - Dim oRowHandle = e.HitInfo.RowHandle - Dim oRow As DataRow = oView.GetDataRow(oRowHandle) - Dim oObjectId As Long = oRow.Item(COLUMN_DOCID) - Dim oPoint As Point = oView.GridControl.PointToScreen(e.HitInfo.HitPoint) - Dim oRight As Rights.AccessRight = _CurrentDocument.AccessRight - - _CurrentDocumentId = oObjectId - - If OperationMode = OperationMode.WithAppServer Then - If oRight = Rights.AccessRight.FULL Or oRight = Rights.AccessRight.VIEW_EXPORT Then - MenuFullAccess_IDB.ShowPopup(oPoint) - Else - MenuViewAccess_IDB.ShowPopup(oPoint) - End If - - Else - MenuFullAccess_EDM.ShowPopup(oPoint) - End If - Else - _CurrentDocumentId = Nothing + 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) + End Try + End Sub + Private Sub RestoreLayout(pGridView As GridView) + Try + Dim oLayoutFile As String = GetDevexpressGrid_LayoutName(pGridView) + If IO.File.Exists(oLayoutFile) Then + pGridView.RestoreLayoutFromXml(oLayoutFile, OptionsLayoutBase.FullLayout) End If Catch ex As Exception _Logger.Error(ex) - MsgBox("Unexpected Error while preparing context menu", MsgBoxStyle.Critical, Text) + _Logger.Info("Error while restoring layout: " & ex.Message) End Try End Sub - Private Function TestPathExists(pTitle As String) As Boolean - If IO.File.Exists(_CurrentDocument.FullPath) = False Then - MessageBox.Show($"Datei {_CurrentDocument.FullPath} existiert nicht oder wurde verschoben!", pTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation) - Return False - Else - Return True - End If - End Function - Private Function TestObjectIdExists(pObjectId As Long, pTitle As String) As Boolean - If pObjectId = 0 Then - MessageBox.Show($"Objekt {pObjectId} existiert nicht oder wurde verschoben!", pTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation) - Return False - Else - Return True - End If - End Function - Private Sub MenuItemPropertiesIDB_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemPropertiesIDB.ItemClick - If TestObjectIdExists(_CurrentDocumentId, OPEN_PROPERTIES) = False Then - Exit Sub - End If - Dim oPropertyDialog As New frmObjectPropertyDialog(_LogConfig, _Environment, _IDBClient, _CurrentDocumentId) - oPropertyDialog.Show() - End Sub - Private Sub MenuItemPropertiesECM_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemPropertiesECM.ItemClick - If TestPathExists(OPEN_PROPERTIES) = False Then - Exit Sub - End If +#End Region - _File.OpenFileProperties(_CurrentDocument.FullPath) - End Sub - - Private Sub MenuItemFileOpen_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemFileOpen.ItemClick - If TestPathExists(OPEN_FILE) = False Then - Exit Sub - End If - - Try - Process.Start(New ProcessStartInfo With { - .FileName = _CurrentDocument.FullPath - }) - Catch ex As Exception - _Logger.Error(ex) - End Try - End Sub - - Private Sub MenuItemFolderOpen_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemFolderOpen.ItemClick - If TestPathExists(OPEN_DIRECTORY) = False Then - Exit Sub - End If - - Dim oArgs As String = $"/e, /select, ""{_CurrentDocument.FullPath}""" - Dim oInfo As New ProcessStartInfo() With { - .Arguments = oArgs, - .FileName = "explorer" - } - - Process.Start(oInfo) - End Sub - - Private Sub MenuItemFilepathCopyIDB_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemFilepathCopy.ItemClick - Clipboard.SetText(_CurrentDocument.FullPath) - End Sub - - Private Sub MenuItemFolderpathCopyECM_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemFolderpathCopy.ItemClick - Dim oFolderPath = IO.Path.GetDirectoryName(_CurrentDocument.FullPath) - Clipboard.SetText(oFolderPath) - End Sub End Class \ No newline at end of file diff --git a/GUIs.Common/My Project/Resources.Designer.vb b/GUIs.Common/My Project/Resources.Designer.vb index c8cc2801..992e0d06 100644 --- a/GUIs.Common/My Project/Resources.Designer.vb +++ b/GUIs.Common/My Project/Resources.Designer.vb @@ -90,6 +90,16 @@ Namespace My.Resources End Get End Property + ''' + ''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage. + ''' + Friend ReadOnly Property categorize() As DevExpress.Utils.Svg.SvgImage + Get + Dim obj As Object = ResourceManager.GetObject("categorize", resourceCulture) + Return CType(obj,DevExpress.Utils.Svg.SvgImage) + End Get + End Property + ''' ''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage. ''' @@ -140,6 +150,16 @@ Namespace My.Resources End Get End Property + ''' + ''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage. + ''' + Friend ReadOnly Property editcolors() As DevExpress.Utils.Svg.SvgImage + Get + Dim obj As Object = ResourceManager.GetObject("editcolors", resourceCulture) + Return CType(obj,DevExpress.Utils.Svg.SvgImage) + End Get + End Property + ''' ''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage. ''' @@ -210,6 +230,26 @@ Namespace My.Resources End Get End Property + ''' + ''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage. + ''' + Friend ReadOnly Property singlepageview() As DevExpress.Utils.Svg.SvgImage + Get + Dim obj As Object = ResourceManager.GetObject("singlepageview", resourceCulture) + Return CType(obj,DevExpress.Utils.Svg.SvgImage) + End Get + End Property + + ''' + ''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage. + ''' + Friend ReadOnly Property singlepageview1() As DevExpress.Utils.Svg.SvgImage + Get + Dim obj As Object = ResourceManager.GetObject("singlepageview1", resourceCulture) + Return CType(obj,DevExpress.Utils.Svg.SvgImage) + End Get + End Property + ''' ''' Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. ''' diff --git a/GUIs.Common/My Project/Resources.resx b/GUIs.Common/My Project/Resources.resx index 150430c1..af32bc25 100644 --- a/GUIs.Common/My Project/Resources.resx +++ b/GUIs.Common/My Project/Resources.resx @@ -148,6 +148,12 @@ ..\Resources\Copy_32x32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\categorize.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + ..\Resources\open.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + ..\Resources\txt.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -157,6 +163,9 @@ ..\Resources\jpg.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\singlepageview.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + ..\Resources\png.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -175,10 +184,13 @@ ..\Resources\_blank.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\singlepageview1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + ..\Resources\copy.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - - ..\Resources\open.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + ..\Resources\editcolors.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a \ No newline at end of file diff --git a/GUIs.Common/Resources/categorize.svg b/GUIs.Common/Resources/categorize.svg new file mode 100644 index 00000000..2e6041b1 --- /dev/null +++ b/GUIs.Common/Resources/categorize.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GUIs.Common/Resources/editcolors.svg b/GUIs.Common/Resources/editcolors.svg new file mode 100644 index 00000000..12512579 --- /dev/null +++ b/GUIs.Common/Resources/editcolors.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GUIs.Common/Resources/singlepageview.svg b/GUIs.Common/Resources/singlepageview.svg new file mode 100644 index 00000000..9664a189 --- /dev/null +++ b/GUIs.Common/Resources/singlepageview.svg @@ -0,0 +1,16 @@ + + + + + + + + \ No newline at end of file diff --git a/GUIs.Common/Resources/singlepageview1.svg b/GUIs.Common/Resources/singlepageview1.svg new file mode 100644 index 00000000..9664a189 --- /dev/null +++ b/GUIs.Common/Resources/singlepageview1.svg @@ -0,0 +1,16 @@ + + + + + + + + \ No newline at end of file