Commit changes before fixing errors.
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
Imports System.Windows.Forms
|
Imports System.Windows.Forms
|
||||||
Imports DigitalData.Controls.LookupGrid
|
|
||||||
Imports DigitalData.Modules.Logging
|
Imports DigitalData.Modules.Logging
|
||||||
|
|
||||||
Namespace Modules
|
Namespace Modules
|
||||||
@@ -38,55 +37,25 @@ Namespace Modules
|
|||||||
|
|
||||||
If oControl IsNot Nothing Then
|
If oControl IsNot Nothing Then
|
||||||
Dim oReplaceValue As String
|
Dim oReplaceValue As String
|
||||||
Select Case oControl.GetType
|
|
||||||
Case GetType(TextBox)
|
If TryGetDevExpressCheckEditValue(oControl, oReplaceValue) Then
|
||||||
|
' value already determined by helper
|
||||||
|
Else
|
||||||
|
Select Case True
|
||||||
|
Case TypeOf oControl Is TextBox
|
||||||
oReplaceValue = oControl.Text
|
oReplaceValue = oControl.Text
|
||||||
|
|
||||||
' Case GetType(DevExpress.XtraEditors.TextEdit) ' Type not found: DevExpress.XtraEditors.TextEdit
|
Case TypeOf oControl Is ComboBox
|
||||||
' Dim oTextEdit As DevExpress.XtraEditors.TextEdit = oControl
|
|
||||||
' oReplaceValue = oTextEdit.EditValue
|
|
||||||
|
|
||||||
' Case GetType(DevExpress.XtraEditors.DateEdit) ' Type not found: DevExpress.XtraEditors.DateEdit
|
|
||||||
' Dim oDateEdit As DevExpress.XtraEditors.DateEdit = oControl
|
|
||||||
' Dim oDateValue As Date = oDateEdit.EditValue
|
|
||||||
' oReplaceValue = oDateValue.ToString("yyyyMMdd")
|
|
||||||
|
|
||||||
' Case GetType(DevExpress.XtraEditors.LookUpEdit) ' Type not found: DevExpress.XtraEditors.LookUpEdit
|
|
||||||
' Dim oLookupEdit As DevExpress.XtraEditors.LookUpEdit = oControl
|
|
||||||
|
|
||||||
' If IsNothing(oLookupEdit.EditValue) Then
|
|
||||||
' oReplaceValue = String.Empty
|
|
||||||
' Else
|
|
||||||
' oReplaceValue = oLookupEdit.EditValue
|
|
||||||
' End If
|
|
||||||
|
|
||||||
' Case GetType(LookupControl3) ' Type LookupControl3 is not defined or referenced in the project
|
|
||||||
' Dim oLookupControl3 As LookupControl3 = oControl
|
|
||||||
' If oLookupControl3.Properties.SelectedValues.Count = 1 Then
|
|
||||||
' oReplaceValue = oLookupControl3.Properties.SelectedValues.Item(0)
|
|
||||||
' Else
|
|
||||||
' oReplaceValue = "0"
|
|
||||||
' End If
|
|
||||||
|
|
||||||
Case GetType(ComboBox)
|
|
||||||
oReplaceValue = oControl.Text
|
oReplaceValue = oControl.Text
|
||||||
|
|
||||||
' Case GetType(DevExpress.XtraEditors.ComboBoxEdit) ' Type not found: DevExpress.XtraEditors.ComboBoxEdit
|
Case TypeOf oControl Is CheckBox
|
||||||
' Dim oCombobox As DevExpress.XtraEditors.ComboBoxEdit = oControl
|
Dim oCheckBox As CheckBox = DirectCast(oControl, CheckBox)
|
||||||
' oReplaceValue = oCombobox.EditValue
|
oReplaceValue = oCheckBox.Checked.ToString()
|
||||||
|
|
||||||
Case GetType(CheckBox)
|
|
||||||
Dim oCheckBox As CheckBox = oControl
|
|
||||||
oReplaceValue = oCheckBox.Checked
|
|
||||||
|
|
||||||
Case GetType(DevExpress.XtraEditors.CheckEdit)
|
|
||||||
Dim oCheckEdit As DevExpress.XtraEditors.CheckEdit = oControl
|
|
||||||
oReplaceValue = oCheckEdit.Checked
|
|
||||||
|
|
||||||
Case Else
|
Case Else
|
||||||
oReplaceValue = "0"
|
oReplaceValue = "0"
|
||||||
|
|
||||||
End Select
|
End Select
|
||||||
|
End If
|
||||||
|
|
||||||
oResult = ReplacePattern(oResult, PatternIdentifier, oReplaceValue)
|
oResult = ReplacePattern(oResult, PatternIdentifier, oReplaceValue)
|
||||||
Else
|
Else
|
||||||
@@ -106,3 +75,25 @@ Namespace Modules
|
|||||||
|
|
||||||
End Class
|
End Class
|
||||||
End Namespace
|
End Namespace
|
||||||
|
|
||||||
|
Module DevExpressCheckEditCompatibility
|
||||||
|
Friend Function TryGetDevExpressCheckEditValue(control As Control, ByRef value As String) As Boolean
|
||||||
|
If control Is Nothing Then
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim controlType = control.GetType()
|
||||||
|
If controlType.FullName <> "DevExpress.XtraEditors.CheckEdit" Then
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim checkedProperty = controlType.GetProperty("Checked")
|
||||||
|
If checkedProperty Is Nothing Then
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim checkedValue = checkedProperty.GetValue(control)
|
||||||
|
value = Convert.ToString(checkedValue, Globalization.CultureInfo.InvariantCulture)
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
End Module
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
Imports System.Windows.Forms
|
Imports System.Windows.Forms
|
||||||
Imports DigitalData.Controls.LookupGrid
|
|
||||||
Imports DigitalData.Modules.Logging
|
Imports DigitalData.Modules.Logging
|
||||||
|
|
||||||
Namespace Modules
|
Namespace Modules
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
Imports System.Windows.Forms
|
Imports DigitalData.Modules.Logging
|
||||||
Imports DigitalData.Controls.LookupGrid
|
|
||||||
Imports DigitalData.Modules.Logging
|
|
||||||
|
|
||||||
Namespace Modules
|
Namespace Modules
|
||||||
''' <summary>
|
''' <summary>
|
||||||
@@ -19,14 +17,26 @@ Namespace Modules
|
|||||||
MyBase.New(pLogConfig)
|
MyBase.New(pLogConfig)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Function Replace(pInput As String, pWMObject As WINDREAMLib.WMObject) As String
|
Public Function Replace(pInput As String, pWMObject As Object) As String
|
||||||
Dim oResult = pInput
|
Dim oResult = pInput
|
||||||
Dim oCounter = 0
|
Dim oCounter = 0
|
||||||
|
If pWMObject Is Nothing Then
|
||||||
|
Logger.Warn("No windream object provided for replacement.")
|
||||||
|
Return oResult
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim objectType = pWMObject.GetType()
|
||||||
|
Dim getVariableValueMethod = objectType.GetMethod("GetVariableValue")
|
||||||
|
|
||||||
|
If getVariableValueMethod Is Nothing Then
|
||||||
|
Logger.Warn("Provided object does not expose a GetVariableValue method. Skipping windream replacements.")
|
||||||
|
Return oResult
|
||||||
|
End If
|
||||||
|
|
||||||
While ContainsPattern(oResult, PatternIdentifier)
|
While ContainsPattern(oResult, PatternIdentifier)
|
||||||
Try
|
Try
|
||||||
Dim oIndexName As String = GetNextPattern(oResult, PatternIdentifier).Value
|
Dim oIndexName As String = GetNextPattern(oResult, PatternIdentifier).Value
|
||||||
Dim oWMValue As Object = pWMObject.GetVariableValue(oIndexName)
|
Dim oWMValue As Object = getVariableValueMethod.Invoke(pWMObject, New Object() {oIndexName})
|
||||||
|
|
||||||
If oWMValue Is Nothing Then
|
If oWMValue Is Nothing Then
|
||||||
Logger.Warn("Value for Index [{0}] is empty and will not be used for replacing. Skipping.")
|
Logger.Warn("Value for Index [{0}] is empty and will not be used for replacing. Skipping.")
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports System.Text.RegularExpressions
|
Imports System.Text.RegularExpressions
|
||||||
Imports System.Windows.Forms
|
Imports System.Windows.Forms
|
||||||
Imports DigitalData.Controls.LookupGrid
|
|
||||||
Imports DigitalData.Modules.Logging
|
Imports DigitalData.Modules.Logging
|
||||||
Imports DigitalData.Modules.ZooFlow
|
Imports DigitalData.Modules.ZooFlow
|
||||||
|
|
||||||
@@ -88,7 +87,7 @@ Public Class Patterns2
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function ReplaceWindreamValues(pInput As String, pWMObject As WMObject) As String
|
Public Function ReplaceWindreamValues(pInput As String, pWMObject As Object) As String
|
||||||
Try
|
Try
|
||||||
Logger.Debug("Replacing Windream Values")
|
Logger.Debug("Replacing Windream Values")
|
||||||
Dim oModule = New Modules.Windream(LogConfig)
|
Dim oModule = New Modules.Windream(LogConfig)
|
||||||
|
|||||||
Reference in New Issue
Block a user