diff --git a/Global_Indexer/Changelog.txt b/Global_Indexer/Changelog.txt new file mode 100644 index 0000000..40c1a43 --- /dev/null +++ b/Global_Indexer/Changelog.txt @@ -0,0 +1,7 @@ +# Changelog + +## 2.5.0 + +* Replace Mail Library +* Use DigitalData.Modules.Database for DB Access +* Remove clsHotkey.vb \ No newline at end of file diff --git a/Global_Indexer/ClassInit.vb b/Global_Indexer/ClassInit.vb index da326f5..1a47d90 100644 --- a/Global_Indexer/ClassInit.vb +++ b/Global_Indexer/ClassInit.vb @@ -8,8 +8,6 @@ Imports DigitalData.Modules.Database Imports DLLLicenseManager Public Class ClassInit - Public _lizenzManager As ClassLicenseManager - Public Sub InitLogger() ClassLogger.Init("", Environment.UserName) LOGCONFIG = New LogConfig(LogConfig.PathType.AppData, Nothing, Nothing, diff --git a/Global_Indexer/ClassLicence.vb b/Global_Indexer/ClassLicence.vb index bed816c..0fe9c64 100644 --- a/Global_Indexer/ClassLicence.vb +++ b/Global_Indexer/ClassLicence.vb @@ -1,15 +1,17 @@ Imports System.Globalization Imports DLLLicenseManager +Imports DigitalData.Modules.License + Public Class ClassLicence - Public Shared License_Date As Date - Private Shared _lizenzManager As ClassLicenseManager + Public Shared LicenseDate As Date + Public Shared LicenseManager As LicenseManagerLegacy Public Shared Sub Refresh_Licence() Try - _lizenzManager = New ClassLicenseManager("#DigitalData35452!#", "") + LicenseManager = New LicenseManagerLegacy(LOGCONFIG, "#DigitalData35452!#", "") Dim sql As String = "SELECT LICENSEKEY FROM TBGI_CONFIGURATION WHERE GUID = 1" Dim licEncoded As String = DATABASE_ECM.GetScalarValue(sql) - Dim licString As String = _lizenzManager.DecodeLicenseKey(licEncoded) + Dim licString As String = LicenseManager.DecodeLicenseKey(licEncoded) Dim licArray() As String = licString.ToString.Split("#") If licEncoded <> "" Then @@ -20,10 +22,10 @@ Public Class ClassLicence LOGGER.Debug("License Date is {0}", licArray(1)) - License_Date = Date.ParseExact(licArray(1), "dd.MM.yyyy", CultureInfo.InvariantCulture) + LicenseDate = Date.ParseExact(licArray(1), "dd.MM.yyyy", CultureInfo.InvariantCulture) 'License_Date = CDate(split(1)) - If License_Date < Now Then + If LicenseDate < Now Then If USER_LANGUAGE = "de-DE" Then MsgBox("Ihre Lizenz ist abgelaufen!" & vbNewLine & "Letztes Gültigkeitsdatum: " & licArray(1) & vbNewLine & "Bitte setzen Sie sich mit Digital Data in Verbindung", MsgBoxStyle.Exclamation) Else @@ -51,9 +53,9 @@ Public Class ClassLicence Public Shared Function license_is_Valid() If LICENSE_EXPIRED Then If USER_LANGUAGE = "de-DE" Then - MsgBox("Ihre Lizenz ist abgelaufen!" & vbNewLine & "Letztes Gültigkeitsdatum: " & License_Date & vbNewLine & "Bitte setzen Sie sich mit Digital Data in Verbindung", MsgBoxStyle.Exclamation) + MsgBox("Ihre Lizenz ist abgelaufen!" & vbNewLine & "Letztes Gültigkeitsdatum: " & LicenseDate & vbNewLine & "Bitte setzen Sie sich mit Digital Data in Verbindung", MsgBoxStyle.Exclamation) Else - MsgBox("Your license has expired!" & vbNewLine & "Last Valid Date: " & License_Date & vbNewLine & "Please contact Digital Data", MsgBoxStyle.Exclamation) + MsgBox("Your license has expired!" & vbNewLine & "Last Valid Date: " & LicenseDate & vbNewLine & "Please contact Digital Data", MsgBoxStyle.Exclamation) End If Return False diff --git a/Global_Indexer/Global_Indexer.vbproj b/Global_Indexer/Global_Indexer.vbproj index 6e3ccdd..ab49b4d 100644 --- a/Global_Indexer/Global_Indexer.vbproj +++ b/Global_Indexer/Global_Indexer.vbproj @@ -174,6 +174,9 @@ False ..\..\DDMonorepo\Modules.Language\bin\Debug\DigitalData.Modules.Language.dll + + ..\..\DDMonorepo\Modules.License\bin\Debug\DigitalData.Modules.License.dll + False ..\..\DDMonorepo\Modules.Logging\bin\Debug\DigitalData.Modules.Logging.dll @@ -188,10 +191,6 @@ False ..\..\DDMonorepo\Modules.Windream\bin\Debug\DigitalData.Modules.Windream.dll - - False - P:\Visual Studio Projekte\Bibliotheken\DLLLicenseManager.dll - P:\Visual Studio Projekte\Bibliotheken\windream\Interop.WINDREAMLib.dll False @@ -781,6 +780,7 @@ PreserveNewest + diff --git a/Global_Indexer/frmLicense.vb b/Global_Indexer/frmLicense.vb index 5a52333..d66f3aa 100644 --- a/Global_Indexer/frmLicense.vb +++ b/Global_Indexer/frmLicense.vb @@ -1,7 +1,6 @@ Imports System.Resources -Imports DLLLicenseManager + Public Class frmLicense - Public _lizenzManager As ClassLicenseManager Private LocRM As ResourceManager Private Sub btnPW_check_Click(sender As System.Object, e As System.EventArgs) Handles btnPW_check.Click If Me.txtPW.Text <> "" Then @@ -25,7 +24,7 @@ Public Class frmLicense Try If Me.txtNewlicences.Text <> "" And txtProfile.Text <> "" Then 'Encode the license - Dim result As String = Me._lizenzManager.EncodeLicenseKey(txtNewlicences.Text & "#" & dtpGueltig_GI.Text & "#" & txtProfile.Text & "#" & txtHotKey.Text, "#DigitalData35452!#") + Dim result As String = ClassLicence.LicenseManager.EncodeLicenseKey(txtNewlicences.Text & "#" & dtpGueltig_GI.Text & "#" & txtProfile.Text & "#" & txtHotKey.Text, "#DigitalData35452!#") txtlicensekey.Text = result Dim sql As String = "UPDATE TBGI_CONFIGURATION SET LICENSEKEY = '" & result & "' where guid = 1" If DATABASE_ECM.ExecuteNonQuery(sql) = True Then @@ -41,11 +40,10 @@ Public Class frmLicense Sub Refresh_Licence(Neu As Boolean) Dim lizenzzahl As Integer Try - Me._lizenzManager = New ClassLicenseManager("#DigitalData35452!#", "") Dim sql As String = "SELECT LICENSEKEY FROM TBGI_CONFIGURATION WHERE GUID = 1" Dim lic As String = DATABASE_ECM.GetScalarValue(sql) - Dim licString = Me._lizenzManager.DecodeLicenseKey(lic) + Dim licString = ClassLicence.LicenseManager.DecodeLicenseKey(lic) Dim split() = licString.ToString.Split("#") diff --git a/Global_Indexer/frmStart.vb b/Global_Indexer/frmStart.vb index 4a45c8a..ebaff31 100644 --- a/Global_Indexer/frmStart.vb +++ b/Global_Indexer/frmStart.vb @@ -6,120 +6,25 @@ Imports System.Globalization Imports System.Threading Imports System.Runtime.InteropServices Imports DigitalData.Modules.Language +Imports DigitalData.Modules.Windows +Imports DigitalData.Modules.License Public Class frmStart - Public _lizenzManager As ClassLicenseManager - Dim loaded As Boolean = False - Dim WithEvents HotKey As New clsHotkey(Me) - - Private Const mSnapOffset As Integer = 35 + Public _lizenzManager As LicenseManagerLegacy Private Const WM_WINDOWPOSCHANGING As Integer = &H46 Private IndexForm As frmIndex - - Public Structure WINDOWPOS - Public hwnd As IntPtr - Public hwndInsertAfter As IntPtr - Public x As Integer - Public y As Integer - Public cx As Integer - Public cy As Integer - Public flags As Integer - End Structure - Protected Overrides Sub WndProc(ByRef m As Message) ' Listen for operating system messages Select Case m.Msg Case WM_WINDOWPOSCHANGING - SnapToDesktopBorder(Me, m.LParam, 0) + Window.SnapToDesktopBorder(Me, m.LParam) End Select MyBase.WndProc(m) End Sub - Public Shared Sub SnapToDesktopBorder(ByVal clientForm _ - As Form, ByVal LParam As IntPtr, ByVal widthAdjustment As Integer) - If clientForm Is Nothing Then - ' Satisfies rule: Validate parameters - Throw New ArgumentNullException("clientForm") - End If - ' Snap client to the top, left, bottom or right desktop border - ' as the form is moved near that border. - - Try - ' Marshal the LPARAM value which is a WINDOWPOS struct - Dim NewPosition As New WINDOWPOS - NewPosition = CType(Runtime.InteropServices.Marshal.PtrToStructure( - LParam, GetType(WINDOWPOS)), WINDOWPOS) - - If NewPosition.y = 0 OrElse NewPosition.x = 0 Then - Return ' Nothing to do! - End If - - ' Adjust the client size for borders and caption bar - Dim ClientRect As Rectangle = - clientForm.RectangleToScreen(clientForm.ClientRectangle) - ClientRect.Width += - SystemInformation.FrameBorderSize.Width - widthAdjustment - ClientRect.Height += (SystemInformation.FrameBorderSize.Height + - SystemInformation.CaptionHeight) - - ' Now get the screen working area (without taskbar) - Dim WorkingRect As Rectangle = - Screen.GetWorkingArea(clientForm.ClientRectangle) - - ' Left border - If NewPosition.x >= WorkingRect.X - mSnapOffset AndAlso - NewPosition.x <= WorkingRect.X + mSnapOffset Then - NewPosition.x = WorkingRect.X - End If - - ' Get screen bounds and taskbar height - ' (when taskbar is horizontal) - Dim ScreenRect As Rectangle = - Screen.GetBounds(Screen.PrimaryScreen.Bounds) - Dim TaskbarHeight As Integer = - ScreenRect.Height - WorkingRect.Height - - ' Top border (check if taskbar is on top - ' or bottom via WorkingRect.Y) - If NewPosition.y >= -mSnapOffset AndAlso - (WorkingRect.Y > 0 AndAlso NewPosition.y <= - (TaskbarHeight + mSnapOffset)) OrElse - (WorkingRect.Y <= 0 AndAlso NewPosition.y <= - (mSnapOffset)) Then - If TaskbarHeight > 0 Then - NewPosition.y = WorkingRect.Y ' Horizontal Taskbar - Else - NewPosition.y = 0 ' Vertical Taskbar - End If - End If - - ' Right border - If NewPosition.x + ClientRect.Width <= - WorkingRect.Right + mSnapOffset AndAlso - NewPosition.x + ClientRect.Width >= - WorkingRect.Right - mSnapOffset Then - NewPosition.x = WorkingRect.Right - (ClientRect.Width + - SystemInformation.FrameBorderSize.Width) - End If - - ' Bottom border - If NewPosition.y + ClientRect.Height <= - WorkingRect.Bottom + mSnapOffset AndAlso - NewPosition.y + ClientRect.Height >= - WorkingRect.Bottom - mSnapOffset Then - NewPosition.y = WorkingRect.Bottom - (ClientRect.Height + - SystemInformation.FrameBorderSize.Height) - End If - - ' Marshal it back - Runtime.InteropServices.Marshal.StructureToPtr(NewPosition, - LParam, True) - Catch ex As ArgumentException - End Try - End Sub Private Sub frmMain_DragDrop(sender As Object, e As DragEventArgs) Handles MyBase.DragDrop DragDropForm(e) @@ -215,7 +120,7 @@ Public Class frmStart CURRENT_WORKFILE_HASH = Utils.NotNull(Filerow.Item("FILE_HASH"), "") LOGGER.Info(">> CURRENT_WORKFILE: " & CURRENT_WORKFILE) - If File.Exists(CURRENT_WORKFILE) = True And DTACTUAL_FILES.Rows.Count > 0 Then + If IO.File.Exists(CURRENT_WORKFILE) = True And DTACTUAL_FILES.Rows.Count > 0 Then Open_IndexDialog() Else Throw New FileNotFoundException("Dropped file does not exist anymore!") @@ -560,7 +465,6 @@ Public Class frmStart Else TimerFolderWatch.Start() End If - loaded = True Opacity = 0.7 ClassHelper.Refresh_RegexTable() diff --git a/SetupVS19/Product.wxs b/SetupVS19/Product.wxs index 2ce66b7..dbcd144 100644 --- a/SetupVS19/Product.wxs +++ b/SetupVS19/Product.wxs @@ -113,12 +113,12 @@ - +