EgtCAM5 :
- migliorie e correzioni a Combo per Info.
This commit is contained in:
@@ -10,19 +10,8 @@ Public Class InputExpanderVM
|
||||
' Variabile temporanea per salvare bShow
|
||||
Private m_bTempShow As Boolean
|
||||
|
||||
Private m_tmpInfoList As New ObservableCollection(Of InfoItem)
|
||||
''' <summary>
|
||||
''' Lista temporanea delle info
|
||||
''' </summary>
|
||||
Private Property tmpInfoList As ObservableCollection(Of InfoItem)
|
||||
Get
|
||||
Return m_tmpInfoList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of InfoItem))
|
||||
m_tmpInfoList = value
|
||||
OnPropertyChanged("tmpInfoList")
|
||||
End Set
|
||||
End Property
|
||||
' Lista temporanea delle Info
|
||||
Private m_TempInfoList As New List(Of InfoItem)
|
||||
|
||||
' Expander fields
|
||||
Private m_IsExpanded As Boolean
|
||||
@@ -166,17 +155,18 @@ Public Class InputExpanderVM
|
||||
Set(value As Integer)
|
||||
If m_bTempShow Then Map.refProjectVM.SetLastInteger(value)
|
||||
m_ComboSelectedIndex = value
|
||||
If m_ComboSelectedIndex >= 0 AndAlso tmpInfoList.Count > 0 Then
|
||||
' se la info è presente la aggiungo alla textbox per modificarla
|
||||
' se la combo è di Info ed è valida, la aggiungo alla textbox
|
||||
If m_ComboSelectedIndex >= 0 AndAlso m_TempInfoList.Count() > 0 Then
|
||||
Dim CurrItem As InfoItem = m_TempInfoList(m_ComboSelectedIndex)
|
||||
If String.IsNullOrEmpty(m_TextBox) Then
|
||||
m_TextBox = (tmpInfoList(m_ComboSelectedIndex).sKey & "=" & m_tmpInfoList(m_ComboSelectedIndex).sValue).Trim()
|
||||
m_TextBox = CurrItem.sKey & "=" & CurrItem.sValue
|
||||
Else
|
||||
If Not m_TextBox.EndsWith(vbCrLf) Then m_TextBox &= vbCrLf
|
||||
m_TextBox &= (tmpInfoList(m_ComboSelectedIndex).sKey & "=" & m_tmpInfoList(m_ComboSelectedIndex).sValue).Trim()
|
||||
m_TextBox &= CurrItem.sKey & "=" & CurrItem.sValue
|
||||
End If
|
||||
ComboVisibility = Visibility.Collapsed
|
||||
ComboItemsList.RemoveAt(m_ComboSelectedIndex)
|
||||
tmpInfoList.RemoveAt(m_ComboSelectedIndex)
|
||||
m_TempInfoList.RemoveAt(m_ComboSelectedIndex)
|
||||
m_ComboSelectedIndex = -1
|
||||
If ComboItemsList.Count <= 0 Then ShowInfoItemVisibility = Visibility.Collapsed
|
||||
End If
|
||||
@@ -341,13 +331,16 @@ Public Class InputExpanderVM
|
||||
''' <param name="param"></param>
|
||||
Public Sub ShowInfoItem(ByVal param As Object)
|
||||
' Se presente info inserita in textbox
|
||||
If m_TextBox IsNot String.Empty Then
|
||||
Dim sSplitItem As String() = m_TextBox.Split("="c)
|
||||
Dim ItemCombo As InfoItem = tmpInfoList.FirstOrDefault(Function(x) x.sKey = sSplitItem(0))
|
||||
If Not IsNothing(ItemCombo) Then
|
||||
ComboItemsList.Remove((ItemCombo.sKey & "=" & ItemCombo.sValue).Trim())
|
||||
tmpInfoList.Remove(ItemCombo)
|
||||
End If
|
||||
If Not String.IsNullOrWhiteSpace( m_TextBox) Then
|
||||
Dim vLines As String() = m_TextBox.Split( vbCrLf.ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
|
||||
For Each sLine As String In vLines
|
||||
Dim vKeyVal As String() = sLine.Split("="c)
|
||||
Dim nInd As Integer = m_TempInfoList.FindIndex( Function(x) x.sKey = vKeyVal(0))
|
||||
If nInd <> -1 Then
|
||||
ComboItemsList.RemoveAt( nInd)
|
||||
m_TempInfoList.RemoveAt( nInd)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
ComboVisibility = Visibility.Visible
|
||||
End Sub
|
||||
@@ -380,7 +373,7 @@ Public Class InputExpanderVM
|
||||
If PrepareInputBoxParam.bShowCombo Then
|
||||
m_bTempShow = PrepareInputBoxParam.bShowCombo
|
||||
ComboItemsList.Clear()
|
||||
tmpInfoList.Clear()
|
||||
m_TempInfoList.Clear()
|
||||
ComboVisibility = Visibility.Visible
|
||||
End If
|
||||
If PrepareInputBoxParam.bShowBtn Then
|
||||
@@ -436,22 +429,18 @@ Public Class InputExpanderVM
|
||||
''' Funzione che popola la lista ComboItemsList
|
||||
''' </summary>
|
||||
Private Sub ComboInfo()
|
||||
tmpInfoList.Clear()
|
||||
|
||||
m_TempInfoList.Clear()
|
||||
ComboItemsList.Clear()
|
||||
|
||||
Dim vsVal As String() = Nothing
|
||||
EgtGetAllInfo(Map.refManageLayerExpanderVM.RightClickedTreeItemId, vsVal)
|
||||
Dim vsInfo As String() = Nothing
|
||||
EgtGetAllInfo( Map.refManageLayerExpanderVM.RightClickedTreeItemId, vsInfo)
|
||||
|
||||
If Not m_bTempShow And Not IsNothing(vsVal) Then
|
||||
Dim Ind As Integer = 0
|
||||
For Each Item As String In vsVal
|
||||
Dim sSplitItem As String() = Item.Split("="c)
|
||||
tmpInfoList.Add(New InfoItem(Ind, sSplitItem(0), sSplitItem(1)))
|
||||
Ind += 1
|
||||
Next
|
||||
|
||||
For Each InfoItem As InfoItem In tmpInfoList
|
||||
ComboItemsList.Add((InfoItem.sKey & "=" & InfoItem.sValue).Trim())
|
||||
If Not m_bTempShow And Not IsNothing( vsInfo) Then
|
||||
For nInd As Integer = 0 To vsInfo.Count() - 1
|
||||
Dim vKeyVal As String() = vsInfo( nInd).Split("="c)
|
||||
m_TempInfoList.Add(New InfoItem( nInd, vKeyVal(0), vKeyVal(1)))
|
||||
ComboItemsList.Add( vsInfo( nInd))
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user