diff --git a/ChatTest/App.config b/ChatTest/App.config new file mode 100644 index 00000000..ffaf5407 --- /dev/null +++ b/ChatTest/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ChatTest/ChatTest.vbproj b/ChatTest/ChatTest.vbproj new file mode 100644 index 00000000..44fd2d82 --- /dev/null +++ b/ChatTest/ChatTest.vbproj @@ -0,0 +1,143 @@ + + + + + Debug + AnyCPU + {4A726345-FD6B-4E1C-9E5D-18C9043D7714} + WinExe + ChatTest.My.MyApplication + ChatTest + ChatTest + 512 + WindowsForms + v4.7.2 + true + true + + + AnyCPU + true + full + true + true + bin\Debug\ + ChatTest.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + AnyCPU + pdbonly + false + true + true + bin\Release\ + ChatTest.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + + + ..\packages\NLog.4.7.2\lib\net45\NLog.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + + {1f278760-4f6b-42e8-b82d-01d4c8618340} + ChatControl + + + {903b2d7d-3b80-4be9-8713-7447b704e1b0} + Logging + + + + \ No newline at end of file diff --git a/ChatTest/Form1.Designer.vb b/ChatTest/Form1.Designer.vb new file mode 100644 index 00000000..20415f86 --- /dev/null +++ b/ChatTest/Form1.Designer.vb @@ -0,0 +1,49 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. + _ + 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. + _ + Private Sub InitializeComponent() + Me.ChatControl1 = New DigitalData.Controls.ChatControl.ChatControl() + Me.SuspendLayout() + ' + 'ChatControl1 + ' + Me.ChatControl1.Dock = System.Windows.Forms.DockStyle.Fill + Me.ChatControl1.Location = New System.Drawing.Point(0, 0) + Me.ChatControl1.Name = "ChatControl1" + Me.ChatControl1.Size = New System.Drawing.Size(397, 384) + Me.ChatControl1.TabIndex = 0 + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(397, 384) + Me.Controls.Add(Me.ChatControl1) + Me.Name = "Form1" + Me.Text = "Form1" + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents ChatControl1 As DigitalData.Controls.ChatControl.ChatControl +End Class diff --git a/ChatTest/Form1.resx b/ChatTest/Form1.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/ChatTest/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ChatTest/Form1.vb b/ChatTest/Form1.vb new file mode 100644 index 00000000..75c486cb --- /dev/null +++ b/ChatTest/Form1.vb @@ -0,0 +1,11 @@ +Imports DigitalData.Modules.Logging + +Public Class Form1 + Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load + Dim oLogConfig As New LogConfig(LogConfig.PathType.CustomPath, Application.StartupPath) + Dim oConnectionString = "Server=sDD-VMP04-SQL17\DD_DEVELOP01;Database=IDB_TEST;User Id=sa;Password=dd;" + + ChatControl1.Init(oLogConfig, oConnectionString, "JenneJ") + ChatControl1.LoadConversations(10070) + End Sub +End Class diff --git a/ChatTest/My Project/Application.Designer.vb b/ChatTest/My Project/Application.Designer.vb new file mode 100644 index 00000000..38f9a231 --- /dev/null +++ b/ChatTest/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global.ChatTest.Form1 + End Sub + End Class +End Namespace diff --git a/ChatTest/My Project/Application.myapp b/ChatTest/My Project/Application.myapp new file mode 100644 index 00000000..1243847f --- /dev/null +++ b/ChatTest/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/ChatTest/My Project/AssemblyInfo.vb b/ChatTest/My Project/AssemblyInfo.vb new file mode 100644 index 00000000..e68bf074 --- /dev/null +++ b/ChatTest/My Project/AssemblyInfo.vb @@ -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 + + + + + + + + + + +'Die folgende GUID wird für die typelib-ID verwendet, wenn dieses Projekt für COM verfügbar gemacht wird. + + +' 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: +' + + + diff --git a/ChatTest/My Project/Resources.Designer.vb b/ChatTest/My Project/Resources.Designer.vb new file mode 100644 index 00000000..f6ce9da5 --- /dev/null +++ b/ChatTest/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + _ + 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("ChatTest.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/ChatTest/My Project/Resources.resx b/ChatTest/My Project/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/ChatTest/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ChatTest/My Project/Settings.Designer.vb b/ChatTest/My Project/Settings.Designer.vb new file mode 100644 index 00000000..2b89d282 --- /dev/null +++ b/ChatTest/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + 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 "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal 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 + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.ChatTest.My.MySettings + Get + Return Global.ChatTest.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/ChatTest/My Project/Settings.settings b/ChatTest/My Project/Settings.settings new file mode 100644 index 00000000..85b890b3 --- /dev/null +++ b/ChatTest/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ChatTest/packages.config b/ChatTest/packages.config new file mode 100644 index 00000000..1baeaab3 --- /dev/null +++ b/ChatTest/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Controls.ChatControl/ChatControl.Designer.vb b/Controls.ChatControl/ChatControl.Designer.vb new file mode 100644 index 00000000..076018dd --- /dev/null +++ b/Controls.ChatControl/ChatControl.Designer.vb @@ -0,0 +1,305 @@ + _ +Partial Class ChatControl + Inherits System.Windows.Forms.UserControl + + 'UserControl1 überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. + _ + 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. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() + Dim ItemTemplate3 As DevExpress.XtraGrid.Views.Tile.ItemTemplate = New DevExpress.XtraGrid.Views.Tile.ItemTemplate() + Dim TableColumnDefinition7 As DevExpress.XtraEditors.TableLayout.TableColumnDefinition = New DevExpress.XtraEditors.TableLayout.TableColumnDefinition() + Dim TableColumnDefinition8 As DevExpress.XtraEditors.TableLayout.TableColumnDefinition = New DevExpress.XtraEditors.TableLayout.TableColumnDefinition() + Dim TileViewItemElement7 As DevExpress.XtraGrid.Views.Tile.TileViewItemElement = New DevExpress.XtraGrid.Views.Tile.TileViewItemElement() + Dim TileViewItemElement8 As DevExpress.XtraGrid.Views.Tile.TileViewItemElement = New DevExpress.XtraGrid.Views.Tile.TileViewItemElement() + Dim TileViewItemElement9 As DevExpress.XtraGrid.Views.Tile.TileViewItemElement = New DevExpress.XtraGrid.Views.Tile.TileViewItemElement() + Dim TableRowDefinition7 As DevExpress.XtraEditors.TableLayout.TableRowDefinition = New DevExpress.XtraEditors.TableLayout.TableRowDefinition() + Dim TableRowDefinition8 As DevExpress.XtraEditors.TableLayout.TableRowDefinition = New DevExpress.XtraEditors.TableLayout.TableRowDefinition() + Dim ItemTemplate4 As DevExpress.XtraGrid.Views.Tile.ItemTemplate = New DevExpress.XtraGrid.Views.Tile.ItemTemplate() + Dim TableColumnDefinition9 As DevExpress.XtraEditors.TableLayout.TableColumnDefinition = New DevExpress.XtraEditors.TableLayout.TableColumnDefinition() + Dim TableColumnDefinition10 As DevExpress.XtraEditors.TableLayout.TableColumnDefinition = New DevExpress.XtraEditors.TableLayout.TableColumnDefinition() + Dim TileViewItemElement10 As DevExpress.XtraGrid.Views.Tile.TileViewItemElement = New DevExpress.XtraGrid.Views.Tile.TileViewItemElement() + Dim TileViewItemElement11 As DevExpress.XtraGrid.Views.Tile.TileViewItemElement = New DevExpress.XtraGrid.Views.Tile.TileViewItemElement() + Dim TileViewItemElement12 As DevExpress.XtraGrid.Views.Tile.TileViewItemElement = New DevExpress.XtraGrid.Views.Tile.TileViewItemElement() + Dim TableRowDefinition9 As DevExpress.XtraEditors.TableLayout.TableRowDefinition = New DevExpress.XtraEditors.TableLayout.TableRowDefinition() + Dim TableRowDefinition10 As DevExpress.XtraEditors.TableLayout.TableRowDefinition = New DevExpress.XtraEditors.TableLayout.TableRowDefinition() + Dim TableColumnDefinition11 As DevExpress.XtraEditors.TableLayout.TableColumnDefinition = New DevExpress.XtraEditors.TableLayout.TableColumnDefinition() + Dim TableColumnDefinition12 As DevExpress.XtraEditors.TableLayout.TableColumnDefinition = New DevExpress.XtraEditors.TableLayout.TableColumnDefinition() + Dim TableRowDefinition11 As DevExpress.XtraEditors.TableLayout.TableRowDefinition = New DevExpress.XtraEditors.TableLayout.TableRowDefinition() + Dim TableRowDefinition12 As DevExpress.XtraEditors.TableLayout.TableRowDefinition = New DevExpress.XtraEditors.TableLayout.TableRowDefinition() + Dim EditorButtonImageOptions2 As DevExpress.XtraEditors.Controls.EditorButtonImageOptions = New DevExpress.XtraEditors.Controls.EditorButtonImageOptions() + Dim SerializableAppearanceObject5 As DevExpress.Utils.SerializableAppearanceObject = New DevExpress.Utils.SerializableAppearanceObject() + Dim SerializableAppearanceObject6 As DevExpress.Utils.SerializableAppearanceObject = New DevExpress.Utils.SerializableAppearanceObject() + Dim SerializableAppearanceObject7 As DevExpress.Utils.SerializableAppearanceObject = New DevExpress.Utils.SerializableAppearanceObject() + Dim SerializableAppearanceObject8 As DevExpress.Utils.SerializableAppearanceObject = New DevExpress.Utils.SerializableAppearanceObject() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(ChatControl)) + Me.columnUsername = New DevExpress.XtraGrid.Columns.TileViewColumn() + Me.columnMessage = New DevExpress.XtraGrid.Columns.TileViewColumn() + Me.columnDate = New DevExpress.XtraGrid.Columns.TileViewColumn() + Me.RepositoryItemHypertextLabel1 = New DevExpress.XtraEditors.Repository.RepositoryItemHypertextLabel() + Me.RepositoryItemHyperLinkEdit1 = New DevExpress.XtraEditors.Repository.RepositoryItemHyperLinkEdit() + Me.SplitContainerControl1 = New DevExpress.XtraEditors.SplitContainerControl() + Me.GridChat = New DevExpress.XtraGrid.GridControl() + Me.ChatView = New DevExpress.XtraGrid.Views.Tile.TileView() + Me.lookupConversations = New DigitalData.Controls.LookupGrid.LookupControl2() + Me.LookupControl21View = New DevExpress.XtraGrid.Views.Grid.GridView() + Me.txtMessage = New DevExpress.XtraEditors.MemoEdit() + Me.btnSendMessage = New DevExpress.XtraEditors.SimpleButton() + Me.ChatSource = New System.Windows.Forms.BindingSource(Me.components) + CType(Me.RepositoryItemHypertextLabel1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.RepositoryItemHyperLinkEdit1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SplitContainerControl1.SuspendLayout() + CType(Me.GridChat, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.ChatView, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.lookupConversations.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LookupControl21View, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.txtMessage.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.ChatSource, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'columnUsername + ' + Me.columnUsername.FieldName = "USER_FROM" + Me.columnUsername.Name = "columnUsername" + Me.columnUsername.Visible = True + Me.columnUsername.VisibleIndex = 1 + ' + 'columnMessage + ' + Me.columnMessage.FieldName = "MESSAGE_TEXT" + Me.columnMessage.Name = "columnMessage" + Me.columnMessage.Visible = True + Me.columnMessage.VisibleIndex = 0 + ' + 'columnDate + ' + Me.columnDate.FieldName = "ADDED_WHEN" + Me.columnDate.Name = "columnDate" + Me.columnDate.Visible = True + Me.columnDate.VisibleIndex = 2 + ' + 'RepositoryItemHypertextLabel1 + ' + Me.RepositoryItemHypertextLabel1.Name = "RepositoryItemHypertextLabel1" + ' + 'RepositoryItemHyperLinkEdit1 + ' + Me.RepositoryItemHyperLinkEdit1.AutoHeight = False + Me.RepositoryItemHyperLinkEdit1.Name = "RepositoryItemHyperLinkEdit1" + ' + 'SplitContainerControl1 + ' + Me.SplitContainerControl1.Dock = System.Windows.Forms.DockStyle.Fill + Me.SplitContainerControl1.FixedPanel = DevExpress.XtraEditors.SplitFixedPanel.Panel2 + Me.SplitContainerControl1.Horizontal = False + Me.SplitContainerControl1.IsSplitterFixed = True + Me.SplitContainerControl1.Location = New System.Drawing.Point(0, 0) + Me.SplitContainerControl1.Name = "SplitContainerControl1" + Me.SplitContainerControl1.Panel1.Controls.Add(Me.GridChat) + Me.SplitContainerControl1.Panel1.Controls.Add(Me.lookupConversations) + Me.SplitContainerControl1.Panel1.Text = "Panel1" + Me.SplitContainerControl1.Panel2.Controls.Add(Me.txtMessage) + Me.SplitContainerControl1.Panel2.Controls.Add(Me.btnSendMessage) + Me.SplitContainerControl1.Panel2.Text = "Panel2" + Me.SplitContainerControl1.Size = New System.Drawing.Size(317, 314) + Me.SplitContainerControl1.SplitterPosition = 50 + Me.SplitContainerControl1.TabIndex = 0 + ' + 'GridChat + ' + Me.GridChat.Dock = System.Windows.Forms.DockStyle.Fill + Me.GridChat.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.GridChat.Location = New System.Drawing.Point(0, 20) + Me.GridChat.MainView = Me.ChatView + Me.GridChat.Name = "GridChat" + Me.GridChat.RepositoryItems.AddRange(New DevExpress.XtraEditors.Repository.RepositoryItem() {Me.RepositoryItemHyperLinkEdit1, Me.RepositoryItemHypertextLabel1}) + Me.GridChat.Size = New System.Drawing.Size(317, 234) + Me.GridChat.TabIndex = 0 + Me.GridChat.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.ChatView}) + ' + 'ChatView + ' + Me.ChatView.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.columnMessage, Me.columnUsername, Me.columnDate}) + Me.ChatView.ContextButtonOptions.HoverStateOpacity = 0.75! + Me.ChatView.ContextButtonOptions.TopPanelColor = System.Drawing.Color.White + Me.ChatView.GridControl = Me.GridChat + Me.ChatView.Name = "ChatView" + Me.ChatView.OptionsTiles.ColumnCount = 1 + Me.ChatView.OptionsTiles.GroupTextPadding = New System.Windows.Forms.Padding(0, 8, 12, 8) + Me.ChatView.OptionsTiles.IndentBetweenGroups = 0 + Me.ChatView.OptionsTiles.IndentBetweenItems = 10 + Me.ChatView.OptionsTiles.ItemPadding = New System.Windows.Forms.Padding(0) + Me.ChatView.OptionsTiles.ItemSize = New System.Drawing.Size(374, 64) + Me.ChatView.OptionsTiles.LayoutMode = DevExpress.XtraGrid.Views.Tile.TileViewLayoutMode.Kanban + Me.ChatView.OptionsTiles.Orientation = System.Windows.Forms.Orientation.Vertical + Me.ChatView.OptionsTiles.Padding = New System.Windows.Forms.Padding(5) + Me.ChatView.OptionsTiles.RowCount = 0 + Me.ChatView.OptionsTiles.ScrollMode = DevExpress.XtraEditors.TileControlScrollMode.ScrollBar + TableColumnDefinition7.Length.Value = 250.0R + TableColumnDefinition8.Length.Value = 100.0R + ItemTemplate3.Columns.Add(TableColumnDefinition7) + ItemTemplate3.Columns.Add(TableColumnDefinition8) + TileViewItemElement7.Column = Me.columnUsername + TileViewItemElement7.ImageOptions.ImageAlignment = DevExpress.XtraEditors.TileItemContentAlignment.MiddleCenter + TileViewItemElement7.ImageOptions.ImageScaleMode = DevExpress.XtraEditors.TileItemImageScaleMode.ZoomInside + TileViewItemElement7.Text = "columnUsername" + TileViewItemElement7.TextAlignment = DevExpress.XtraEditors.TileItemContentAlignment.MiddleLeft + TileViewItemElement7.TextLocation = New System.Drawing.Point(10, 0) + TileViewItemElement8.Column = Me.columnMessage + TileViewItemElement8.ImageOptions.ImageAlignment = DevExpress.XtraEditors.TileItemContentAlignment.MiddleCenter + TileViewItemElement8.ImageOptions.ImageScaleMode = DevExpress.XtraEditors.TileItemImageScaleMode.ZoomInside + TileViewItemElement8.RowIndex = 1 + TileViewItemElement8.Text = "columnMessage" + TileViewItemElement8.TextAlignment = DevExpress.XtraEditors.TileItemContentAlignment.MiddleLeft + TileViewItemElement8.TextLocation = New System.Drawing.Point(10, 0) + TileViewItemElement9.Column = Me.columnDate + TileViewItemElement9.ColumnIndex = 1 + TileViewItemElement9.ImageOptions.ImageAlignment = DevExpress.XtraEditors.TileItemContentAlignment.MiddleCenter + TileViewItemElement9.ImageOptions.ImageScaleMode = DevExpress.XtraEditors.TileItemImageScaleMode.ZoomInside + TileViewItemElement9.Text = "columnDate" + TileViewItemElement9.TextAlignment = DevExpress.XtraEditors.TileItemContentAlignment.MiddleRight + TileViewItemElement9.TextLocation = New System.Drawing.Point(-10, 0) + ItemTemplate3.Elements.Add(TileViewItemElement7) + ItemTemplate3.Elements.Add(TileViewItemElement8) + ItemTemplate3.Elements.Add(TileViewItemElement9) + ItemTemplate3.Name = "ChatLeft" + TableRowDefinition7.Length.Value = 24.0R + TableRowDefinition8.Length.Value = 24.0R + ItemTemplate3.Rows.Add(TableRowDefinition7) + ItemTemplate3.Rows.Add(TableRowDefinition8) + TableColumnDefinition9.Length.Value = 100.0R + TableColumnDefinition10.Length.Value = 250.0R + ItemTemplate4.Columns.Add(TableColumnDefinition9) + ItemTemplate4.Columns.Add(TableColumnDefinition10) + TileViewItemElement10.Column = Me.columnUsername + TileViewItemElement10.ColumnIndex = 1 + TileViewItemElement10.ImageOptions.ImageAlignment = DevExpress.XtraEditors.TileItemContentAlignment.MiddleCenter + TileViewItemElement10.ImageOptions.ImageScaleMode = DevExpress.XtraEditors.TileItemImageScaleMode.ZoomInside + TileViewItemElement10.Text = "columnUsername" + TileViewItemElement10.TextAlignment = DevExpress.XtraEditors.TileItemContentAlignment.MiddleRight + TileViewItemElement10.TextLocation = New System.Drawing.Point(-10, 0) + TileViewItemElement11.Column = Me.columnMessage + TileViewItemElement11.ColumnIndex = 1 + TileViewItemElement11.ImageOptions.ImageAlignment = DevExpress.XtraEditors.TileItemContentAlignment.MiddleCenter + TileViewItemElement11.ImageOptions.ImageScaleMode = DevExpress.XtraEditors.TileItemImageScaleMode.ZoomInside + TileViewItemElement11.RowIndex = 1 + TileViewItemElement11.Text = "columnMessage" + TileViewItemElement11.TextAlignment = DevExpress.XtraEditors.TileItemContentAlignment.MiddleRight + TileViewItemElement11.TextLocation = New System.Drawing.Point(-10, 0) + TileViewItemElement12.Column = Me.columnDate + TileViewItemElement12.ImageOptions.ImageAlignment = DevExpress.XtraEditors.TileItemContentAlignment.MiddleCenter + TileViewItemElement12.ImageOptions.ImageScaleMode = DevExpress.XtraEditors.TileItemImageScaleMode.ZoomInside + TileViewItemElement12.Text = "columnDate" + TileViewItemElement12.TextAlignment = DevExpress.XtraEditors.TileItemContentAlignment.MiddleLeft + TileViewItemElement12.TextLocation = New System.Drawing.Point(10, 0) + ItemTemplate4.Elements.Add(TileViewItemElement10) + ItemTemplate4.Elements.Add(TileViewItemElement11) + ItemTemplate4.Elements.Add(TileViewItemElement12) + ItemTemplate4.Name = "ChatRight" + TableRowDefinition9.Length.Value = 24.0R + TableRowDefinition10.Length.Value = 24.0R + ItemTemplate4.Rows.Add(TableRowDefinition9) + ItemTemplate4.Rows.Add(TableRowDefinition10) + Me.ChatView.Templates.Add(ItemTemplate3) + Me.ChatView.Templates.Add(ItemTemplate4) + Me.ChatView.TileColumns.Add(TableColumnDefinition11) + Me.ChatView.TileColumns.Add(TableColumnDefinition12) + Me.ChatView.TileRows.Add(TableRowDefinition11) + Me.ChatView.TileRows.Add(TableRowDefinition12) + ' + 'lookupConversations + ' + Me.lookupConversations.AllowAddNewValues = False + Me.lookupConversations.DataSource = Nothing + Me.lookupConversations.Dock = System.Windows.Forms.DockStyle.Top + Me.lookupConversations.Location = New System.Drawing.Point(0, 0) + Me.lookupConversations.MultiSelect = False + Me.lookupConversations.Name = "lookupConversations" + Me.lookupConversations.PreventDuplicates = False + Me.lookupConversations.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Ellipsis, "", -1, True, True, False, EditorButtonImageOptions2, New DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), SerializableAppearanceObject5, SerializableAppearanceObject6, SerializableAppearanceObject7, SerializableAppearanceObject8, "", "openLookupForm", Nothing, DevExpress.Utils.ToolTipAnchor.[Default])}) + Me.lookupConversations.Properties.NullText = "" + Me.lookupConversations.Properties.PopupView = Me.LookupControl21View + Me.lookupConversations.SelectedValues = CType(resources.GetObject("lookupConversations.SelectedValues"), System.Collections.Generic.List(Of String)) + Me.lookupConversations.Size = New System.Drawing.Size(317, 20) + Me.lookupConversations.TabIndex = 1 + ' + 'LookupControl21View + ' + Me.LookupControl21View.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus + Me.LookupControl21View.Name = "LookupControl21View" + Me.LookupControl21View.OptionsSelection.EnableAppearanceFocusedCell = False + Me.LookupControl21View.OptionsView.ShowGroupPanel = False + ' + 'txtMessage + ' + Me.txtMessage.Dock = System.Windows.Forms.DockStyle.Fill + Me.txtMessage.Location = New System.Drawing.Point(0, 0) + Me.txtMessage.Name = "txtMessage" + Me.txtMessage.Properties.Appearance.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.txtMessage.Properties.Appearance.Options.UseFont = True + Me.txtMessage.Size = New System.Drawing.Size(275, 50) + Me.txtMessage.TabIndex = 1 + ' + 'btnSendMessage + ' + Me.btnSendMessage.Dock = System.Windows.Forms.DockStyle.Right + Me.btnSendMessage.ImageOptions.Location = DevExpress.XtraEditors.ImageLocation.MiddleCenter + Me.btnSendMessage.ImageOptions.SvgImage = CType(resources.GetObject("btnSendMessage.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) + Me.btnSendMessage.Location = New System.Drawing.Point(275, 0) + Me.btnSendMessage.Name = "btnSendMessage" + Me.btnSendMessage.PaintStyle = DevExpress.XtraEditors.Controls.PaintStyles.Light + Me.btnSendMessage.Size = New System.Drawing.Size(42, 50) + Me.btnSendMessage.TabIndex = 2 + ' + 'ChatControl + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.SplitContainerControl1) + Me.Name = "ChatControl" + Me.Size = New System.Drawing.Size(317, 314) + CType(Me.RepositoryItemHypertextLabel1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.RepositoryItemHyperLinkEdit1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).EndInit() + Me.SplitContainerControl1.ResumeLayout(False) + CType(Me.GridChat, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.ChatView, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.lookupConversations.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LookupControl21View, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.txtMessage.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.ChatSource, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents SplitContainerControl1 As DevExpress.XtraEditors.SplitContainerControl + Friend WithEvents GridChat As DevExpress.XtraGrid.GridControl + Friend WithEvents ChatView As DevExpress.XtraGrid.Views.Tile.TileView + Friend WithEvents txtMessage As DevExpress.XtraEditors.MemoEdit + Friend WithEvents columnMessage As DevExpress.XtraGrid.Columns.TileViewColumn + Friend WithEvents columnUsername As DevExpress.XtraGrid.Columns.TileViewColumn + Friend WithEvents columnDate As DevExpress.XtraGrid.Columns.TileViewColumn + Friend WithEvents ChatSource As BindingSource + Friend WithEvents lookupConversations As LookupGrid.LookupControl2 + Friend WithEvents LookupControl21View As DevExpress.XtraGrid.Views.Grid.GridView + Friend WithEvents btnSendMessage As DevExpress.XtraEditors.SimpleButton + Friend WithEvents RepositoryItemHyperLinkEdit1 As DevExpress.XtraEditors.Repository.RepositoryItemHyperLinkEdit + Friend WithEvents RepositoryItemHypertextLabel1 As DevExpress.XtraEditors.Repository.RepositoryItemHypertextLabel +End Class diff --git a/Controls.ChatControl/ChatControl.resx b/Controls.ChatControl/ChatControl.resx new file mode 100644 index 00000000..9a8cb1e0 --- /dev/null +++ b/Controls.ChatControl/ChatControl.resx @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAJoBbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1u + ZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0sIG1zY29ybGliLCBWZXJzaW9u + PTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUB + AAAAMFN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbU3lzdGVtLlN0cmluZwMAAAAGX2l0 + ZW1zBV9zaXplCF92ZXJzaW9uBgAACAgCAAAACQMAAAAAAAAAAAAAABEDAAAAAAAAAAs= + + + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z + LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl + dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAALcBAAAC77u/ + PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi + IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv + MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh + Y2U9InByZXNlcnZlIiBpZD0iTmV4dCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMzIg + MzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsdWV7ZmlsbDojMTE3N0Q3O30KPC9zdHls + ZT4NCiAgPHBhdGggZD0iTTguOSw0LjFDOC40LDMuOCw4LDQuMSw4LDQuNnYyMC43YzAsMC42LDAuNCww + LjgsMC45LDAuNWwxNi44LTEwLjNjMC41LTAuMywwLjUtMC44LDAtMS4xTDguOSw0LjF6IiBjbGFzcz0i + Qmx1ZSIgLz4NCjwvc3ZnPgs= + + + + 17, 17 + + \ No newline at end of file diff --git a/Controls.ChatControl/ChatControl.vb b/Controls.ChatControl/ChatControl.vb new file mode 100644 index 00000000..86c29b3d --- /dev/null +++ b/Controls.ChatControl/ChatControl.vb @@ -0,0 +1,125 @@ +Imports DevExpress.XtraGrid.Views.Tile +Imports DigitalData.Modules.Database +Imports DigitalData.Modules.Logging + +Public Class ChatControl + Private ReadOnly IdColumn As String = "GUID" + Private ReadOnly UsernameColumn As String = "USER_FROM" + Private ReadOnly MessageColumn As String = "MESSAGE_TEXT" + Private ReadOnly DateColumn As String = "ADDED_WHEN" + + Private Db As MSSQLServer + Private LogConfig As LogConfig + Private Logger As Logger + + Private ReadOnly UsernameColorsDict As New Dictionary(Of String, Color) + Private ReadOnly UsernameColors As New List(Of Color) From { + Color.Purple, + Color.Red, + Color.LightBlue, + Color.DarkSeaGreen + } + + Public IDBObjectId As Long + Public ConnectionString As String + Public CurrentUser As String + Public CurrentConversation As Long + + Public Sub New() + InitializeComponent() + End Sub + + Public Sub Init(LogConfig As LogConfig, ConnectionString As String, CurrentUser As String) + Me.LogConfig = LogConfig + Me.Logger = LogConfig.GetLogger() + Me.ConnectionString = ConnectionString + Me.CurrentUser = CurrentUser + Me.Db = New MSSQLServer(LogConfig, ConnectionString) + End Sub + + Public Sub LoadConversations(IDBObjectId As Long) + Dim oSQL As String = $"SELECT * FROM VWIDB_CONVERSATION WHERE IDB_OBJ_ID = {IDBObjectId}" + Dim oDatatable As DataTable = Db.GetDatatable(oSQL) + + lookupConversations.DataSource = oDatatable + End Sub + + Public Sub LoadConversation(ConversationId As Long) + Dim oSQL As String = $"SELECT * FROM VWIDB_CONV_MESSAGES WHERE CONV_ID = {ConversationId} ORDER BY GUID" + Dim oDatatable As DataTable = Db.GetDatatable(oSQL) + + BuildUsernameColorDict(oDatatable) + + GridChat.DataSource = ChatSource + ChatSource.DataSource = oDatatable + End Sub + + Public Sub SendMessage(MessageText As String) + Try + Dim oSQL As String = $"EXEC [PRIDB_NEW_CONVERSATION_MESSAGE] {CurrentConversation},'{MessageText}', '{CurrentUser}'" + Dim oResult = Db.GetScalarValue(oSQL) + LoadConversation(CurrentConversation) + txtMessage.Text = String.Empty + Catch ex As Exception + Logger.Error(ex) + End Try + End Sub + + Private Sub BuildUsernameColorDict(Datatable As DataTable) + Dim oIndex = 0 + + UsernameColorsDict.Clear() + + Datatable.AsEnumerable(). + Select(Function(Row) Row.Item(UsernameColumn)). + Distinct().ToList(). + ForEach(Sub(Name) + UsernameColorsDict.Add(Name, UsernameColors.Item(oIndex)) + oIndex += 1 + End Sub) + End Sub + + Private Sub ChatView_CustomItemTemplate(sender As Object, e As TileViewCustomItemTemplateEventArgs) Handles ChatView.CustomItemTemplate + Dim oRow As DataRow = ChatView.GetDataRow(e.RowHandle) + Dim oUsername As String = oRow.Item(UsernameColumn) + + If oUsername = CurrentUser Then + e.Template = e.Templates.Item("ChatRight") + Else + e.Template = e.Templates.Item("ChatLeft") + End If + End Sub + + Private Sub ChatView_ItemCustomize(sender As Object, e As TileViewItemCustomizeEventArgs) Handles ChatView.ItemCustomize + Dim oRow As DataRow = ChatView.GetDataRow(e.RowHandle) + + Dim oUsername As String = oRow.Item(UsernameColumn) + Dim oMessage As String = oRow.Item(MessageColumn) + Dim oColor As Color = UsernameColorsDict.Item(oUsername) + + If oUsername = CurrentUser Then + e.Item.AppearanceItem.Normal.BackColor = Color.PaleTurquoise + End If + e.Item.AppearanceItem.Focused.BackColor = Color.Turquoise + e.Item.Item(UsernameColumn).Appearance.Normal.ForeColor = oColor + End Sub + + Private Sub lookupConversations_SelectedValuesChanged(sender As Object, SelectedValues As List(Of String)) Handles lookupConversations.SelectedValuesChanged + If SelectedValues.Count > 0 Then + CurrentConversation = SelectedValues.First() + LoadConversation(CurrentConversation) + End If + End Sub + + Private Sub txtMessage_KeyUp(sender As Object, e As KeyEventArgs) Handles txtMessage.KeyUp + If e.Control And e.KeyCode = Keys.Enter And txtMessage.Text.Count > 0 Then + SendMessage(txtMessage.Text) + End If + End Sub + + Private Sub SimpleButton1_Click(sender As Object, e As EventArgs) Handles btnSendMessage.Click + If txtMessage.Text.Count > 0 Then + SendMessage(txtMessage.Text) + End If + End Sub +End Class diff --git a/Controls.ChatControl/ChatControl.vbproj b/Controls.ChatControl/ChatControl.vbproj new file mode 100644 index 00000000..c4399c50 --- /dev/null +++ b/Controls.ChatControl/ChatControl.vbproj @@ -0,0 +1,157 @@ + + + + + Debug + AnyCPU + {1F278760-4F6B-42E8-B82D-01D4C8618340} + Library + DigitalData.Controls.ChatControl + DigitalData.Controls.ChatControl + 512 + Windows + v4.7.2 + true + + + true + full + true + true + bin\Debug\ + DigitalData.Controls.ChatControl.xml + _MYFORMS=True + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + DigitalData.Controls.ChatControl.xml + _MYFORMS=True + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + + + + + + + + + ..\Controls.LookupGrid\obj\Debug\DigitalData.Controls.LookupGrid.dll + + + + ..\packages\NLog.4.7.2\lib\net45\NLog.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + Application.myapp + + + UserControl + + + ChatControl.vb + + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + ChatControl.vb + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + + + + {eaf0ea75-5fa7-485d-89c7-b2d843b03a96} + Database + + + {903b2d7d-3b80-4be9-8713-7447b704e1b0} + Logging + + + + \ No newline at end of file diff --git a/Controls.ChatControl/My Project/Application.Designer.vb b/Controls.ChatControl/My Project/Application.Designer.vb new file mode 100644 index 00000000..8ab460ba --- /dev/null +++ b/Controls.ChatControl/My Project/Application.Designer.vb @@ -0,0 +1,13 @@ +'------------------------------------------------------------------------------ +' +' 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. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + diff --git a/Controls.ChatControl/My Project/Application.myapp b/Controls.ChatControl/My Project/Application.myapp new file mode 100644 index 00000000..758895de --- /dev/null +++ b/Controls.ChatControl/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + false + false + 0 + true + 0 + 1 + true + diff --git a/Controls.ChatControl/My Project/AssemblyInfo.vb b/Controls.ChatControl/My Project/AssemblyInfo.vb new file mode 100644 index 00000000..f71c7e93 --- /dev/null +++ b/Controls.ChatControl/My Project/AssemblyInfo.vb @@ -0,0 +1,34 @@ +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 + + + + + + + + + + +'Die folgende GUID wird für die typelib-ID verwendet, wenn dieses Projekt für COM verfügbar gemacht wird. + + +' 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: + + + diff --git a/Controls.ChatControl/My Project/Resources.Designer.vb b/Controls.ChatControl/My Project/Resources.Designer.vb new file mode 100644 index 00000000..150629e8 --- /dev/null +++ b/Controls.ChatControl/My Project/Resources.Designer.vb @@ -0,0 +1,63 @@ +'------------------------------------------------------------------------------ +' +' 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. +' +'------------------------------------------------------------------------------ + +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. + ''' + ''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + ''' + _ + 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.ChatControl.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + ''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/Controls.ChatControl/My Project/Resources.resx b/Controls.ChatControl/My Project/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/Controls.ChatControl/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Controls.ChatControl/My Project/Settings.Designer.vb b/Controls.ChatControl/My Project/Settings.Designer.vb new file mode 100644 index 00000000..7e6d6ee8 --- /dev/null +++ b/Controls.ChatControl/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' 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. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + 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 + + _ + 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 + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.DigitalData.Controls.ChatControl.My.MySettings + Get + Return Global.DigitalData.Controls.ChatControl.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/Controls.ChatControl/My Project/Settings.settings b/Controls.ChatControl/My Project/Settings.settings new file mode 100644 index 00000000..85b890b3 --- /dev/null +++ b/Controls.ChatControl/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Controls.ChatControl/My Project/licenses.licx b/Controls.ChatControl/My Project/licenses.licx new file mode 100644 index 00000000..d2ccec98 --- /dev/null +++ b/Controls.ChatControl/My Project/licenses.licx @@ -0,0 +1,3 @@ +DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.LookUpEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a diff --git a/Controls.ChatControl/packages.config b/Controls.ChatControl/packages.config new file mode 100644 index 00000000..1baeaab3 --- /dev/null +++ b/Controls.ChatControl/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Controls.DocumentViewer/DocumentViewer.vbproj b/Controls.DocumentViewer/DocumentViewer.vbproj index bd715555..42665861 100644 --- a/Controls.DocumentViewer/DocumentViewer.vbproj +++ b/Controls.DocumentViewer/DocumentViewer.vbproj @@ -78,7 +78,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll diff --git a/Controls.DocumentViewer/packages.config b/Controls.DocumentViewer/packages.config index d7bc5b9d..f8dbc83e 100644 --- a/Controls.DocumentViewer/packages.config +++ b/Controls.DocumentViewer/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/DDMonorepo.sln b/DDMonorepo.sln index 14fb2b72..efc29723 100644 --- a/DDMonorepo.sln +++ b/DDMonorepo.sln @@ -114,6 +114,14 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DDEDMLicenseService", "Serv EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "GUIs.Test.EDMIBenchmark", "GUIs.Test.EDMIBenchmark\GUIs.Test.EDMIBenchmark.vbproj", "{5FDEC007-7AE0-4829-B1AE-6165E29375DA}" EndProject +Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "ChatServer", "ChatServer\ChatServer.vbproj", "{C8F9C3DD-9328-49E3-8530-48E6A4C82CAF}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ChatClient", "ChatClient\ChatClient.vbproj", "{9713484C-6EE3-4D7E-B6E6-F32CF6B6BB6C}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ChatControl", "Controls.ChatControl\ChatControl.vbproj", "{1F278760-4F6B-42E8-B82D-01D4C8618340}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ChatTest", "ChatTest\ChatTest.vbproj", "{4A726345-FD6B-4E1C-9E5D-18C9043D7714}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -296,6 +304,22 @@ Global {5FDEC007-7AE0-4829-B1AE-6165E29375DA}.Debug|Any CPU.Build.0 = Debug|Any CPU {5FDEC007-7AE0-4829-B1AE-6165E29375DA}.Release|Any CPU.ActiveCfg = Release|Any CPU {5FDEC007-7AE0-4829-B1AE-6165E29375DA}.Release|Any CPU.Build.0 = Release|Any CPU + {C8F9C3DD-9328-49E3-8530-48E6A4C82CAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C8F9C3DD-9328-49E3-8530-48E6A4C82CAF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C8F9C3DD-9328-49E3-8530-48E6A4C82CAF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C8F9C3DD-9328-49E3-8530-48E6A4C82CAF}.Release|Any CPU.Build.0 = Release|Any CPU + {9713484C-6EE3-4D7E-B6E6-F32CF6B6BB6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9713484C-6EE3-4D7E-B6E6-F32CF6B6BB6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9713484C-6EE3-4D7E-B6E6-F32CF6B6BB6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9713484C-6EE3-4D7E-B6E6-F32CF6B6BB6C}.Release|Any CPU.Build.0 = Release|Any CPU + {1F278760-4F6B-42E8-B82D-01D4C8618340}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F278760-4F6B-42E8-B82D-01D4C8618340}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F278760-4F6B-42E8-B82D-01D4C8618340}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F278760-4F6B-42E8-B82D-01D4C8618340}.Release|Any CPU.Build.0 = Release|Any CPU + {4A726345-FD6B-4E1C-9E5D-18C9043D7714}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4A726345-FD6B-4E1C-9E5D-18C9043D7714}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4A726345-FD6B-4E1C-9E5D-18C9043D7714}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4A726345-FD6B-4E1C-9E5D-18C9043D7714}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -345,6 +369,10 @@ Global {7DEEC36E-EA5F-4711-AD1E-FD8894F4AD77} = {7AF3F9C2-C939-4A08-95C1-0453207E298A} {CBE9322E-67A1-4CC5-B25F-4A1B4C9FC55C} = {7AF3F9C2-C939-4A08-95C1-0453207E298A} {5FDEC007-7AE0-4829-B1AE-6165E29375DA} = {CC368D6A-6AC4-4EB9-A092-14700FABEF7A} + {C8F9C3DD-9328-49E3-8530-48E6A4C82CAF} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC} + {9713484C-6EE3-4D7E-B6E6-F32CF6B6BB6C} = {CC368D6A-6AC4-4EB9-A092-14700FABEF7A} + {1F278760-4F6B-42E8-B82D-01D4C8618340} = {F98C0329-C004-417F-B2AB-7466E88D8220} + {4A726345-FD6B-4E1C-9E5D-18C9043D7714} = {CC368D6A-6AC4-4EB9-A092-14700FABEF7A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C1BE4090-A0FD-48AF-86CB-39099D14B286} diff --git a/EDMI.File/EDMI.File.vbproj b/EDMI.File/EDMI.File.vbproj index 10093658..8395d3ae 100644 --- a/EDMI.File/EDMI.File.vbproj +++ b/EDMI.File/EDMI.File.vbproj @@ -46,7 +46,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll diff --git a/EDMI.File/packages.config b/EDMI.File/packages.config index ef1d1ab0..1baeaab3 100644 --- a/EDMI.File/packages.config +++ b/EDMI.File/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/GUIs.ClipboardWatcher/ClipboardWatcher.vbproj b/GUIs.ClipboardWatcher/ClipboardWatcher.vbproj index 0ed02c9e..1889a576 100644 --- a/GUIs.ClipboardWatcher/ClipboardWatcher.vbproj +++ b/GUIs.ClipboardWatcher/ClipboardWatcher.vbproj @@ -6,8 +6,8 @@ AnyCPU {B7D465A2-AE31-4CDF-A8B2-34B42D3EA84E} Library - DigitalData.Modules.ClipboardWatcher - DigitalData.Modules.ClipboardWatcher + DigitalData.GUIs.ClipboardWatcher + DigitalData.GUIs.ClipboardWatcher 512 Windows v4.6.1 @@ -18,7 +18,7 @@ true true bin\Debug\ - DigitalData.Modules.ClipboardWatcher.xml + DigitalData.GUIs.ClipboardWatcher.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 @@ -27,7 +27,7 @@ true true bin\Release\ - DigitalData.Modules.ClipboardWatcher.xml + DigitalData.GUIs.ClipboardWatcher.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 @@ -55,7 +55,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll diff --git a/GUIs.ClipboardWatcher/My Project/Resources.Designer.vb b/GUIs.ClipboardWatcher/My Project/Resources.Designer.vb index 1fdfc6b9..36236405 100644 --- a/GUIs.ClipboardWatcher/My Project/Resources.Designer.vb +++ b/GUIs.ClipboardWatcher/My Project/Resources.Designer.vb @@ -22,7 +22,7 @@ Namespace My.Resources ''' ''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. ''' - _ @@ -39,7 +39,7 @@ Namespace My.Resources 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.Modules.ClipboardWatcher.Resources", GetType(Resources).Assembly) + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("DigitalData.GUIs.ClipboardWatcher.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan diff --git a/GUIs.ClipboardWatcher/My Project/Settings.Designer.vb b/GUIs.ClipboardWatcher/My Project/Settings.Designer.vb index 392c3d68..58785339 100644 --- a/GUIs.ClipboardWatcher/My Project/Settings.Designer.vb +++ b/GUIs.ClipboardWatcher/My Project/Settings.Designer.vb @@ -15,7 +15,7 @@ Option Explicit On Namespace My _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase @@ -64,9 +64,9 @@ Namespace My Friend Module MySettingsProperty _ - Friend ReadOnly Property Settings() As Global.DigitalData.Modules.ClipboardWatcher.My.MySettings + Friend ReadOnly Property Settings() As Global.DigitalData.GUIs.ClipboardWatcher.My.MySettings Get - Return Global.DigitalData.Modules.ClipboardWatcher.My.MySettings.Default + Return Global.DigitalData.GUIs.ClipboardWatcher.My.MySettings.Default End Get End Property End Module diff --git a/GUIs.ClipboardWatcher/My Project/licenses.licx b/GUIs.ClipboardWatcher/My Project/licenses.licx index e69de29b..df67c51b 100644 --- a/GUIs.ClipboardWatcher/My Project/licenses.licx +++ b/GUIs.ClipboardWatcher/My Project/licenses.licx @@ -0,0 +1 @@ +DevExpress.XtraEditors.TileControl, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a diff --git a/GUIs.ClipboardWatcher/ProfileSearches.vb b/GUIs.ClipboardWatcher/ProfileSearches.vb index 1533e402..d26f1c69 100644 --- a/GUIs.ClipboardWatcher/ProfileSearches.vb +++ b/GUIs.ClipboardWatcher/ProfileSearches.vb @@ -1,5 +1,7 @@ -Imports DigitalData.Modules.Logging +Imports DigitalData.Modules.Database +Imports DigitalData.Modules.Logging Imports DigitalData.Modules.ZooFlow +Imports DigitalData.Modules.Patterns Public Class ProfileSearches Private _LogConfig As LogConfig @@ -34,7 +36,7 @@ Public Class ProfileSearches Dim oSearchesDataTable = _Environment.Database.GetDatatable(oSQL) Dim oDocSearches As New List(Of Search) Dim oCounter As Integer = 0 - Dim oPatterns As New Patterns.ClassPatterns(_LogConfig) + Dim oPatterns As New ClassPatterns(_LogConfig) For Each oRow As DataRow In oSearchesDataTable.Rows Dim oProfileId As Integer = oRow.Item("PROFILE_ID") @@ -47,7 +49,8 @@ Public Class ProfileSearches oSQL = oPatterns.ReplaceInternalValues(oSQL) oSQL = oPatterns.ReplaceClipboardContents(oSQL, _Params.ClipboardContents) - Dim oDatatable As DataTable = _Environment.Database.GetDatatable(oSQL, oConnectionId) + Dim oConnectionString = GetConnectionString(oConnectionId) + Dim oDatatable As DataTable = _Environment.Database.GetDatatableWithConnection(oSQL, oConnectionString) If oDatatable Is Nothing Then _Logger.Warn("Error in SQL-Query '{0}'", oSQL) @@ -69,6 +72,26 @@ Public Class ProfileSearches Return oDocSearches End Function + Private Function GetConnectionString(ConnectionId As Integer) As String + Dim oDatatable As DataTable = _Environment.Database.GetDatatable($"SELECT * FROM TBDD_CONNECTION WHERE GUID = {ConnectionId}") + + If oDatatable.Rows.Count > 0 Then + Dim oRow As DataRow = oDatatable.Rows.Item(0) + + Select Case oRow.Item("SQL_PROVIDER") + Case "MS-SQL" + Dim oConnectionString = MSSQLServer.GetConnectionString(oRow.Item("SERVER"), oRow.Item("DATENBANK"), oRow.Item("USERNAME"), oRow.Item("PASSWORD")) + Return oConnectionString + + Case Else + Return Nothing + + End Select + Else + Return Nothing + End If + End Function + Public Async Function LoadDataSearchesAsync(ProfileId As Integer) As Task(Of List(Of Search)) Return Await Task.Run(Function() Return DoLoadDataSearches(ProfileId) @@ -83,7 +106,7 @@ Public Class ProfileSearches Dim oSearchesDataTable = _Environment.Database.GetDatatable(oSQL) Dim oCounter As Integer = 0 - Dim oPatterns As New Patterns.ClassPatterns(_LogConfig) + Dim oPatterns As New ClassPatterns(_LogConfig) For Each oRow As DataRow In oSearchesDataTable.Rows Try @@ -95,7 +118,8 @@ Public Class ProfileSearches oSQL = oPatterns.ReplaceUserValues(oSQL, _Environment.User) oSQL = oPatterns.ReplaceInternalValues(oSQL) - Dim oDatatable As DataTable = _Environment.Database.GetDatatable(oSQL, oConnectionId) + Dim oConnectionString = GetConnectionString(oConnectionId) + Dim oDatatable As DataTable = _Environment.Database.GetDatatableWithConnection(oSQL, oConnectionString) If oDatatable Is Nothing Then _Logger.Warn("Error in SQL-Query '{0}'", oSQL) diff --git a/GUIs.ClipboardWatcher/frmMatch.vb b/GUIs.ClipboardWatcher/frmMatch.vb index 0f0b1767..f9b47583 100644 --- a/GUIs.ClipboardWatcher/frmMatch.vb +++ b/GUIs.ClipboardWatcher/frmMatch.vb @@ -7,6 +7,7 @@ Imports DigitalData.Modules.Windows Imports DigitalData.Modules.Language Imports DigitalData.Modules.ZooFlow Imports DigitalData.Modules.ZooFlow.Params +Imports DigitalData.Modules ''' ''' diff --git a/GUIs.ClipboardWatcher/packages.config b/GUIs.ClipboardWatcher/packages.config index d7bc5b9d..f8dbc83e 100644 --- a/GUIs.ClipboardWatcher/packages.config +++ b/GUIs.ClipboardWatcher/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/GUIs.Common/Common.vbproj b/GUIs.Common/Common.vbproj index 7a944000..e61036dd 100644 --- a/GUIs.Common/Common.vbproj +++ b/GUIs.Common/Common.vbproj @@ -62,7 +62,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll diff --git a/GUIs.Common/packages.config b/GUIs.Common/packages.config index d7bc5b9d..f8dbc83e 100644 --- a/GUIs.Common/packages.config +++ b/GUIs.Common/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Modules.Config/Config.vbproj b/Modules.Config/Config.vbproj index f1023808..4db9e89f 100644 --- a/Modules.Config/Config.vbproj +++ b/Modules.Config/Config.vbproj @@ -45,7 +45,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll diff --git a/Modules.Config/packages.config b/Modules.Config/packages.config index d7bc5b9d..f8dbc83e 100644 --- a/Modules.Config/packages.config +++ b/Modules.Config/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Modules.Database/Database.vbproj b/Modules.Database/Database.vbproj index 46730ac9..b9ae8073 100644 --- a/Modules.Database/Database.vbproj +++ b/Modules.Database/Database.vbproj @@ -59,7 +59,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll P:\Visual Studio Projekte\Bibliotheken\Oracle.ManagedDataAccess.dll diff --git a/Modules.Database/MSSQLServer.vb b/Modules.Database/MSSQLServer.vb index 381de4ba..32c33efb 100644 --- a/Modules.Database/MSSQLServer.vb +++ b/Modules.Database/MSSQLServer.vb @@ -51,8 +51,12 @@ Public Class MSSQLServer End Function Private Function TestCanConnect() As Boolean + Return TestCanConnect(CurrentSQLConnectionString) + End Function + + Private Function TestCanConnect(ConnectionString As String) As Boolean Try - Dim oConnection As New SqlConnection(CurrentSQLConnectionString) + Dim oConnection As New SqlConnection(ConnectionString) oConnection.Open() oConnection.Close() Return True @@ -63,13 +67,17 @@ Public Class MSSQLServer End Function Private Function GetSQLConnection() As SqlConnection + Return GetSQLConnection(CurrentSQLConnectionString) + End Function + + Private Function GetSQLConnection(ConnectionString As String) As SqlConnection Try - Dim oBuilder As New SqlConnectionStringBuilder() With {.ConnectionString = CurrentSQLConnectionString} - Dim oConnection As New SqlConnection(CurrentSQLConnectionString) + Dim oBuilder As New SqlConnectionStringBuilder() With {.ConnectionString = ConnectionString} + Dim oConnection As New SqlConnection(ConnectionString) oConnection.Open() Try - Dim oConnectionString = CurrentSQLConnectionString.Replace(oBuilder.Password, "XXXXX") + Dim oConnectionString = ConnectionString.Replace(oBuilder.Password, "XXXXX") _Logger.Debug($"Following Connectionstring is open: {oConnectionString}") Catch ex As Exception End Try @@ -117,6 +125,32 @@ Public Class MSSQLServer Return GetDatatable(SqlCommand, _Timeout) End Function + Public Function GetDatatableWithConnection(SqlCommand As String, ConnectionString As String) As DataTable + Try + If TestCanConnect(ConnectionString) = False Then + Return Nothing + End If + + _Logger.Debug("Running Query: {0}", SqlCommand) + + Using oConnection = GetSQLConnection(ConnectionString) + Using oSQLCOmmand = oConnection.CreateCommand() + oSQLCOmmand.CommandText = SqlCommand + oSQLCOmmand.CommandTimeout = _Timeout + + Dim dt As DataTable = New DataTable() + Dim oAdapter As SqlDataAdapter = New SqlDataAdapter(oSQLCOmmand) + oAdapter.Fill(dt) + Return dt + End Using + End Using + Catch ex As Exception + _Logger.Error(ex) + _Logger.Warn("sqlcommand: " & SqlCommand) + Return Nothing + End Try + End Function + ''' ''' Executes the passed sql-statement ''' diff --git a/Modules.Database/My Project/AssemblyInfo.vb b/Modules.Database/My Project/AssemblyInfo.vb index 01b3eda0..ef24c784 100644 --- a/Modules.Database/My Project/AssemblyInfo.vb +++ b/Modules.Database/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - + diff --git a/Modules.Database/packages.config b/Modules.Database/packages.config index f80f30ec..7fffa742 100644 --- a/Modules.Database/packages.config +++ b/Modules.Database/packages.config @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/Modules.EDMIAPI/EDMI.API.vbproj b/Modules.EDMIAPI/EDMI.API.vbproj index 6880d2de..db21be8f 100644 --- a/Modules.EDMIAPI/EDMI.API.vbproj +++ b/Modules.EDMIAPI/EDMI.API.vbproj @@ -45,7 +45,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll diff --git a/Modules.EDMIAPI/packages.config b/Modules.EDMIAPI/packages.config index c1fd79a0..f8dbc83e 100644 --- a/Modules.EDMIAPI/packages.config +++ b/Modules.EDMIAPI/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Modules.Filesystem/Filesystem.vbproj b/Modules.Filesystem/Filesystem.vbproj index 8f1e83fc..6bafb245 100644 --- a/Modules.Filesystem/Filesystem.vbproj +++ b/Modules.Filesystem/Filesystem.vbproj @@ -45,7 +45,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll ..\packages\protobuf-net.2.4.0\lib\net40\protobuf-net.dll diff --git a/Modules.Filesystem/packages.config b/Modules.Filesystem/packages.config index f6c8c5a4..f3a378b6 100644 --- a/Modules.Filesystem/packages.config +++ b/Modules.Filesystem/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/Modules.Interfaces/Interfaces.vbproj b/Modules.Interfaces/Interfaces.vbproj index e40f1254..a9bd218a 100644 --- a/Modules.Interfaces/Interfaces.vbproj +++ b/Modules.Interfaces/Interfaces.vbproj @@ -51,7 +51,7 @@ ..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll diff --git a/Modules.Interfaces/packages.config b/Modules.Interfaces/packages.config index 09a6f4d1..09e512cd 100644 --- a/Modules.Interfaces/packages.config +++ b/Modules.Interfaces/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/Modules.Jobs/Jobs.vbproj b/Modules.Jobs/Jobs.vbproj index 8b7daa08..c809d6e9 100644 --- a/Modules.Jobs/Jobs.vbproj +++ b/Modules.Jobs/Jobs.vbproj @@ -118,7 +118,7 @@ ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll diff --git a/Modules.Jobs/packages.config b/Modules.Jobs/packages.config index c6e89356..6447395e 100644 --- a/Modules.Jobs/packages.config +++ b/Modules.Jobs/packages.config @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/Modules.Language/Language.vbproj b/Modules.Language/Language.vbproj index 5181b529..ffffd8d2 100644 --- a/Modules.Language/Language.vbproj +++ b/Modules.Language/Language.vbproj @@ -45,7 +45,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll diff --git a/Modules.Language/packages.config b/Modules.Language/packages.config index d7bc5b9d..f8dbc83e 100644 --- a/Modules.Language/packages.config +++ b/Modules.Language/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Modules.License/License.vbproj b/Modules.License/License.vbproj index baf807df..b2f2eb36 100644 --- a/Modules.License/License.vbproj +++ b/Modules.License/License.vbproj @@ -45,7 +45,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll diff --git a/Modules.License/packages.config b/Modules.License/packages.config index d7bc5b9d..f8dbc83e 100644 --- a/Modules.License/packages.config +++ b/Modules.License/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Modules.Logging/Logging.vbproj b/Modules.Logging/Logging.vbproj index ad3f13b2..985235ec 100644 --- a/Modules.Logging/Logging.vbproj +++ b/Modules.Logging/Logging.vbproj @@ -45,7 +45,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll diff --git a/Modules.Logging/packages.config b/Modules.Logging/packages.config index d7bc5b9d..f8dbc83e 100644 --- a/Modules.Logging/packages.config +++ b/Modules.Logging/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Modules.Messaging/Messaging.vbproj b/Modules.Messaging/Messaging.vbproj index 99473635..b7afaf09 100644 --- a/Modules.Messaging/Messaging.vbproj +++ b/Modules.Messaging/Messaging.vbproj @@ -48,7 +48,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll ..\packages\S22.Imap.3.6.0.0\lib\net40\S22.Imap.dll diff --git a/Modules.Messaging/packages.config b/Modules.Messaging/packages.config index 32985371..30212888 100644 --- a/Modules.Messaging/packages.config +++ b/Modules.Messaging/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/Modules.Patterns/Patterns.vbproj b/Modules.Patterns/Patterns.vbproj index 5cd07153..01be2339 100644 --- a/Modules.Patterns/Patterns.vbproj +++ b/Modules.Patterns/Patterns.vbproj @@ -45,7 +45,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll diff --git a/Modules.Patterns/packages.config b/Modules.Patterns/packages.config index d7bc5b9d..f8dbc83e 100644 --- a/Modules.Patterns/packages.config +++ b/Modules.Patterns/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Modules.Windream/My Project/AssemblyInfo.vb b/Modules.Windream/My Project/AssemblyInfo.vb index db7df557..8ae936dc 100644 --- a/Modules.Windream/My Project/AssemblyInfo.vb +++ b/Modules.Windream/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - + diff --git a/Modules.Windream/Windream.vb b/Modules.Windream/Windream.vb index 68580c06..0b06b5b7 100644 --- a/Modules.Windream/Windream.vb +++ b/Modules.Windream/Windream.vb @@ -766,36 +766,38 @@ Public Class Windream Public Function GetNormalizedPath(Path As String) As String Dim oNormalizedPath = GetCleanedPath(Path) Try + ' Convert any forward slashes / and double slashes \\ into backslashes \ + ' See: https://stackoverflow.com/questions/3144492/how-do-i-get-nets-path-combine-to-convert-forward-slashes-to-backslashes + If IsPathRooted(oNormalizedPath) Then + oNormalizedPath = GetFullPath(oNormalizedPath) + End If - 'If UsesDriveLetter Then - ' Remove Driveletter eg. W:\ + ' Remove Driveletter, eg. W:\ If oNormalizedPath.StartsWith($"{ClientDriveLetter}:\") Then _logger.Debug($"Replacing ClientDriveLetter: [{ClientDriveLetter}]") oNormalizedPath = oNormalizedPath.Substring(ClientDriveLetter.Length + 2) End If - 'Else + + ' Remove Windream Base Path, eg. \\windream\objects\ If oNormalizedPath.ToLower.StartsWith(ClientBasePath.ToLower) Then _logger.Debug($"Replacing ClientBasePath: [{ClientBasePath}]") - ' Remove Windream Base Path eg. \\windream\objects\ - oNormalizedPath = oNormalizedPath.Substring(ClientBasePath.Length - 1) + oNormalizedPath = oNormalizedPath.Substring(ClientBasePath.Length) End If - 'End If - oNormalizedPath = oNormalizedPath.Replace("\\", "\") - _logger.Debug($"oNormalizedPath: [{oNormalizedPath}]") + ' Handle misconfigured drive-letter If oNormalizedPath.Contains(":") Then - _logger.Info($"oNormalizedPath still contains a drive name!!") - _logger.Info($"Check Your config ClientDriveLetter [{ClientDriveLetter}] // ClientBasePath [{ClientBasePath}]") + _logger.Warn($"oNormalizedPath still contains a drive name!!") + _logger.Warn($"Check Your config ClientDriveLetter [{ClientDriveLetter}] // ClientBasePath [{ClientBasePath}]") oNormalizedPath = oNormalizedPath.Substring(3) - _logger.Debug($"oNormalizedPath after Substring: [{oNormalizedPath}]") End If + + _logger.Debug($"oNormalizedPath: [{oNormalizedPath}]") + Return oNormalizedPath Catch ex As Exception _logger.Warn($"Unexpected error in GetNormalizedPath - oNormalizedPath [{oNormalizedPath}] - Error: [{ex.Message}]") Return "" End Try - - End Function ''' diff --git a/Modules.Windream/Windream.vbproj b/Modules.Windream/Windream.vbproj index f5db4b6a..91a95cc5 100644 --- a/Modules.Windream/Windream.vbproj +++ b/Modules.Windream/Windream.vbproj @@ -65,7 +65,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll diff --git a/Modules.Windream/packages.config b/Modules.Windream/packages.config index d7bc5b9d..f8dbc83e 100644 --- a/Modules.Windream/packages.config +++ b/Modules.Windream/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Modules.ZooFlow/ZooFlow.vbproj b/Modules.ZooFlow/ZooFlow.vbproj index 41499ffe..271ce2d5 100644 --- a/Modules.ZooFlow/ZooFlow.vbproj +++ b/Modules.ZooFlow/ZooFlow.vbproj @@ -45,7 +45,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll diff --git a/Modules.ZooFlow/packages.config b/Modules.ZooFlow/packages.config index d7bc5b9d..f8dbc83e 100644 --- a/Modules.ZooFlow/packages.config +++ b/Modules.ZooFlow/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Service.EDMIService/App.config b/Service.EDMIService/App.config index 8c1bd90e..4e4387a6 100644 --- a/Service.EDMIService/App.config +++ b/Service.EDMIService/App.config @@ -1,67 +1,55 @@ - + - - - - + + + + - + - + - - + + - + - + - + - + - - + + - - + + - + @@ -69,10 +57,10 @@ - + - + @@ -80,8 +68,8 @@ - - + + @@ -89,9 +77,9 @@ - - + + - + diff --git a/Service.EDMIService/EDMIService.vbproj b/Service.EDMIService/EDMIService.vbproj index 444b5c26..865e59cf 100644 --- a/Service.EDMIService/EDMIService.vbproj +++ b/Service.EDMIService/EDMIService.vbproj @@ -68,7 +68,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll diff --git a/Service.EDMIService/packages.config b/Service.EDMIService/packages.config index 380efd84..bac6970a 100644 --- a/Service.EDMIService/packages.config +++ b/Service.EDMIService/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/Service.JobRunner/JobRunner.vbproj b/Service.JobRunner/JobRunner.vbproj index c1f26d4d..5922661c 100644 --- a/Service.JobRunner/JobRunner.vbproj +++ b/Service.JobRunner/JobRunner.vbproj @@ -52,7 +52,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll ..\packages\Quartz.3.0.7\lib\net452\Quartz.dll diff --git a/Service.JobRunner/packages.config b/Service.JobRunner/packages.config index f3451819..9ee770de 100644 --- a/Service.JobRunner/packages.config +++ b/Service.JobRunner/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/Services.EmailService/DDEmailService.vbproj b/Services.EmailService/DDEmailService.vbproj index 19744be0..998e122a 100644 --- a/Services.EmailService/DDEmailService.vbproj +++ b/Services.EmailService/DDEmailService.vbproj @@ -52,7 +52,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll diff --git a/Services.EmailService/packages.config b/Services.EmailService/packages.config index 9df4a30e..20d7a800 100644 --- a/Services.EmailService/packages.config +++ b/Services.EmailService/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/Services.LicenseService/DDEDMLicenseService.vbproj b/Services.LicenseService/DDEDMLicenseService.vbproj index 1725b5a3..8c28073a 100644 --- a/Services.LicenseService/DDEDMLicenseService.vbproj +++ b/Services.LicenseService/DDEDMLicenseService.vbproj @@ -49,7 +49,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll diff --git a/Services.LicenseService/packages.config b/Services.LicenseService/packages.config index d7bc5b9d..f8dbc83e 100644 --- a/Services.LicenseService/packages.config +++ b/Services.LicenseService/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Services.ZUGFeRDService/DDZUGFeRDService.vbproj b/Services.ZUGFeRDService/DDZUGFeRDService.vbproj index bfb02e47..38554a25 100644 --- a/Services.ZUGFeRDService/DDZUGFeRDService.vbproj +++ b/Services.ZUGFeRDService/DDZUGFeRDService.vbproj @@ -52,7 +52,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll diff --git a/Services.ZUGFeRDService/packages.config b/Services.ZUGFeRDService/packages.config index 9df4a30e..20d7a800 100644 --- a/Services.ZUGFeRDService/packages.config +++ b/Services.ZUGFeRDService/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/WEBSERVICES/ZUGFeRDRESTService/ZUGFeRDRESTService.csproj b/WEBSERVICES/ZUGFeRDRESTService/ZUGFeRDRESTService.csproj index 6979bef1..8d327b9f 100644 --- a/WEBSERVICES/ZUGFeRDRESTService/ZUGFeRDRESTService.csproj +++ b/WEBSERVICES/ZUGFeRDRESTService/ZUGFeRDRESTService.csproj @@ -9,7 +9,7 @@ - + diff --git a/Windows/Windows.vbproj b/Windows/Windows.vbproj index f0dba021..b2611b70 100644 --- a/Windows/Windows.vbproj +++ b/Windows/Windows.vbproj @@ -45,7 +45,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll diff --git a/Windows/packages.config b/Windows/packages.config index d7bc5b9d..f8dbc83e 100644 --- a/Windows/packages.config +++ b/Windows/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file