Compare commits
4 Commits
533df59b1f
...
607f7e6445
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
607f7e6445 | ||
|
|
5e44adccd7 | ||
|
|
be617951b3 | ||
|
|
c6e67a967c |
@@ -144,6 +144,8 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EDMIService.Tests", "EDMISe
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Base", "Modules.Base\Base\Base.vbproj", "{6EA0C51F-C2B1-4462-8198-3DE0B32B74F8}"
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "MessageBoxEx", "MessageBoxEx\MessageBoxEx.vbproj", "{EF29F400-BE45-4283-9D18-CA7ACD9ACCC9}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -386,6 +388,10 @@ Global
|
||||
{6EA0C51F-C2B1-4462-8198-3DE0B32B74F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6EA0C51F-C2B1-4462-8198-3DE0B32B74F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6EA0C51F-C2B1-4462-8198-3DE0B32B74F8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{EF29F400-BE45-4283-9D18-CA7ACD9ACCC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EF29F400-BE45-4283-9D18-CA7ACD9ACCC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EF29F400-BE45-4283-9D18-CA7ACD9ACCC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EF29F400-BE45-4283-9D18-CA7ACD9ACCC9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -450,6 +456,7 @@ Global
|
||||
{C9827B8D-9EF9-411A-A6BF-4807794F8C8F} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC}
|
||||
{E3DA65CA-964D-4896-991A-B5426884E215} = {7AF3F9C2-C939-4A08-95C1-0453207E298A}
|
||||
{6EA0C51F-C2B1-4462-8198-3DE0B32B74F8} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC}
|
||||
{EF29F400-BE45-4283-9D18-CA7ACD9ACCC9} = {F98C0329-C004-417F-B2AB-7466E88D8220}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {C1BE4090-A0FD-48AF-86CB-39099D14B286}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
DevExpress.XtraEditors.TileControl, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
|
||||
@@ -9,9 +9,10 @@ Public Class ProfileSearches
|
||||
Private _LogConfig As LogConfig
|
||||
Private _Logger As Logger
|
||||
Private _Environment As Environment
|
||||
Private _Params As ClipboardWatcherParams
|
||||
Private _Client As Client
|
||||
|
||||
Private _ClipboardContents As String
|
||||
|
||||
Public Class Search
|
||||
Public Guid As Integer
|
||||
Public DataTable As DataTable
|
||||
@@ -21,11 +22,11 @@ Public Class ProfileSearches
|
||||
Public SQLCommand As String
|
||||
End Class
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, Environment As Environment, Params As ClipboardWatcherParams)
|
||||
Public Sub New(LogConfig As LogConfig, Environment As Environment, pClipboardContents As String)
|
||||
_LogConfig = LogConfig
|
||||
_Logger = LogConfig.GetLogger()
|
||||
_Environment = Environment
|
||||
_Params = Params
|
||||
_ClipboardContents = pClipboardContents
|
||||
Try
|
||||
If _Environment.Service.IsActive = True Then
|
||||
Try
|
||||
@@ -84,7 +85,7 @@ Public Class ProfileSearches
|
||||
oSQL = oRow.Item("SQL_COMMAND")
|
||||
oSQL = oPatterns.ReplaceUserValues(oSQL, _Environment.User)
|
||||
oSQL = oPatterns.ReplaceInternalValues(oSQL)
|
||||
oSQL = oPatterns.ReplaceClipboardContents(oSQL, _Params.ClipboardContents)
|
||||
oSQL = oPatterns.ReplaceClipboardContents(oSQL, _ClipboardContents)
|
||||
|
||||
Dim oConnectionString = ProfileUtils.GetConnectionString(_Environment.Database, oConnectionId)
|
||||
|
||||
@@ -150,7 +151,7 @@ Public Class ProfileSearches
|
||||
oSQL = oRow.Item("SQL_COMMAND")
|
||||
oSQL = oPatterns.ReplaceUserValues(oSQL, _Environment.User)
|
||||
oSQL = oPatterns.ReplaceInternalValues(oSQL)
|
||||
oSQL = oPatterns.ReplaceClipboardContents(oSQL, _Params.ClipboardContents)
|
||||
oSQL = oPatterns.ReplaceClipboardContents(oSQL, _ClipboardContents)
|
||||
|
||||
Dim oConnectionString = ProfileUtils.GetConnectionString(_Environment.Database, oConnectionId)
|
||||
|
||||
|
||||
@@ -41,8 +41,11 @@ Public Class frmMatch
|
||||
Private ShouldHideInitially As Boolean = False
|
||||
|
||||
Private Const NO_COUNT_SQL As Integer = 99998
|
||||
|
||||
Private Const INVALID_COUNT_SQL As Integer = 99999
|
||||
|
||||
'Public Event ResultsRefreshed As EventHandler
|
||||
|
||||
Private Enum ProfileType
|
||||
ANY = 0
|
||||
DOCS_ONLY = 1
|
||||
@@ -133,7 +136,7 @@ Public Class frmMatch
|
||||
|
||||
If oCreatedTiles = 1 Then
|
||||
Dim oProfile As ProfileData = _Params.MatchingProfiles.First()
|
||||
Dim oProfileSearch As New ProfileSearches(_LogConfig, _Environment, _Params)
|
||||
Dim oProfileSearch As New ProfileSearches(_LogConfig, _Environment, _Params.ClipboardContents)
|
||||
|
||||
If oProfile.CountDocs > 0 And oProfile.CountData = 0 Then
|
||||
_Logger.Debug($"ONLY Docs")
|
||||
@@ -308,7 +311,7 @@ Public Class frmMatch
|
||||
Dim oItem As TileItem = e.Item
|
||||
Dim oProfileId As Integer = oItem.Tag
|
||||
|
||||
Dim oProfileSearch As New ProfileSearches(_LogConfig, _Environment, _Params)
|
||||
Dim oProfileSearch As New ProfileSearches(_LogConfig, _Environment, _Params.ClipboardContents)
|
||||
Dim oProfile As ProfileData = _Params.MatchingProfiles.
|
||||
Where(Function(p) p.Guid = oProfileId).
|
||||
ToList().
|
||||
@@ -345,7 +348,8 @@ Public Class frmMatch
|
||||
Dim oParams = New DocumentResultList.Params() With {
|
||||
.WindowGuid = oWindowGuid,
|
||||
.WindowTitle = GetResultWindowString(_Params.ClipboardContents),
|
||||
.OperationModeOverride = _Params.OperationModeOverride
|
||||
.OperationModeOverride = _Params.OperationModeOverride,
|
||||
.ProfileGuid = Profile.Guid
|
||||
}
|
||||
|
||||
For Each oSearch In Searches
|
||||
@@ -357,8 +361,11 @@ Public Class frmMatch
|
||||
|
||||
Dim oForm As New frmDocumentResultList(_LogConfig, _Environment, oParams)
|
||||
AddHandler oForm.FormClosed, AddressOf ProfileResultForm_Closed
|
||||
AddHandler oForm.NeedsRefresh, AddressOf ProfileResultForm_NeedsRefresh
|
||||
|
||||
OpenForms.Add(oForm)
|
||||
oForm.Show()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub OpenDataResults(Profile As ProfileData, Searches As List(Of ProfileSearches.Search))
|
||||
@@ -406,4 +413,23 @@ Public Class frmMatch
|
||||
Show()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Async Sub ProfileResultForm_NeedsRefresh(sender As Object, e As Integer)
|
||||
Dim oThisForm As IResultForm = sender
|
||||
Dim oProfileSearch As New ProfileSearches(_LogConfig, _Environment, _Params.ClipboardContents)
|
||||
|
||||
If TypeOf sender Is frmDocumentResultList Then
|
||||
Dim oProfileId = e
|
||||
Dim oSearches = Await oProfileSearch.LoadDocumentSearchesAsync(oProfileId)
|
||||
Dim oResults = oSearches.Select(Function(search)
|
||||
Return New DocumentResultList.DocumentResult() With {
|
||||
.Title = search.TabCaption,
|
||||
.Datatable = search.DataTable
|
||||
}
|
||||
End Function).ToList()
|
||||
|
||||
'RaiseEvent ResultsRefreshed(Me, Nothing)
|
||||
oThisForm.RefreshResults(oResults)
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -190,6 +190,10 @@
|
||||
<Project>{3DCD6D1A-C830-4241-B7E4-27430E7EA483}</Project>
|
||||
<Name>LookupControl</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\MessageBoxEx\MessageBoxEx.vbproj">
|
||||
<Project>{ef29f400-be45-4283-9d18-ca7acd9accc9}</Project>
|
||||
<Name>MessageBoxEx</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Modules.Base\Base\Base.vbproj">
|
||||
<Project>{6ea0c51f-c2b1-4462-8198-3de0b32b74f8}</Project>
|
||||
<Name>Base</Name>
|
||||
@@ -303,5 +307,14 @@
|
||||
<ItemGroup>
|
||||
<None Include="Resources\editcolors.svg" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\actions_question.svg" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Service Include="{94E38DFF-614B-4CBD-B67C-F211BB35CE8B}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\refreshallpivottable.svg" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
</Project>
|
||||
@@ -33,6 +33,8 @@ Public Class frmDataResultList
|
||||
|
||||
Private Property OperationMode As OperationMode Implements IResultForm.OperationMode
|
||||
|
||||
Public Event NeedsRefresh As EventHandler(Of Integer) Implements IResultForm.NeedsRefresh
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, Environment As Environment, Params As DataResultParams)
|
||||
' Dieser Aufruf ist für den Designer erforderlich.
|
||||
InitializeComponent()
|
||||
|
||||
@@ -10,6 +10,7 @@ Namespace DocumentResultList
|
||||
Public Results As New List(Of DocumentResult)
|
||||
Public ColumnNames As New ColumnNames
|
||||
Public OperationModeOverride As OperationMode = OperationMode.None
|
||||
Public ProfileGuid As Integer
|
||||
End Class
|
||||
|
||||
Public Class DocumentResult
|
||||
|
||||
@@ -35,6 +35,7 @@ Namespace DocumentResultList
|
||||
Public ProcessId As Integer
|
||||
Public FilePath As String
|
||||
Public CurrentlyProcessing As Boolean = False
|
||||
Public Exited As Boolean = False
|
||||
End Class
|
||||
|
||||
Public Class FileChangedArgs
|
||||
@@ -51,11 +52,11 @@ Namespace DocumentResultList
|
||||
End Sub
|
||||
|
||||
Public Async Function OpenDocument(pDocument As Document) As Task(Of Boolean)
|
||||
Dim oResult As Tuple(Of Process, String) = Nothing
|
||||
Dim oResult As Tuple(Of Integer, String) = Nothing
|
||||
|
||||
If pDocument.FullPath IsNot Nothing AndAlso pDocument.FullPath.Trim <> String.Empty Then
|
||||
' TODO: DONT put into openfiles
|
||||
oResult = OpenFileFromPath(pDocument)
|
||||
oResult = Await OpenFileFromPath(pDocument)
|
||||
|
||||
ElseIf pDocument.Extension IsNot Nothing AndAlso pDocument.Contents IsNot Nothing Then
|
||||
oResult = Await OpenFileFromByteArray(pDocument)
|
||||
@@ -67,15 +68,15 @@ Namespace DocumentResultList
|
||||
Return False
|
||||
End If
|
||||
|
||||
Dim oProcess = oResult.Item1
|
||||
Dim oProcessId = oResult.Item1
|
||||
Dim oFilePath = oResult.Item2
|
||||
|
||||
Logger.Debug("File [{0}] opened with ProcessId [{1}]", oFilePath, oProcess.Id)
|
||||
Logger.Debug("File [{0}] opened with ProcessId [{1}]", oFilePath, oProcessId)
|
||||
|
||||
Dim oOpenFile = New OpenFile With {
|
||||
.Document = pDocument,
|
||||
.FilePath = oFilePath,
|
||||
.ProcessId = oProcess.Id
|
||||
.ProcessId = oProcessId
|
||||
}
|
||||
OpenFiles.Add(oOpenFile)
|
||||
|
||||
@@ -97,7 +98,7 @@ Namespace DocumentResultList
|
||||
ProcessedFiles.Remove(pOpenFile)
|
||||
End Sub
|
||||
|
||||
Private Async Function OpenFileFromByteArray(pDocument As Document) As Task(Of Tuple(Of Process, String))
|
||||
Private Async Function OpenFileFromByteArray(pDocument As Document) As Task(Of Tuple(Of Integer, String))
|
||||
Try
|
||||
Dim oTempPath = Path.Combine(Path.GetTempPath(), Constants.TEMP_PATH_SUBFOLDER)
|
||||
Dim oDirectory = Directory.CreateDirectory(oTempPath)
|
||||
@@ -110,8 +111,9 @@ Namespace DocumentResultList
|
||||
End Using
|
||||
End Using
|
||||
|
||||
Dim oProcess = DoOpenFile(oFilePath)
|
||||
Return New Tuple(Of Process, String)(oProcess, oFilePath)
|
||||
Dim oProcessId = Await DoOpenFile(oFilePath)
|
||||
|
||||
Return New Tuple(Of Integer, String)(oProcessId, oFilePath)
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
@@ -120,10 +122,10 @@ Namespace DocumentResultList
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function OpenFileFromPath(pDocument As Document) As Tuple(Of Process, String)
|
||||
Private Async Function OpenFileFromPath(pDocument As Document) As Task(Of Tuple(Of Integer, String))
|
||||
Try
|
||||
Dim oProcess = DoOpenFile(pDocument.FullPath)
|
||||
Return New Tuple(Of Process, String)(oProcess, pDocument.FullPath)
|
||||
Dim oProcessId = Await DoOpenFile(pDocument.FullPath)
|
||||
Return New Tuple(Of Integer, String)(oProcessId, pDocument.FullPath)
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
@@ -131,12 +133,28 @@ Namespace DocumentResultList
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function DoOpenFile(pFilePath As String) As Process
|
||||
Dim oProcess = Process.Start(New ProcessStartInfo With {
|
||||
.FileName = pFilePath
|
||||
})
|
||||
Private Async Function DoOpenFile(pFilePath As String) As Task(Of Integer)
|
||||
Dim _Process = New Process
|
||||
_Process.StartInfo.FileName = pFilePath
|
||||
_Process.EnableRaisingEvents = True
|
||||
|
||||
Return oProcess
|
||||
AddHandler _Process.Exited, AddressOf Process_Exited
|
||||
|
||||
_Process.Start()
|
||||
|
||||
Return _Process.Id
|
||||
End Function
|
||||
|
||||
Private Function Process_Exited(sender As Object, e As EventArgs) As Boolean
|
||||
Debug.WriteLine("Process is exited")
|
||||
|
||||
Dim oProcess As Process = sender
|
||||
Dim oOpenFile = OpenFiles.
|
||||
Where(Function(file) file.ProcessId = oProcess.Id).
|
||||
SingleOrDefault()
|
||||
oOpenFile.Exited = True
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub FileOpenTimer_Elapsed() Handles FileOpenTimer.Elapsed
|
||||
@@ -154,9 +172,11 @@ Namespace DocumentResultList
|
||||
|
||||
' Check if the file is currently in use, and skip if it is.
|
||||
Dim oIsLocked = FileEx.TestFileIsLocked(oOpenFile.FilePath)
|
||||
Dim oIsExited = oOpenFile.Exited
|
||||
Debug.WriteLine($"File is locked: [{oIsLocked}]")
|
||||
Debug.WriteLine($"File is exited: [{oIsExited}]")
|
||||
|
||||
If oIsLocked Then
|
||||
If oIsLocked Or oIsExited = False Then
|
||||
Continue For
|
||||
End If
|
||||
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
|
||||
Public Interface IResultForm
|
||||
Property OperationMode As OperationMode
|
||||
|
||||
Property ShouldReturnToPreviousForm As Boolean
|
||||
|
||||
|
||||
Event NeedsRefresh As EventHandler(Of Integer)
|
||||
|
||||
Function RefreshResults(pResults As IEnumerable(Of BaseResult)) As Boolean
|
||||
End Interface
|
||||
|
||||
20
GUIs.Common/My Project/Resources.Designer.vb
generated
20
GUIs.Common/My Project/Resources.Designer.vb
generated
@@ -80,6 +80,16 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property actions_question() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("actions_question", resourceCulture)
|
||||
Return CType(obj,DevExpress.Utils.Svg.SvgImage)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
'''</summary>
|
||||
@@ -230,6 +240,16 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property refreshallpivottable() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("refreshallpivottable", resourceCulture)
|
||||
Return CType(obj,DevExpress.Utils.Svg.SvgImage)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
||||
'''</summary>
|
||||
|
||||
@@ -127,6 +127,9 @@
|
||||
<data name="tiff" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\tiff.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="_blank" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\_blank.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="ZooFlow-Vergroessern" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\ZooFlow-Vergroessern.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
@@ -172,6 +175,9 @@
|
||||
<data name="zoom_more" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\zoom_more.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="actions_question" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\actions_question.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
<data name="grid" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\grid.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
@@ -181,8 +187,8 @@
|
||||
<data name="dxf" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\dxf.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="_blank" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\_blank.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="editcolors" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\editcolors.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
<data name="singlepageview1" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\singlepageview1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
@@ -190,7 +196,7 @@
|
||||
<data name="copy" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\copy.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
<data name="editcolors" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\editcolors.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
<data name="refreshallpivottable" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\refreshallpivottable.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,3 +1,4 @@
|
||||
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraEditors.Repository.RepositoryItemTextEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
|
||||
15
GUIs.Common/Resources/actions_question.svg
Normal file
15
GUIs.Common/Resources/actions_question.svg
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<svg x="0px" y="0px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" id="Layer_1" style="enable-background:new 0 0 32 32">
|
||||
<style type="text/css">
|
||||
.Blue{fill:#1177D7;}
|
||||
.Yellow{fill:#FFB115;}
|
||||
.Black{fill:#727272;}
|
||||
.Green{fill:#039C23;}
|
||||
.Red{fill:#D11C1C;}
|
||||
.st0{opacity:0.75;}
|
||||
.st1{opacity:0.5;}
|
||||
</style>
|
||||
<g id="Question">
|
||||
<path d="M16,2C8.3,2,2,8.3,2,16s6.3,14,14,14s14-6.3,14-14S23.7,2,16,2z M16,24c-1.1,0-2-0.9-2-2c0-1.1,0.9-2,2-2 s2,0.9,2,2C18,23.1,17.1,24,16,24z M20.7,13.3c-0.2,0.4-0.4,0.7-0.6,1c-0.3,0.3-0.5,0.5-0.8,0.7c-0.3,0.2-0.6,0.4-0.9,0.6 c-0.3,0.2-0.5,0.4-0.7,0.7c-0.2,0.3-0.3,0.6-0.4,1V18h-2.7v-0.9c0-0.6,0.2-1,0.3-1.4c0.2-0.4,0.4-0.7,0.6-1 c0.2-0.3,0.5-0.5,0.8-0.7c0.3-0.2,0.5-0.4,0.8-0.6c0.2-0.2,0.4-0.4,0.6-0.6c0.1-0.2,0.2-0.5,0.2-0.9c0-0.6-0.2-1-0.5-1.3 c-0.3-0.3-0.7-0.4-1.3-0.4c-0.4,0-0.7,0.1-0.9,0.2c-0.3,0.1-0.5,0.3-0.7,0.5c-0.2,0.2-0.3,0.5-0.4,0.8C14,12.1,14,12.7,14,13h-3 c0-0.7,0.1-1.6,0.4-2.1c0.2-0.6,0.6-1.1,1-1.5c0.4-0.4,0.9-0.8,1.5-1c0.6-0.2,1.3-0.4,2-0.4c1,0,1.8,0.1,2.4,0.4 c0.6,0.3,1.2,0.6,1.6,0.9c0.4,0.4,0.7,0.8,0.8,1.2s0.3,0.8,0.3,1.2C21,12.4,20.9,12.9,20.7,13.3z" class="Green" />
|
||||
</g>
|
||||
</svg>
|
||||
7
GUIs.Common/Resources/refreshallpivottable.svg
Normal file
7
GUIs.Common/Resources/refreshallpivottable.svg
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<svg x="0px" y="0px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" id="Refresh_All_Pivot_Table" style="enable-background:new 0 0 32 32">
|
||||
<style type="text/css">
|
||||
.Green{fill:#039C23;}
|
||||
</style>
|
||||
<path d="M30,2v12h-0.2h-4H18l5-5c-1.8-1.8-4.3-3-7-3c-4.8,0-8.9,3.4-9.8,8h-4C3.1,7.2,8.9,2,16,2 c3.9,0,7.4,1.6,9.9,4.1L30,2z M16,26c-2.8,0-5.2-1.1-7-3l5-5H6.2h-4H2v12l4.1-4.1c2.5,2.5,6,4.1,9.9,4.1c7.1,0,12.9-5.2,13.8-12h-4 C24.9,22.6,20.8,26,16,26z" class="Green" />
|
||||
</svg>
|
||||
14
GUIs.Common/frmDocumentResultList.Designer.vb
generated
14
GUIs.Common/frmDocumentResultList.Designer.vb
generated
@@ -43,6 +43,7 @@ Partial Class frmDocumentResultList
|
||||
Me.MenuItemPropertiesECM = New DevExpress.XtraBars.BarButtonItem()
|
||||
Me.MenuItemsOpenFileZooFlow = New DevExpress.XtraBars.BarButtonItem()
|
||||
Me.MenuItemPropertiesZooFlow = New DevExpress.XtraBars.BarButtonItem()
|
||||
Me.ButtonRefresh = 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()
|
||||
@@ -150,9 +151,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.BarButtonResetLayout, Me.labelCriticalError, Me.labelWarning, Me.MenuItemFileOpen, Me.MenuItemPropertiesIDB, Me.MenuItemFolderOpen, Me.MenuItemFilepathCopy, Me.MenuItemFolderpathCopy, Me.MenuItemPropertiesECM, Me.MenuItemsOpenFileZooFlow, Me.MenuItemPropertiesZooFlow})
|
||||
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, Me.ButtonRefresh})
|
||||
resources.ApplyResources(Me.RibbonControl, "RibbonControl")
|
||||
Me.RibbonControl.MaxItemId = 29
|
||||
Me.RibbonControl.MaxItemId = 30
|
||||
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})
|
||||
@@ -295,6 +296,13 @@ Partial Class frmDocumentResultList
|
||||
Me.MenuItemPropertiesZooFlow.ImageOptions.SvgImage = Global.DigitalData.GUIs.Common.My.Resources.Resources.editcolors
|
||||
Me.MenuItemPropertiesZooFlow.Name = "MenuItemPropertiesZooFlow"
|
||||
'
|
||||
'BarButtonItem1
|
||||
'
|
||||
resources.ApplyResources(Me.ButtonRefresh, "BarButtonItem1")
|
||||
Me.ButtonRefresh.Id = 29
|
||||
Me.ButtonRefresh.ImageOptions.SvgImage = Global.DigitalData.GUIs.Common.My.Resources.Resources.refreshallpivottable
|
||||
Me.ButtonRefresh.Name = "BarButtonItem1"
|
||||
'
|
||||
'RibbonPage1
|
||||
'
|
||||
Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup_Navigation, Me.RibbonPageGroup_Layout, Me.RibbonPageGroup_Export})
|
||||
@@ -305,6 +313,7 @@ Partial Class frmDocumentResultList
|
||||
'
|
||||
Me.RibbonPageGroup_Navigation.AllowTextClipping = False
|
||||
Me.RibbonPageGroup_Navigation.ItemLinks.Add(Me.BarButtonBack)
|
||||
Me.RibbonPageGroup_Navigation.ItemLinks.Add(Me.ButtonRefresh)
|
||||
Me.RibbonPageGroup_Navigation.Name = "RibbonPageGroup_Navigation"
|
||||
resources.ApplyResources(Me.RibbonPageGroup_Navigation, "RibbonPageGroup_Navigation")
|
||||
'
|
||||
@@ -571,4 +580,5 @@ Partial Class frmDocumentResultList
|
||||
Friend WithEvents MenuFullAccess_ZOOFLOW As DevExpress.XtraBars.PopupMenu
|
||||
Friend WithEvents MenuItemsOpenFileZooFlow As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents MenuItemPropertiesZooFlow As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents ButtonRefresh As DevExpress.XtraBars.BarButtonItem
|
||||
End Class
|
||||
|
||||
@@ -426,6 +426,9 @@
|
||||
<data name="MenuItemPropertiesZooFlow.Caption" xml:space="preserve">
|
||||
<value>Eigenschaften</value>
|
||||
</data>
|
||||
<data name="BarButtonItem1.Caption" xml:space="preserve">
|
||||
<value>Ergebnisse aktualisieren</value>
|
||||
</data>
|
||||
<data name="RibbonControl.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
@@ -975,6 +978,12 @@
|
||||
<data name=">>MenuItemPropertiesZooFlow.Type" xml:space="preserve">
|
||||
<value>DevExpress.XtraBars.BarButtonItem, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
<data name=">>BarButtonItem1.Name" xml:space="preserve">
|
||||
<value>BarButtonItem1</value>
|
||||
</data>
|
||||
<data name=">>BarButtonItem1.Type" xml:space="preserve">
|
||||
<value>DevExpress.XtraBars.BarButtonItem, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
<data name=">>RibbonPage1.Name" xml:space="preserve">
|
||||
<value>RibbonPage1</value>
|
||||
</data>
|
||||
|
||||
@@ -20,6 +20,7 @@ Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.ZooFlow
|
||||
Imports DigitalData.Modules.ZooFlow.Constants
|
||||
Imports DigitalData.Modules.Base.IDB.FileStore
|
||||
Imports DigitalData.Controls.MessageBoxEx
|
||||
|
||||
Public Class frmDocumentResultList
|
||||
Implements IResultForm
|
||||
@@ -46,7 +47,6 @@ Public Class frmDocumentResultList
|
||||
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
|
||||
@@ -59,6 +59,8 @@ Public Class frmDocumentResultList
|
||||
Private Documentloader As DocumentResultList.Loader
|
||||
|
||||
' Runtime variables
|
||||
Private Property _ResultLists As List(Of DocumentResultList.DocumentResult)
|
||||
|
||||
Private _IsLoading As Boolean = True
|
||||
Private _ActiveGrid As GridControl = Nothing
|
||||
Private _ActiveGridBand As GridBand = Nothing
|
||||
@@ -72,6 +74,11 @@ Public Class frmDocumentResultList
|
||||
|
||||
Public Property ShouldReturnToPreviousForm As Boolean = False Implements IResultForm.ShouldReturnToPreviousForm
|
||||
|
||||
Public Event NeedsRefresh As EventHandler(Of Integer) Implements IResultForm.NeedsRefresh
|
||||
Public Event ResultsRefreshed As EventHandler(Of List(Of DocumentResultList.DocumentResult))
|
||||
|
||||
Public Delegate Sub SetDatasourceCallback(pDatatable As DataTable)
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pEnvironment As Environment, pParams As DocumentResultList.Params)
|
||||
' Dieser Aufruf ist für den Designer erforderlich.
|
||||
InitializeComponent()
|
||||
@@ -96,7 +103,7 @@ Public Class frmDocumentResultList
|
||||
|
||||
Environment = pEnvironment
|
||||
Params = pParams
|
||||
ResultLists = pParams.Results
|
||||
_ResultLists = pParams.Results
|
||||
|
||||
_Language = Utils.NotNull(Me.Environment.User.Language, State.UserState.LANG_EN_US)
|
||||
End Sub
|
||||
@@ -127,6 +134,8 @@ Public Class frmDocumentResultList
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Documentloader = New DocumentResultList.Loader(LogConfig, OperationMode, _IDBClient, Environment.User)
|
||||
|
||||
If Params.WindowTitle <> "" Then
|
||||
@@ -316,26 +325,29 @@ Public Class frmDocumentResultList
|
||||
MsgBox($"Beim Speichern der Datei '{oFileInfo.Name}' Fehler ist ein Fehler aufgetreten!", MsgBoxStyle.Critical, Text)
|
||||
Else
|
||||
MsgBox($"Die Datei '{oFileInfo.Name}' wurde erfolgreich gespeichert!", MsgBoxStyle.Information, Text)
|
||||
RaiseEvent NeedsRefresh(Me, Params.ProfileGuid)
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Async Function Watcher_Ask(pFile As DocumentResultList.Watcher.OpenFile) As Task
|
||||
Dim oFileInfo = New FileInfo(pFile.FilePath)
|
||||
Dim oMessage = $"Die Datei '{oFileInfo.Name}' wurde außerhalb des Systems verändert. Wollen Sie diese Änderung als neue Version in das System übernehmen? 'Nein' überschreibt die ursprüngliche Datei."
|
||||
Dim oResult As DialogResult = MsgBox(oMessage, MsgBoxStyle.YesNoCancel Or MsgBoxStyle.Question, "Datei verändert")
|
||||
Dim oMessage = $"Die Datei '{oFileInfo.Name}' wurde außerhalb des Systems verändert. Wollen Sie diese Änderung als neue Version in das System übernehmen oder überschreiben?"
|
||||
|
||||
Select Case oResult
|
||||
Case DialogResult.Yes
|
||||
Await Watcher_VersionFile(pFile)
|
||||
Dim oMessageBox As New MsgBoxEx(oMessage, "Datei verändert", MessageBoxIcon.Question)
|
||||
oMessageBox.SetButtons("Überschreiben", "Neue Version", "Abbrechen")
|
||||
oMessageBox.ShowDialog()
|
||||
|
||||
Case DialogResult.No
|
||||
Select Case oMessageBox.Result
|
||||
Case MsgBoxEx.DialogBoxResult.Button1
|
||||
Await Watcher_OverwriteFile(pFile)
|
||||
|
||||
Case MsgBoxEx.DialogBoxResult.Button2
|
||||
Await Watcher_VersionFile(pFile)
|
||||
|
||||
Case Else
|
||||
' Cancel, do nothing
|
||||
|
||||
End Select
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
@@ -366,7 +378,8 @@ Public Class frmDocumentResultList
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
MessageBox.Show("Error while loading results:" & vbNewLine & vbNewLine & ex.Message, Text)
|
||||
|
||||
MessageBox.Show("Error while loading results:" & vbNewLine & vbNewLine & ex.Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||||
Return False
|
||||
Finally
|
||||
_IsLoading = False
|
||||
@@ -382,37 +395,49 @@ Public Class frmDocumentResultList
|
||||
Throw New ApplicationException($"Datatable is missing Filepath Column [{COLUMN_FILEPATH}] for search {Result.Title}!")
|
||||
End If
|
||||
|
||||
GridControl1.DataSource = Result.Datatable
|
||||
GridControl1.ForceInitialize()
|
||||
' This is needed to update the grid from another form like frmMatch
|
||||
' Another form means another thread, so we need a delegate here
|
||||
If GridControl1.InvokeRequired Then
|
||||
Dim oCallback As New SetDatasourceCallback(AddressOf SetGridDataSource)
|
||||
Invoke(oCallback, Result.Datatable)
|
||||
|
||||
Else
|
||||
SetGridDataSource(Result.Datatable)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub SetGridDataSource(pTable As DataTable)
|
||||
GridControl1.DataSource = Nothing
|
||||
GridControl1.DataSource = pTable
|
||||
End Sub
|
||||
|
||||
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)
|
||||
@@ -421,7 +446,7 @@ Public Class frmDocumentResultList
|
||||
Next
|
||||
|
||||
' Hide Grids depending on Result count
|
||||
Select Case ResultLists.Count
|
||||
Select Case _ResultLists.Count
|
||||
Case 0
|
||||
|
||||
SplitContainerControl1.SetPanelCollapsed(True)
|
||||
@@ -453,7 +478,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
|
||||
|
||||
@@ -640,17 +665,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
|
||||
@@ -825,8 +850,8 @@ Public Class frmDocumentResultList
|
||||
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
|
||||
Private Async Sub MenuItemsOpenFileZooFlow_ItemClick(sender As Object, e As ItemClickEventArgs) Handles MenuItemsOpenFileZooFlow.ItemClick
|
||||
Await Watcher.OpenDocument(_CurrentDocument)
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
@@ -924,14 +949,10 @@ Public Class frmDocumentResultList
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub RibbonControl_Click(sender As Object, e As EventArgs) Handles RibbonControl.Click
|
||||
|
||||
Private Sub ButtonRefresh_ItemClick(sender As Object, e As ItemClickEventArgs) Handles ButtonRefresh.ItemClick
|
||||
RaiseEvent NeedsRefresh(Me, Params.ProfileGuid)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
@@ -192,6 +192,12 @@
|
||||
<Compile Include="frmMail.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmMsgBox.Designer.vb">
|
||||
<DependentUpon>frmMsgBox.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmMsgBox.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmOld.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -256,6 +262,9 @@
|
||||
<EmbeddedResource Include="frmMail.resx">
|
||||
<DependentUpon>frmMail.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmMsgBox.resx">
|
||||
<DependentUpon>frmMsgBox.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmOld.resx">
|
||||
<DependentUpon>frmOld.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@@ -307,6 +316,10 @@
|
||||
<Project>{D20A6BF2-C7C6-4A7A-B34D-FA27D775A049}</Project>
|
||||
<Name>Common</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\MessageBoxEx\MessageBoxEx.vbproj">
|
||||
<Project>{ef29f400-be45-4283-9d18-ca7acd9accc9}</Project>
|
||||
<Name>MessageBoxEx</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Modules.Config\Config.vbproj">
|
||||
<Project>{44982f9b-6116-44e2-85d0-f39650b1ef99}</Project>
|
||||
<Name>Config</Name>
|
||||
|
||||
13
GUIs.Test.TestGUI/frmFilesystem.Designer.vb
generated
13
GUIs.Test.TestGUI/frmFilesystem.Designer.vb
generated
@@ -22,16 +22,29 @@ Partial Class frmFilesystem
|
||||
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.Button1 = New System.Windows.Forms.Button()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'Button1
|
||||
'
|
||||
Me.Button1.Location = New System.Drawing.Point(12, 12)
|
||||
Me.Button1.Name = "Button1"
|
||||
Me.Button1.Size = New System.Drawing.Size(75, 23)
|
||||
Me.Button1.TabIndex = 0
|
||||
Me.Button1.Text = "Button1"
|
||||
Me.Button1.UseVisualStyleBackColor = True
|
||||
'
|
||||
'frmFilesystem
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(800, 450)
|
||||
Me.Controls.Add(Me.Button1)
|
||||
Me.Name = "frmFilesystem"
|
||||
Me.Text = "frmFilesystem"
|
||||
Me.ResumeLayout(False)
|
||||
|
||||
End Sub
|
||||
|
||||
Friend WithEvents Button1 As Button
|
||||
End Class
|
||||
|
||||
@@ -12,23 +12,28 @@ Public Class frmFilesystem
|
||||
LogConfig = New LogConfig(LogConfig.PathType.Temp)
|
||||
Filesystem = New DigitalData.Modules.Filesystem.File(LogConfig)
|
||||
|
||||
Using oWriter = IO.File.CreateText("E:\some_test_file.txt")
|
||||
oWriter.WriteLine("bla bla bla")
|
||||
End Using
|
||||
|
||||
IO.File.Copy(ShortName, LongName)
|
||||
'Using oWriter = IO.File.CreateText("E:\some_test_file.txt")
|
||||
' oWriter.WriteLine("bla bla bla")
|
||||
'End Using
|
||||
|
||||
Dim oVersion1 = Filesystem.GetVersionedFilename(LongName)
|
||||
IO.File.Copy(ShortName, oVersion1)
|
||||
'IO.File.Copy(ShortName, LongName)
|
||||
|
||||
Dim oVersion2 = Filesystem.GetVersionedFilename(LongName)
|
||||
IO.File.Copy(ShortName, oVersion2)
|
||||
'Dim oVersion1 = Filesystem.GetVersionedFilename(LongName)
|
||||
'IO.File.Copy(ShortName, oVersion1)
|
||||
|
||||
'Dim oVersion2 = Filesystem.GetVersionedFilename(LongName)
|
||||
'IO.File.Copy(ShortName, oVersion2)
|
||||
Catch ex As Exception
|
||||
|
||||
Finally
|
||||
IO.File.Delete(ShortName)
|
||||
IO.File.Delete(LongName)
|
||||
'IO.File.Delete(ShortName)
|
||||
'IO.File.Delete(LongName)
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
||||
Dim oDateString = Filesystem.CreateDateDirectory("E:\")
|
||||
End Sub
|
||||
End Class
|
||||
60
GUIs.Test.TestGUI/frmMsgBox.Designer.vb
generated
Normal file
60
GUIs.Test.TestGUI/frmMsgBox.Designer.vb
generated
Normal file
@@ -0,0 +1,60 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class frmMsgBox
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Wird vom Windows Form-Designer benötigt.
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
|
||||
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
|
||||
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.SimpleButton1 = New DevExpress.XtraEditors.SimpleButton()
|
||||
Me.SimpleButton2 = New DevExpress.XtraEditors.SimpleButton()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'SimpleButton1
|
||||
'
|
||||
Me.SimpleButton1.Location = New System.Drawing.Point(12, 12)
|
||||
Me.SimpleButton1.Name = "SimpleButton1"
|
||||
Me.SimpleButton1.Size = New System.Drawing.Size(163, 23)
|
||||
Me.SimpleButton1.TabIndex = 0
|
||||
Me.SimpleButton1.Text = "SimpleButton1"
|
||||
'
|
||||
'SimpleButton2
|
||||
'
|
||||
Me.SimpleButton2.Location = New System.Drawing.Point(181, 12)
|
||||
Me.SimpleButton2.Name = "SimpleButton2"
|
||||
Me.SimpleButton2.Size = New System.Drawing.Size(163, 23)
|
||||
Me.SimpleButton2.TabIndex = 0
|
||||
Me.SimpleButton2.Text = "SimpleButton1"
|
||||
'
|
||||
'frmMsgBox
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(800, 450)
|
||||
Me.Controls.Add(Me.SimpleButton2)
|
||||
Me.Controls.Add(Me.SimpleButton1)
|
||||
Me.Name = "frmMsgBox"
|
||||
Me.Text = "frmMsgBox"
|
||||
Me.ResumeLayout(False)
|
||||
|
||||
End Sub
|
||||
|
||||
Friend WithEvents SimpleButton1 As DevExpress.XtraEditors.SimpleButton
|
||||
Friend WithEvents SimpleButton2 As DevExpress.XtraEditors.SimpleButton
|
||||
End Class
|
||||
120
GUIs.Test.TestGUI/frmMsgBox.resx
Normal file
120
GUIs.Test.TestGUI/frmMsgBox.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
24
GUIs.Test.TestGUI/frmMsgBox.vb
Normal file
24
GUIs.Test.TestGUI/frmMsgBox.vb
Normal file
@@ -0,0 +1,24 @@
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Controls.MessageBoxEx
|
||||
|
||||
Public Class frmMsgBox
|
||||
Private LogConfig As LogConfig
|
||||
Private SQLServer As MSSQLServer
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, SQLServer As MSSQLServer)
|
||||
InitializeComponent()
|
||||
|
||||
Me.LogConfig = LogConfig
|
||||
Me.SQLServer = SQLServer
|
||||
End Sub
|
||||
|
||||
Private Sub SimpleButton1_Click(sender As Object, e As EventArgs) Handles SimpleButton1.Click
|
||||
Dim oMsgbox = New MsgBoxEx("Hallo Welt!", "Ein Titel")
|
||||
oMsgbox.ShowDialog()
|
||||
End Sub
|
||||
|
||||
Private Sub SimpleButton2_Click(sender As Object, e As EventArgs) Handles SimpleButton2.Click
|
||||
MsgBox("Hallo Welt", MsgBoxStyle.OkOnly, "EinTitel")
|
||||
End Sub
|
||||
End Class
|
||||
12
GUIs.Test.TestGUI/frmStart.Designer.vb
generated
12
GUIs.Test.TestGUI/frmStart.Designer.vb
generated
@@ -31,6 +31,7 @@ Partial Class frmStart
|
||||
Me.Button7 = New System.Windows.Forms.Button()
|
||||
Me.Button8 = New System.Windows.Forms.Button()
|
||||
Me.Button9 = New System.Windows.Forms.Button()
|
||||
Me.Button10 = New System.Windows.Forms.Button()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'Button1
|
||||
@@ -114,11 +115,21 @@ Partial Class frmStart
|
||||
Me.Button9.Text = "SQL Editor"
|
||||
Me.Button9.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button10
|
||||
'
|
||||
Me.Button10.Location = New System.Drawing.Point(254, 197)
|
||||
Me.Button10.Name = "Button10"
|
||||
Me.Button10.Size = New System.Drawing.Size(236, 55)
|
||||
Me.Button10.TabIndex = 3
|
||||
Me.Button10.Text = "MsgBox"
|
||||
Me.Button10.UseVisualStyleBackColor = True
|
||||
'
|
||||
'frmStart
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(800, 450)
|
||||
Me.Controls.Add(Me.Button10)
|
||||
Me.Controls.Add(Me.Button9)
|
||||
Me.Controls.Add(Me.Button6)
|
||||
Me.Controls.Add(Me.Button5)
|
||||
@@ -143,4 +154,5 @@ Partial Class frmStart
|
||||
Friend WithEvents Button7 As Button
|
||||
Friend WithEvents Button8 As Button
|
||||
Friend WithEvents Button9 As Button
|
||||
Friend WithEvents Button10 As Button
|
||||
End Class
|
||||
|
||||
@@ -51,5 +51,8 @@ Public Class frmStart
|
||||
oForm.Show()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
|
||||
Dim oForm As New frmMsgBox(LogConfig, Database)
|
||||
oForm.Show()
|
||||
End Sub
|
||||
End Class
|
||||
6
MessageBoxEx/App.config
Normal file
6
MessageBoxEx/App.config
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
|
||||
</startup>
|
||||
</configuration>
|
||||
139
MessageBoxEx/MessageBoxEx.vbproj
Normal file
139
MessageBoxEx/MessageBoxEx.vbproj
Normal file
@@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{EF29F400-BE45-4283-9D18-CA7ACD9ACCC9}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
<RootNamespace>DigitalData.Controls.MessageBoxEx</RootNamespace>
|
||||
<AssemblyName>DigitalData.Controls.MessageBoxEx</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>DigitalData.Controls.MessageBoxEx.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>DigitalData.Controls.MessageBoxEx.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="DevExpress.Data.Desktop.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.Printing.v21.2.Core, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.Utils.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>D:\ProgramFiles\DevExpress 21.2\Components\Bin\Framework\DevExpress.XtraEditors.v21.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Runtime.Remoting" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="UIAutomationClient" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Drawing" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Windows.Forms" />
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Xml.Linq" />
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MsgBoxEx.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MsgBoxEx.Designer.vb">
|
||||
<DependentUpon>MsgBoxEx.vb</DependentUpon>
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="MsgBoxEx.resx">
|
||||
<DependentUpon>MsgBoxEx.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
</Project>
|
||||
135
MessageBoxEx/MsgBoxEx.Designer.vb
generated
Normal file
135
MessageBoxEx/MsgBoxEx.Designer.vb
generated
Normal file
@@ -0,0 +1,135 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
|
||||
Partial Class MsgBoxEx
|
||||
Inherits DevExpress.XtraEditors.XtraForm
|
||||
|
||||
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
|
||||
<System.Diagnostics.DebuggerNonUserCode()>
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Wird vom Windows Form-Designer benötigt.
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
|
||||
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
|
||||
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
|
||||
<System.Diagnostics.DebuggerStepThrough()>
|
||||
Private Sub InitializeComponent()
|
||||
Me.chkBx = New System.Windows.Forms.CheckBox()
|
||||
Me.btn1 = New System.Windows.Forms.Button()
|
||||
Me.btn2 = New System.Windows.Forms.Button()
|
||||
Me.messageLbl = New System.Windows.Forms.Label()
|
||||
Me.btn3 = New System.Windows.Forms.Button()
|
||||
Me.PanelControl1 = New DevExpress.XtraEditors.PanelControl()
|
||||
CType(Me.PanelControl1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.PanelControl1.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'chkBx
|
||||
'
|
||||
Me.chkBx.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
|
||||
Me.chkBx.AutoSize = True
|
||||
Me.chkBx.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.chkBx.Location = New System.Drawing.Point(12, 76)
|
||||
Me.chkBx.Name = "chkBx"
|
||||
Me.chkBx.Size = New System.Drawing.Size(152, 20)
|
||||
Me.chkBx.TabIndex = 22
|
||||
Me.chkBx.Text = "Don't show this again"
|
||||
Me.chkBx.UseVisualStyleBackColor = True
|
||||
Me.chkBx.Visible = False
|
||||
'
|
||||
'btn1
|
||||
'
|
||||
Me.btn1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.btn1.AutoSize = True
|
||||
Me.btn1.DialogResult = System.Windows.Forms.DialogResult.Cancel
|
||||
Me.btn1.Location = New System.Drawing.Point(161, 12)
|
||||
Me.btn1.Name = "btn1"
|
||||
Me.btn1.Size = New System.Drawing.Size(100, 23)
|
||||
Me.btn1.TabIndex = 5
|
||||
Me.btn1.Text = "Button1"
|
||||
Me.btn1.UseVisualStyleBackColor = True
|
||||
Me.btn1.Visible = False
|
||||
'
|
||||
'btn2
|
||||
'
|
||||
Me.btn2.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.btn2.AutoSize = True
|
||||
Me.btn2.Location = New System.Drawing.Point(267, 12)
|
||||
Me.btn2.Name = "btn2"
|
||||
Me.btn2.Size = New System.Drawing.Size(100, 23)
|
||||
Me.btn2.TabIndex = 6
|
||||
Me.btn2.Text = "Button2"
|
||||
Me.btn2.UseVisualStyleBackColor = True
|
||||
Me.btn2.Visible = False
|
||||
'
|
||||
'messageLbl
|
||||
'
|
||||
Me.messageLbl.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.messageLbl.Location = New System.Drawing.Point(58, 10)
|
||||
Me.messageLbl.Name = "messageLbl"
|
||||
Me.messageLbl.Size = New System.Drawing.Size(415, 75)
|
||||
Me.messageLbl.TabIndex = 19
|
||||
Me.messageLbl.Text = "[Message]"
|
||||
'
|
||||
'btn3
|
||||
'
|
||||
Me.btn3.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.btn3.AutoSize = True
|
||||
Me.btn3.Location = New System.Drawing.Point(373, 12)
|
||||
Me.btn3.Name = "btn3"
|
||||
Me.btn3.Size = New System.Drawing.Size(100, 23)
|
||||
Me.btn3.TabIndex = 7
|
||||
Me.btn3.Text = "Button3"
|
||||
Me.btn3.UseVisualStyleBackColor = True
|
||||
Me.btn3.Visible = False
|
||||
'
|
||||
'PanelControl1
|
||||
'
|
||||
Me.PanelControl1.Controls.Add(Me.btn1)
|
||||
Me.PanelControl1.Controls.Add(Me.btn3)
|
||||
Me.PanelControl1.Controls.Add(Me.btn2)
|
||||
Me.PanelControl1.Dock = System.Windows.Forms.DockStyle.Bottom
|
||||
Me.PanelControl1.Location = New System.Drawing.Point(0, 102)
|
||||
Me.PanelControl1.Name = "PanelControl1"
|
||||
Me.PanelControl1.Size = New System.Drawing.Size(485, 47)
|
||||
Me.PanelControl1.TabIndex = 23
|
||||
'
|
||||
'MsgBoxEx
|
||||
'
|
||||
Me.Appearance.BackColor = System.Drawing.SystemColors.ControlLightLight
|
||||
Me.Appearance.Options.UseBackColor = True
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None
|
||||
Me.CancelButton = Me.btn1
|
||||
Me.ClientSize = New System.Drawing.Size(485, 149)
|
||||
Me.Controls.Add(Me.PanelControl1)
|
||||
Me.Controls.Add(Me.chkBx)
|
||||
Me.Controls.Add(Me.messageLbl)
|
||||
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
|
||||
Me.MaximizeBox = False
|
||||
Me.MinimizeBox = False
|
||||
Me.Name = "MsgBoxEx"
|
||||
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
|
||||
Me.Text = "[Title]"
|
||||
CType(Me.PanelControl1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.PanelControl1.ResumeLayout(False)
|
||||
Me.PanelControl1.PerformLayout()
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
End Sub
|
||||
|
||||
Private chkBx As System.Windows.Forms.CheckBox
|
||||
Private WithEvents btn1 As System.Windows.Forms.Button
|
||||
Private WithEvents btn2 As System.Windows.Forms.Button
|
||||
Private messageLbl As System.Windows.Forms.Label
|
||||
Private WithEvents btn3 As System.Windows.Forms.Button
|
||||
Friend WithEvents PanelControl1 As DevExpress.XtraEditors.PanelControl
|
||||
End Class
|
||||
120
MessageBoxEx/MsgBoxEx.resx
Normal file
120
MessageBoxEx/MsgBoxEx.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
188
MessageBoxEx/MsgBoxEx.vb
Normal file
188
MessageBoxEx/MsgBoxEx.vb
Normal file
@@ -0,0 +1,188 @@
|
||||
Public Class MsgBoxEx
|
||||
Public Sub New(ByVal message As String, ByVal title As String)
|
||||
Me.New(message, title, MessageBoxIcon.None)
|
||||
End Sub
|
||||
|
||||
Public Sub New(ByVal message As String, ByVal title As String, ByVal icon As MessageBoxIcon)
|
||||
Me.New(message, title, getMessageBoxIcon(icon))
|
||||
End Sub
|
||||
|
||||
Public Sub New(ByVal message As String, ByVal title As String, ByVal icon As Icon)
|
||||
InitializeComponent()
|
||||
Me.messageLbl.Text = message
|
||||
Me.Text = title
|
||||
Me.m_sysIcon = icon
|
||||
If Me.m_sysIcon Is Nothing Then Me.messageLbl.Location = New System.Drawing.Point(FORM_X_MARGIN, FORM_Y_MARGIN)
|
||||
End Sub
|
||||
|
||||
Private Shared Function getMessageBoxIcon(ByVal icon As MessageBoxIcon) As Icon
|
||||
Dim oIcon As Icon = Nothing
|
||||
|
||||
Select Case icon
|
||||
Case MessageBoxIcon.Asterisk
|
||||
oIcon = SystemIcons.Asterisk
|
||||
Case MessageBoxIcon.[Error]
|
||||
oIcon = SystemIcons.[Error]
|
||||
Case MessageBoxIcon.Exclamation
|
||||
oIcon = SystemIcons.Exclamation
|
||||
Case MessageBoxIcon.Question
|
||||
oIcon = SystemIcons.Question
|
||||
End Select
|
||||
|
||||
If oIcon IsNot Nothing Then
|
||||
Return DevExpress.Utils.Drawing.Helpers.StockIconHelper.GetWindows8AssociatedIcon(oIcon)
|
||||
Else
|
||||
Return Nothing
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private m_minWidth As Integer
|
||||
Private m_minHeight As Integer
|
||||
|
||||
Public Sub SetMinSize(ByVal width As Integer, ByVal height As Integer)
|
||||
m_minWidth = width
|
||||
m_minHeight = height
|
||||
End Sub
|
||||
|
||||
Public Sub SetButtons(ParamArray names As String())
|
||||
Dim drs As DialogResult() = New DialogResult(names.Length - 1) {}
|
||||
|
||||
For i As Integer = 0 To names.Length - 1
|
||||
drs(i) = DialogResult.None
|
||||
Next
|
||||
|
||||
Me.SetButtons(names, drs)
|
||||
End Sub
|
||||
|
||||
Public Sub SetButtons(ByVal names As String(), ByVal results As DialogResult())
|
||||
Me.SetButtons(names, results, 1)
|
||||
End Sub
|
||||
|
||||
Public Sub SetButtons(ByVal names As String(), ByVal results As DialogResult(), ByVal def As Integer)
|
||||
If names Is Nothing Then Throw New ArgumentNullException("btnText", "Button Text is null")
|
||||
Dim count As Integer = names.Length
|
||||
If count < 1 OrElse count > 3 Then Throw New ArgumentException("Invalid number of buttons. Must be between 1 and 3.")
|
||||
m_minButtonRowWidth += setButtonParams(btn1, names(0), If(def = 1, 1, 2), results(0))
|
||||
|
||||
If count > 1 Then
|
||||
m_minButtonRowWidth += setButtonParams(btn2, names(1), If(def = 2, 1, 3), results(1)) + BUTTON_SPACE
|
||||
End If
|
||||
|
||||
If count > 2 Then
|
||||
m_minButtonRowWidth += setButtonParams(btn3, names(2), If(def = 3, 1, 4), results(2)) + BUTTON_SPACE
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private m_minButtonRowWidth As Integer
|
||||
|
||||
Private Shared Function setButtonParams(ByVal btn As Button, ByVal text As String, ByVal tab As Integer, ByVal dr As DialogResult) As Integer
|
||||
btn.Text = text
|
||||
btn.Visible = True
|
||||
btn.DialogResult = dr
|
||||
btn.TabIndex = tab
|
||||
Return btn.Size.Width
|
||||
End Function
|
||||
|
||||
Public Sub SetCheckbox(ByVal text As String)
|
||||
Me.SetCheckbox(text, False)
|
||||
End Sub
|
||||
|
||||
Public Sub SetCheckbox(ByVal text As String, ByVal chcked As Boolean)
|
||||
Me.chkBx.Visible = True
|
||||
Me.chkBx.Text = text
|
||||
Me.chkBx.Checked = chcked
|
||||
Me.m_minButtonRowWidth += Me.chkBx.Size.Width + CHECKBOX_SPACE
|
||||
End Sub
|
||||
|
||||
Private Sub DialogBox_Load(ByVal sender As Object, ByVal e As EventArgs)
|
||||
If Not btn1.Visible Then Me.SetButtons(New String() {"OK"}, New DialogResult() {DialogResult.OK})
|
||||
m_minButtonRowWidth += 2 * FORM_X_MARGIN
|
||||
Me.setDialogSize()
|
||||
Me.setButtonRowLocations()
|
||||
End Sub
|
||||
|
||||
Const FORM_Y_MARGIN As Integer = 10
|
||||
Const FORM_X_MARGIN As Integer = 16
|
||||
Const BUTTON_SPACE As Integer = 5
|
||||
Const CHECKBOX_SPACE As Integer = 15
|
||||
Const TEXT_Y_MARGIN As Integer = 30
|
||||
|
||||
Private Sub setDialogSize()
|
||||
Dim requiredWidth As Integer = Me.messageLbl.Location.X + Me.messageLbl.Size.Width + FORM_X_MARGIN
|
||||
requiredWidth = If(requiredWidth > m_minButtonRowWidth, requiredWidth, m_minButtonRowWidth)
|
||||
Dim requiredHeight As Integer = Me.messageLbl.Location.Y + Me.messageLbl.Size.Height - Me.btn2.Location.Y + Me.ClientSize.Height + TEXT_Y_MARGIN
|
||||
Dim minSetWidth As Integer = If(Me.ClientSize.Width > Me.m_minWidth, Me.ClientSize.Width, Me.m_minWidth)
|
||||
Dim minSetHeight As Integer = If(Me.ClientSize.Height > Me.m_minHeight, Me.ClientSize.Height, Me.m_minHeight)
|
||||
Dim s As Size = New Size()
|
||||
s.Width = If(requiredWidth > minSetWidth, requiredWidth, minSetWidth)
|
||||
s.Height = If(requiredHeight > minSetHeight, requiredHeight, minSetHeight)
|
||||
Me.ClientSize = s
|
||||
End Sub
|
||||
|
||||
Private Sub setButtonRowLocations()
|
||||
Dim formWidth As Integer = Me.ClientRectangle.Width
|
||||
Dim x As Integer = formWidth - FORM_X_MARGIN
|
||||
Dim y As Integer = btn1.Location.Y
|
||||
|
||||
If btn3.Visible Then
|
||||
x -= btn3.Size.Width
|
||||
btn3.Location = New Point(x, y)
|
||||
x -= BUTTON_SPACE
|
||||
End If
|
||||
|
||||
If btn2.Visible Then
|
||||
x -= btn2.Size.Width
|
||||
btn2.Location = New Point(x, y)
|
||||
x -= BUTTON_SPACE
|
||||
End If
|
||||
|
||||
x -= btn1.Size.Width
|
||||
btn1.Location = New Point(x, y)
|
||||
If Me.chkBx.Visible Then Me.chkBx.Location = New Point(FORM_X_MARGIN, Me.chkBx.Location.Y)
|
||||
End Sub
|
||||
|
||||
Private m_sysIcon As Icon
|
||||
|
||||
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
|
||||
If m_sysIcon IsNot Nothing Then
|
||||
Dim g As Graphics = e.Graphics
|
||||
g.DrawIconUnstretched(m_sysIcon, New Rectangle(FORM_X_MARGIN, FORM_Y_MARGIN, m_sysIcon.Width, m_sysIcon.Height))
|
||||
End If
|
||||
|
||||
MyBase.OnPaint(e)
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property CheckboxChecked As Boolean
|
||||
Get
|
||||
Return Me.chkBx.Checked
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_result As DialogBoxResult
|
||||
|
||||
Public ReadOnly Property Result As DialogBoxResult
|
||||
Get
|
||||
Return m_result
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Sub btn_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn1.Click, btn2.Click, btn3.Click
|
||||
If sender.Equals(btn1) Then
|
||||
m_result = DialogBoxResult.Button1
|
||||
ElseIf sender.Equals(btn2) Then
|
||||
m_result = DialogBoxResult.Button2
|
||||
ElseIf sender.Equals(btn3) Then
|
||||
m_result = DialogBoxResult.Button3
|
||||
End If
|
||||
|
||||
If (CType(sender, Button)).DialogResult = DialogResult.None Then
|
||||
Close()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Enum DialogBoxResult
|
||||
Button1
|
||||
Button2
|
||||
Button3
|
||||
End Enum
|
||||
End Class
|
||||
13
MessageBoxEx/My Project/Application.Designer.vb
generated
Normal file
13
MessageBoxEx/My Project/Application.Designer.vb
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
11
MessageBoxEx/My Project/Application.myapp
Normal file
11
MessageBoxEx/My Project/Application.myapp
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<MySubMain>true</MySubMain>
|
||||
<MainForm>Form1</MainForm>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<ApplicationType>0</ApplicationType>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
||||
35
MessageBoxEx/My Project/AssemblyInfo.vb
Normal file
35
MessageBoxEx/My Project/AssemblyInfo.vb
Normal file
@@ -0,0 +1,35 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
' die einer Assembly zugeordnet sind.
|
||||
|
||||
' Werte der Assemblyattribute überprüfen
|
||||
|
||||
<Assembly: AssemblyTitle("MessageBoxEx")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("MessageBoxEx")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2022")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'Die folgende GUID wird für die typelib-ID verwendet, wenn dieses Projekt für COM verfügbar gemacht wird.
|
||||
<Assembly: Guid("1313e6d2-bfd7-4373-9148-8f4bf37fbe10")>
|
||||
|
||||
' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
'
|
||||
' Hauptversion
|
||||
' Nebenversion
|
||||
' Buildnummer
|
||||
' Revision
|
||||
'
|
||||
' Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||
' indem Sie "*" wie unten gezeigt eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.0.0.0")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||
63
MessageBoxEx/My Project/Resources.Designer.vb
generated
Normal file
63
MessageBoxEx/My Project/Resources.Designer.vb
generated
Normal file
@@ -0,0 +1,63 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||
'-Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
'Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||
'mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||
'''<summary>
|
||||
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("DigitalData.Controls.MessageBoxEx.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
117
MessageBoxEx/My Project/Resources.resx
Normal file
117
MessageBoxEx/My Project/Resources.resx
Normal file
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
73
MessageBoxEx/My Project/Settings.Designer.vb
generated
Normal file
73
MessageBoxEx/My Project/Settings.Designer.vb
generated
Normal file
@@ -0,0 +1,73 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
|
||||
|
||||
#Region "Automatische My.Settings-Speicherfunktion"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
|
||||
If My.Application.SaveMySettingsOnExit Then
|
||||
My.Settings.Save()
|
||||
End If
|
||||
End Sub
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Public Shared ReadOnly Property [Default]() As MySettings
|
||||
Get
|
||||
|
||||
#If _MyType = "WindowsForms" Then
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
#End If
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.DigitalData.Controls.MessageBoxEx.My.MySettings
|
||||
Get
|
||||
Return Global.DigitalData.Controls.MessageBoxEx.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
7
MessageBoxEx/My Project/Settings.settings
Normal file
7
MessageBoxEx/My Project/Settings.settings
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -27,15 +27,16 @@ Public Class Helpers
|
||||
Dim oFileModifiedAt As Date = oFileInfo?.LastWriteTime
|
||||
Dim oFileHash As String = FileEx.GetChecksum(oFileInfo.FullName)
|
||||
|
||||
Return New FileProperties With {
|
||||
Return New FileProperties With {
|
||||
.FileName = oFileInfo.Name,
|
||||
.FileCreatedAt = oFileCreatedAt,
|
||||
.FileChangedAt = oFileModifiedAt,
|
||||
.FileContents = oContents,
|
||||
.FileImportedAt = pDateImportedAt,
|
||||
.FileChecksum = oFileHash
|
||||
.FileChecksum = oFileHash,
|
||||
.FileInfoRaw = oFileInfo
|
||||
}
|
||||
End Using
|
||||
End Using
|
||||
End Using
|
||||
End Function
|
||||
End Class
|
||||
|
||||
@@ -14,7 +14,7 @@ Namespace Modules.IDB
|
||||
Public Async Function RunAsync(pObjectId As String, pState As String, Optional pOptions As SetObjectStateOptions = Nothing) As Task(Of Boolean)
|
||||
Try
|
||||
|
||||
Dim oSql As String = $"EXEC PRIDB_OBJECT_SET_STATE {pObjectId}, '{pState}', '{pOptions.Username}', '{pOptions.Language}'"
|
||||
Dim oSql As String = $"EXEC PRIDB_OBJECT_SET_STATE {pObjectId}, '{pState}', '{pOptions.Username}'"
|
||||
Dim oResult = Await Channel.ExecuteNonQuery_MSSQL_IDBAsync(oSql)
|
||||
|
||||
If oResult.OK Then
|
||||
|
||||
@@ -349,10 +349,11 @@ Public Class File
|
||||
''' </summary>
|
||||
''' <remarks>
|
||||
''' https://docs.microsoft.com/en-us/dotnet/standard/io/handling-io-errors
|
||||
''' https://stackoverflow.com/questions/876473/is-there-a-way-to-check-if-a-file-is-in-use
|
||||
''' </remarks>
|
||||
Public Function TestFileIsLocked(pFilePath As String) As Boolean
|
||||
Try
|
||||
Using stream As FileStream = IO.File.Open(pFilePath, FileMode.Open, FileAccess.Read, FileShare.None)
|
||||
Using stream As FileStream = IO.File.Open(pFilePath, FileMode.Open, FileAccess.ReadWrite, FileShare.None)
|
||||
stream.Close()
|
||||
End Using
|
||||
Catch ex As Exception When ((ex.HResult And &HFFFF) = 32)
|
||||
@@ -388,9 +389,12 @@ Public Class File
|
||||
Dim oFinalDirectory As String = IO.Path.Combine(pBaseDirectory, oDateDirectory)
|
||||
|
||||
If IO.Directory.Exists(oFinalDirectory) = False Then
|
||||
_Logger.Debug("Path does not exist, creating: [{0}]", oFinalDirectory)
|
||||
Try
|
||||
Directory.CreateDirectory(oFinalDirectory)
|
||||
_Logger.Debug("Created folder [{0}]", oFinalDirectory)
|
||||
Catch ex As Exception
|
||||
_Logger.Warn("Final path [{0}] could not be created!", oFinalDirectory)
|
||||
_Logger.Error(ex)
|
||||
End Try
|
||||
End If
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
|
||||
@@ -138,26 +138,12 @@ Namespace IDB
|
||||
|
||||
Public Function GetFileObjectPath(pStore As GlobalState.ObjectStore, pDateImported As Date) As String
|
||||
' Get directory by DateImported or, if not supplied, by current date
|
||||
Dim oSubDirectory As String
|
||||
Dim oFinalPath As String
|
||||
If IsNothing(pDateImported) Then
|
||||
oSubDirectory = FileEx.CreateDateDirectory(Now)
|
||||
oFinalPath = FileEx.CreateDateDirectory(pStore.Path, Now)
|
||||
Else
|
||||
oSubDirectory = FileEx.CreateDateDirectory(pDateImported)
|
||||
oFinalPath = FileEx.CreateDateDirectory(pStore.Path, pDateImported)
|
||||
End If
|
||||
Logger.Debug("Subdirectory is [{0}]", oSubDirectory)
|
||||
|
||||
' Check and create final path, if necessary
|
||||
Dim oFinalPath = IO.Path.Combine(pStore.Path, oSubDirectory)
|
||||
If Not IO.Directory.Exists(oFinalPath) Then
|
||||
Try
|
||||
Logger.Debug("Path does not exist, creating: [{0}]", oFinalPath)
|
||||
IO.Directory.CreateDirectory(oFinalPath)
|
||||
Logger.Debug("Created folder [{0}]", oFinalPath)
|
||||
Catch ex As Exception
|
||||
LogAndThrow(ex, $"Store Directory [{oFinalPath}] could not be created!")
|
||||
End Try
|
||||
End If
|
||||
Logger.Debug("Final Directory is [{0}]", oFinalPath)
|
||||
|
||||
Return oFinalPath
|
||||
End Function
|
||||
|
||||
@@ -59,13 +59,15 @@ Namespace Methods.IDB.NewFile
|
||||
oFilePath = IO.Path.Combine(oFinalPath, oFileName)
|
||||
Dim oFileObjectInfo As IO.FileInfo = New IO.FileInfo(oFilePath)
|
||||
|
||||
Dim oFileObjectSize As Long = pData.File.FileContents.Length
|
||||
Dim oFileObjectName As String = oFileObjectInfo.Name
|
||||
Dim oOriginalExtension As String = pData.File.FileInfoRaw.Extension.Substring(1)
|
||||
|
||||
Logger.Debug("File Information for [{0}]:", oFileObjectName)
|
||||
|
||||
Dim oFileObjectSize As Long = pData.File.FileContents.Length
|
||||
Logger.Debug("Size: [{0}]", oFileObjectSize)
|
||||
|
||||
Dim oOriginalExtension As String = pData.File.FileInfoRaw.Extension.Substring(1)
|
||||
Logger.Debug("Original Extension: [{0}]", oOriginalExtension)
|
||||
|
||||
Logger.Debug("Checksum: [{0}]", pData.File.FileChecksum)
|
||||
|
||||
Try
|
||||
|
||||
@@ -29,6 +29,8 @@ Namespace Methods.IDB.UpdateFile
|
||||
'TODO: Create a view that collects all information about an idb object
|
||||
Dim oResultObjectId As Long
|
||||
|
||||
Logger.Debug("Creating new Version: [{0}]", pData.CreateNewVersion)
|
||||
|
||||
If pData.CreateNewVersion = False Then
|
||||
' ----------------------------------------------
|
||||
' -- Replace the existing file-object
|
||||
@@ -71,7 +73,12 @@ Namespace Methods.IDB.UpdateFile
|
||||
Dim oObjectRow As DataRow = oObjectTable.Rows.Item(0)
|
||||
Dim oKind As String = oObjectRow.Item("KIND_NAME")
|
||||
Dim oBusinessEntity As String = oObjectRow.Item("BE_NAME")
|
||||
Dim oStore As String = oObjectRow.ItemArray("STORE_NAME")
|
||||
Dim oStore As String = oObjectRow.Item("STORE_NAME")
|
||||
|
||||
Logger.Debug("Getting information for ObjectId [{0}]", pData.ObjectId)
|
||||
Logger.Debug("Kind: [{0}]", oKind)
|
||||
Logger.Debug("BE: [{0}]", oBusinessEntity)
|
||||
Logger.Debug("Store: [{0}]", oStore)
|
||||
|
||||
Dim oNewFileMethod As New NewFile.NewFileMethod(LogConfig, DatabaseIDB, DatabaseECM, GlobalState)
|
||||
Dim oNewFileRequest As New NewFile.NewFileRequest With {
|
||||
@@ -82,11 +89,17 @@ Namespace Methods.IDB.UpdateFile
|
||||
.User = pData.User
|
||||
}
|
||||
Dim oNewFileResponse = oNewFileMethod.Run(oNewFileRequest)
|
||||
Dim oNewObjectId = oNewFileResponse.ObjectId
|
||||
|
||||
If oNewFileResponse.OK = False Then
|
||||
LogAndThrow(oNewFileResponse.ErrorMessage)
|
||||
End If
|
||||
|
||||
Dim oNewObjectId As Long = oNewFileResponse.ObjectId
|
||||
Logger.Debug("New file Version has ObjectId [{0}]", oNewObjectId)
|
||||
|
||||
Dim oSql As String = $"EXEC PRIDB_NEW_VERSION_OBJECT '{pData.ObjectId}', '{oNewObjectId}', '{pData.User.UserName}'"
|
||||
DatabaseIDB.ExecuteNonQuery(oSql)
|
||||
|
||||
Logger.Debug("Versioning complete from [{0}] to [{1}]", pData.ObjectId, oNewObjectId)
|
||||
|
||||
oResultObjectId = oNewObjectId
|
||||
|
||||
@@ -97,7 +110,7 @@ Namespace Methods.IDB.UpdateFile
|
||||
|
||||
Return New UpdateFileResponse(oResultObjectId)
|
||||
Catch ex As Exception
|
||||
Logger.Warn("Error occurred while creating file!")
|
||||
Logger.Warn("Error occurred while updating file!")
|
||||
Logger.Error(ex)
|
||||
|
||||
Logger.Info("Rolling back transaction.")
|
||||
|
||||
Reference in New Issue
Block a user