EgtDOORCreator 1.9k3 :
- aggiunta di nuovo parametro ( ActiveBox); - possibilità di selezionare l'ultimo ddf letto ( in modalità singola porta); - elimino l'errore dopo la modifica dei parametri; - porto il focus sul ddf selezionato ( in modalità progetto).
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<UserControl x:Class="AssemblyManagerV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
||||
xmlns:EgtDOORCreator="clr-namespace:EgtDOORCreator"
|
||||
Height="30">
|
||||
|
||||
@@ -23,7 +24,10 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<ListBox ItemsSource="{Binding CurrProject.AssemblyList}"
|
||||
SelectedItem="{Binding CurrProject.SelAssemblyName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
|
||||
Style="{StaticResource DoorListBox}" Name="AssemblyList" Grid.ColumnSpan="2" Margin="0,0,28,0.4" Grid.RowSpan="2">
|
||||
Style="{StaticResource DoorListBox}" Name="AssemblyList" Grid.ColumnSpan="2" Margin="0,0,28,0.4" Grid.RowSpan="2">
|
||||
<Interactivity:Interaction.Behaviors>
|
||||
<EgtDOORCreator:ScrollIntoViewForListBox/>
|
||||
</Interactivity:Interaction.Behaviors>
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<VirtualizingStackPanel IsItemsHost="True" Orientation="Horizontal"/>
|
||||
@@ -33,7 +37,7 @@
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<ContentPresenter/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
Imports System.Windows.Interactivity
|
||||
Imports System.Collections.Specialized
|
||||
|
||||
Public Class ScrollIntoViewForListBox
|
||||
Inherits Behavior(Of ListBox)
|
||||
|
||||
Private ItemsSource As INotifyCollectionChanged
|
||||
|
||||
Private ListControl As ListBox
|
||||
|
||||
''' <summary>
|
||||
''' When Beahvior is attached
|
||||
''' </summary>
|
||||
Protected Overrides Sub OnAttached()
|
||||
MyBase.OnAttached()
|
||||
ListControl = Me.AssociatedObject
|
||||
AddHandler Me.AssociatedObject.SelectionChanged, AddressOf AssociatedObject_SelectionChanged
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub AssociatedObject_CollectionChanged(sender As Object, e As System.Collections.Specialized.NotifyCollectionChangedEventArgs)
|
||||
If IsNothing(ItemsSource) Then
|
||||
Dim CurrItemsSource As IEnumerable = Me.AssociatedObject.ItemsSource
|
||||
ItemsSource = TryCast(CurrItemsSource, INotifyCollectionChanged)
|
||||
AddHandler ItemsSource.CollectionChanged, AddressOf AssociatedObject_CollectionChanged
|
||||
RemoveHandler Me.AssociatedObject.SelectionChanged, AddressOf AssociatedObject_SelectionChanged
|
||||
|
||||
' SE SI CAMBIA ITEMSSOURCE PERDE IL RIFERIMENTO E SMETTE DI FUNZIONARE
|
||||
' PER RIATTIVARLO USARE IL SEGUENTE CODICE COMMENTATO
|
||||
'ElseIf ItemsSource IsNot Me.AssociatedObject.ItemsSource Then
|
||||
' Dim PreviousItemsSourceList As INotifyCollectionChanged = TryCast(ItemsSource, INotifyCollectionChanged)
|
||||
' RemoveHandler PreviousItemsSourceList.CollectionChanged, AddressOf AssociatedObject_CollectionChanged
|
||||
' Dim CurrItemsSource As IEnumerable = Me.AssociatedObject.ItemsSource
|
||||
' ItemsSource = TryCast(CurrItemsSource, INotifyCollectionChanged)
|
||||
' AddHandler ItemsSource.CollectionChanged, AddressOf AssociatedObject_CollectionChanged
|
||||
End If
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' On Selection Changed
|
||||
''' </summary>
|
||||
''' <param name="sender"></param>
|
||||
''' <param name="e"></param>
|
||||
Private Sub AssociatedObject_SelectionChanged(sender As Object, e As SelectionChangedEventArgs)
|
||||
If ListControl.SelectedItem IsNot Nothing Then
|
||||
Dim SelectedItemIndex As Integer = ListControl.Items.IndexOf(ListControl.SelectedItem)
|
||||
ListControl.Dispatcher.BeginInvoke(DirectCast(Sub()
|
||||
ListControl.UpdateLayout()
|
||||
If ListControl.SelectedItem IsNot Nothing Then
|
||||
ListControl.ScrollIntoView(ListControl.SelectedItem)
|
||||
End If
|
||||
End Sub, Action))
|
||||
If SelectedItemIndex > 0 Then
|
||||
ListControl.Dispatcher.BeginInvoke(DirectCast(Sub()
|
||||
ListControl.UpdateLayout()
|
||||
ListControl.ScrollIntoView(ListControl.Items(SelectedItemIndex - 1))
|
||||
End Sub, Action))
|
||||
End If
|
||||
If SelectedItemIndex < ListControl.Items.Count - 2 Then
|
||||
ListControl.Dispatcher.BeginInvoke(DirectCast(Sub()
|
||||
ListControl.UpdateLayout()
|
||||
ListControl.ScrollIntoView(ListControl.Items(SelectedItemIndex + 1))
|
||||
End Sub, Action))
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' When behavior is detached
|
||||
''' </summary>
|
||||
Protected Overrides Sub OnDetaching()
|
||||
MyBase.OnDetaching()
|
||||
'RemoveHandler Me.AssociatedObject.SelectionChanged, AddressOf AssociatedObject_SelectionChanged
|
||||
RemoveHandler ItemsSource.CollectionChanged, AddressOf AssociatedObject_CollectionChanged
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class ScrollIntoViewForDataGrid
|
||||
Inherits Behavior(Of DataGrid)
|
||||
|
||||
Private ItemsSource As INotifyCollectionChanged
|
||||
|
||||
Private DataGridControl As DataGrid
|
||||
|
||||
''' <summary>
|
||||
''' When Beahvior is attached
|
||||
''' </summary>
|
||||
Protected Overrides Sub OnAttached()
|
||||
MyBase.OnAttached()
|
||||
DataGridControl = Me.AssociatedObject
|
||||
AddHandler Me.AssociatedObject.SelectionChanged, AddressOf AssociatedObject_SelectionChanged
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub AssociatedObject_CollectionChanged(sender As Object, e As System.Collections.Specialized.NotifyCollectionChangedEventArgs)
|
||||
UpdateSelectedItemPosition()
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' On Selection Changed
|
||||
''' </summary>
|
||||
''' <param name="sender"></param>
|
||||
''' <param name="e"></param>
|
||||
Private Sub AssociatedObject_SelectionChanged(sender As Object, e As SelectionChangedEventArgs)
|
||||
If IsNothing(ItemsSource) Then
|
||||
Dim CurrItemsSource As IEnumerable = Me.AssociatedObject.ItemsSource
|
||||
ItemsSource = TryCast(CurrItemsSource, INotifyCollectionChanged)
|
||||
AddHandler ItemsSource.CollectionChanged, AddressOf AssociatedObject_CollectionChanged
|
||||
|
||||
'SE SI CAMBIA ITEMSSOURCE PERDE IL RIFERIMENTO E SMETTE DI FUNZIONARE
|
||||
'PER RIATTIVARLO USARE IL SEGUENTE CODICE COMMENTATO
|
||||
ElseIf Not IsNothing(Me.AssociatedObject.ItemsSource) AndAlso ItemsSource IsNot Me.AssociatedObject.ItemsSource Then
|
||||
Dim PreviousItemsSourceList As INotifyCollectionChanged = TryCast(ItemsSource, INotifyCollectionChanged)
|
||||
RemoveHandler PreviousItemsSourceList.CollectionChanged, AddressOf AssociatedObject_CollectionChanged
|
||||
Dim CurrItemsSource As IEnumerable = Me.AssociatedObject.ItemsSource
|
||||
ItemsSource = TryCast(CurrItemsSource, INotifyCollectionChanged)
|
||||
AddHandler ItemsSource.CollectionChanged, AddressOf AssociatedObject_CollectionChanged
|
||||
Else
|
||||
UpdateSelectedItemPosition()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateSelectedItemPosition()
|
||||
If DataGridControl.SelectedItem IsNot Nothing Then
|
||||
Dim SelectedItemIndex As Integer = DataGridControl.Items.IndexOf(DataGridControl.SelectedItem)
|
||||
DataGridControl.Dispatcher.BeginInvoke(DirectCast(Sub()
|
||||
DataGridControl.UpdateLayout()
|
||||
If DataGridControl.SelectedItem IsNot Nothing Then
|
||||
DataGridControl.ScrollIntoView(DataGridControl.SelectedItem)
|
||||
End If
|
||||
End Sub, Action))
|
||||
If SelectedItemIndex > 0 Then
|
||||
DataGridControl.Dispatcher.BeginInvoke(DirectCast(Sub()
|
||||
DataGridControl.UpdateLayout()
|
||||
DataGridControl.ScrollIntoView(DataGridControl.Items(SelectedItemIndex - 1))
|
||||
End Sub, Action))
|
||||
End If
|
||||
If SelectedItemIndex < DataGridControl.Items.Count - 2 Then
|
||||
DataGridControl.Dispatcher.BeginInvoke(DirectCast(Sub()
|
||||
DataGridControl.UpdateLayout()
|
||||
DataGridControl.ScrollIntoView(DataGridControl.Items(SelectedItemIndex + 1))
|
||||
End Sub, Action))
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' When behavior is detached
|
||||
''' </summary>
|
||||
Protected Overrides Sub OnDetaching()
|
||||
MyBase.OnDetaching()
|
||||
RemoveHandler Me.AssociatedObject.SelectionChanged, AddressOf AssociatedObject_SelectionChanged
|
||||
RemoveHandler ItemsSource.CollectionChanged, AddressOf AssociatedObject_CollectionChanged
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -154,6 +154,13 @@ Public Class Compo
|
||||
Set(value As Boolean)
|
||||
m_IsActiveChapter = value
|
||||
If Not IsNothing(Map.refHardwarePageVM) AndAlso Not IsNothing(Map.refHardwarePageVM.CurrHardware) Then
|
||||
For Each ItemParam In Me.CompoParamList
|
||||
If TypeOf ItemParam Is ActivateParam Then
|
||||
Dim Text As ActivateParam = DirectCast(ItemParam, ActivateParam)
|
||||
Text.SetIsActivated(m_IsActiveChapter)
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
SetModified()
|
||||
'Map.refHardwarePageVM.CurrHardware.RefreshTempHardware()
|
||||
Map.refSceneManagerVM.RefreshBtn()
|
||||
@@ -1334,6 +1341,37 @@ Public Class Compo
|
||||
End If
|
||||
NewCompoParam = New GhostParam(sLuaName, sName, Me, DefaultValue)
|
||||
Return True
|
||||
|
||||
Case "ActiveBox"
|
||||
' NomeDDF e Nome del Text
|
||||
Dim sTextList() As String = sItems(1).Split("/"c)
|
||||
Dim sLuaName As String = String.Empty
|
||||
Dim sName As String = String.Empty
|
||||
If sTextList.Count() >= 1 Then sLuaName = Trim(sTextList(0))
|
||||
If sTextList.Count() >= 2 Then
|
||||
sName = Trim(MsgControl(sTextList(0), sTextList(1), sErrorList))
|
||||
Else
|
||||
sName = sLuaName
|
||||
' Errore nella lettura del nome {0} in {1}. Attesa una corrispondenza numerica.
|
||||
sErrorList = ConcatErrorString(sErrorList, String.Format(EgtMsg(50120), sTextList(0), m_CompoType.Path))
|
||||
End If
|
||||
If sItems.Count < 3 Then
|
||||
' Errore nella lettura {0} nel parametro {1} della componente: non esiste.
|
||||
Dim sError As String = String.Format(EgtMsg(50121), sLuaName, m_CompoType.DDFName)
|
||||
sErrorList = ConcatErrorString(sErrorList, sError)
|
||||
Return False
|
||||
End If
|
||||
Dim nInd As Integer
|
||||
Dim bCheck As Boolean = False
|
||||
If Integer.TryParse(sItems(2), nInd) Then
|
||||
If nInd = 1 Then bCheck = True Else bCheck = False
|
||||
Else
|
||||
' Errore nella lettura {0} nel parametro {1} della componente: non esiste il valore.
|
||||
sErrorList = ConcatErrorString(sErrorList, String.Format(EgtMsg(50125), sName, m_CompoType.DDFName))
|
||||
End If
|
||||
NewCompoParam = New ActivateParam(sLuaName, sName, Me, bCheck, sHelpParam)
|
||||
Return True
|
||||
|
||||
End Select
|
||||
Return False
|
||||
End Function
|
||||
@@ -1557,6 +1595,7 @@ Public Class TextBoxParam
|
||||
m_Value = value
|
||||
NotifyPropertyChanged("ToolTipValue")
|
||||
SetModified()
|
||||
CurrCompo.LoadByDefault = False
|
||||
' se la componente non ha un riferimento esce
|
||||
If IsNothing(CurrCompo.refJambCompo) Then Return
|
||||
' se fallisce il caricamento dei parametri esce
|
||||
@@ -1696,6 +1735,7 @@ Public Class ComboBoxParam
|
||||
Set(value As String)
|
||||
m_SelItem = value
|
||||
SetModified()
|
||||
CurrCompo.LoadByDefault = False
|
||||
Dim CmpPar As CompoParam = Me
|
||||
Dim IndexP As Integer = CurrCompo.CompoParamList.IndexOf(Me)
|
||||
' se il nome della combobox è side allora ed esiset un riferimento
|
||||
@@ -1758,6 +1798,7 @@ Public Class TextBoxOnOffParam
|
||||
Set(value As Boolean)
|
||||
m_IsActive = value
|
||||
SetModified()
|
||||
CurrCompo.LoadByDefault = False
|
||||
Map.refSceneManagerVM.RefreshBtn()
|
||||
End Set
|
||||
End Property
|
||||
@@ -2020,4 +2061,37 @@ Public Class ItemConstThickness
|
||||
m_dValue = dVal
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class ActivateParam
|
||||
Inherits CompoParam
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
Private m_IsActivated As Boolean = False
|
||||
Public Property IsActivated As Boolean
|
||||
Get
|
||||
Return m_IsActivated
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsChecked = value
|
||||
SetModified()
|
||||
Map.refSceneManagerVM.RefreshBtn()
|
||||
End Set
|
||||
End Property
|
||||
Public Sub SetIsActivated(IsActivate As Boolean)
|
||||
m_IsActivated = IsActivate
|
||||
NotifyPropertyChanged("IsChecked")
|
||||
End Sub
|
||||
|
||||
|
||||
Sub New(sDDFName As String, sName As String, CurrCompo As Compo, IsActivate As Boolean, Optional sLayerName As String = "")
|
||||
MyBase.New(sDDFName, sName, CurrCompo, sLayerName)
|
||||
m_IsActivated = IsActivate
|
||||
End Sub
|
||||
|
||||
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
Public Sub NotifyPropertyChanged(propName As String)
|
||||
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
||||
End Sub
|
||||
End Class
|
||||
@@ -89,6 +89,7 @@
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System" />
|
||||
@@ -113,6 +114,7 @@
|
||||
<Compile Include="AssemblyManager\AssemblyName.vb" />
|
||||
<Compile Include="Assembly\PartDoor.vb" />
|
||||
<Compile Include="Assembly\Association.vb" />
|
||||
<Compile Include="AttachedBehavior\ScrollIntoView.vb" />
|
||||
<Compile Include="Command\Command.vb" />
|
||||
<Compile Include="CompoMatch.vb" />
|
||||
<Compile Include="CompoPanel\CompoPanelHardwareV.xaml.vb">
|
||||
|
||||
@@ -804,7 +804,15 @@ Public Class Hardware
|
||||
If m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter).DDFName = sParam Then
|
||||
' ho trovato una corrispondenza tra il valore de file ini e quello lua in lettura
|
||||
' allora significa che tutto il capitolo associato deve essere attivo
|
||||
m_GroupChapters(IndexGroupChapters).SetIsActiveChapter(True)
|
||||
Dim AcitvateParamNotExists As Boolean = True
|
||||
For Each ItemParam In m_GroupChapters(IndexGroupChapters).CompoParamList
|
||||
If TypeOf ItemParam Is ActivateParam Then
|
||||
AcitvateParamNotExists = False
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If AcitvateParamNotExists Then m_GroupChapters(IndexGroupChapters).SetIsActiveChapter(True)
|
||||
' m_GroupChapters(IndexGroupChapters).SetIsActiveChapter(True)
|
||||
If TypeOf m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter) Is TextBoxDGCParam Then
|
||||
Dim Text As TextBoxDGCParam = DirectCast(m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter), TextBoxDGCParam)
|
||||
' se testo numerico, eseguo opportunbe conversioni per H,W e T
|
||||
@@ -889,6 +897,10 @@ Public Class Hardware
|
||||
ElseIf TypeOf m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter) Is GhostParam Then
|
||||
Dim Text As GhostParam = DirectCast(m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter), GhostParam)
|
||||
Text.Value = sValue
|
||||
ElseIf TypeOf m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter) Is ActivateParam Then
|
||||
Dim Text As ActivateParam = DirectCast(m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter), ActivateParam)
|
||||
Text.SetIsActivated(Utility.ConvertCheckBox(sValue))
|
||||
m_GroupChapters(IndexGroupChapters).SetIsActiveChapter(Text.IsActivated)
|
||||
End If
|
||||
Return True
|
||||
End If
|
||||
@@ -1485,6 +1497,7 @@ Public Class Hardware
|
||||
Return False
|
||||
End Function
|
||||
|
||||
' dato il nome del parametri sostiuisce il valore da stampare
|
||||
Public Function ConvertValueForLua(ByRef sValue As String) As Boolean
|
||||
Dim bIsActive As Boolean = True
|
||||
Dim NameParam = Utility.FindNameParam(sValue)
|
||||
@@ -1641,8 +1654,14 @@ Public Class Hardware
|
||||
ElseIf TypeOf m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter) Is CheckBoxParam Then
|
||||
Dim Text As CheckBoxParam = DirectCast(m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter), CheckBoxParam)
|
||||
sValue = String.Empty
|
||||
If Text.IsChecked = True Then sValue = " true" Else sValue = " false"
|
||||
If Text.IsChecked Then sValue = " true" Else sValue = " false"
|
||||
Return True
|
||||
ElseIf TypeOf m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter) Is ActivateParam Then
|
||||
Dim Text As ActivateParam = DirectCast(m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter), ActivateParam)
|
||||
sValue = String.Empty
|
||||
If Text.IsActivated Then sValue = " true" Else sValue = " false"
|
||||
Return True
|
||||
|
||||
ElseIf TypeOf m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter) Is ComboBoxParamLua Then
|
||||
Dim Text As ComboBoxParamLua = DirectCast(m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter), ComboBoxParamLua)
|
||||
sValue = String.Empty
|
||||
|
||||
@@ -312,9 +312,14 @@
|
||||
</UniformGrid>
|
||||
</DataTemplate>
|
||||
|
||||
<!-- Gestione della GhostParam -->
|
||||
<DataTemplate DataType="{x:Type local:GhostParam}">
|
||||
</DataTemplate>
|
||||
|
||||
<!-- Gestione della ActivateParam -->
|
||||
<DataTemplate DataType="{x:Type local:ActivateParam}">
|
||||
</DataTemplate>
|
||||
|
||||
<!-- Gestione della TextBoxParamOnOffParam -->
|
||||
<DataTemplate DataType="{x:Type local:TextBoxOnOffParam}">
|
||||
<Grid MouseEnter="Param_MouseEnter">
|
||||
|
||||
@@ -72,5 +72,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.9.11.2")>
|
||||
<Assembly: AssemblyFileVersion("1.9.11.2")>
|
||||
<Assembly: AssemblyVersion("1.9.11.3")>
|
||||
<Assembly: AssemblyFileVersion("1.9.11.3")>
|
||||
|
||||
@@ -273,8 +273,9 @@ Public Class ProjectManagerVM
|
||||
|
||||
Public Sub OpenProject(sFilePath As String)
|
||||
' se true carica una singola porta del progetto
|
||||
Dim bModifiersShift As Boolean = OptionModule.m_SingleDoor
|
||||
Dim bIsSingleDoor As Boolean = OptionModule.m_SingleDoor
|
||||
Dim sFilePathComplete As String = String.Empty
|
||||
Dim bValidPath As Boolean = False
|
||||
' verifico se selezionato esiste e modificato
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified Then
|
||||
Dim sText As String = String.Format(EgtMsg(50109), Path.GetFileNameWithoutExtension(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name))
|
||||
@@ -287,14 +288,28 @@ Public Class ProjectManagerVM
|
||||
Return
|
||||
End Select
|
||||
End If
|
||||
' Se FilePath non valida
|
||||
If String.IsNullOrWhiteSpace(sFilePath) OrElse Not Directory.Exists(sFilePath) Then
|
||||
|
||||
If Directory.Exists(sFilePath) AndAlso Not bIsSingleDoor Then
|
||||
bValidPath = True
|
||||
ElseIf Directory.Exists(sFilePath) AndAlso bIsSingleDoor Then
|
||||
m_MruFiles.Remove(sFilePath)
|
||||
bValidPath = False
|
||||
ElseIf File.Exists(sFilePath) Then
|
||||
sFilePathComplete = sFilePath
|
||||
sFilePath = Path.GetDirectoryName(sFilePath)
|
||||
bValidPath = True
|
||||
Else
|
||||
' elimino eventual FilePath inesistente dalla lista dei recenti
|
||||
m_MruFiles.Remove(sFilePath)
|
||||
bValidPath = False
|
||||
End If
|
||||
|
||||
' Se FilePath non valida
|
||||
If Not bValidPath Then
|
||||
|
||||
'If OptionModule.m_SingleDoor OrElse Keyboard.Modifiers.HasFlag(ModifierKeys.Shift) Then
|
||||
If OptionModule.m_SingleDoor Then
|
||||
bModifiersShift = True
|
||||
bIsSingleDoor = True
|
||||
' definisco la finestra di dialogo per la scelta dei file
|
||||
Dim fd As System.Windows.Forms.OpenFileDialog = New System.Windows.Forms.OpenFileDialog()
|
||||
fd.Title = "Open File Dialog"
|
||||
@@ -349,7 +364,7 @@ Public Class ProjectManagerVM
|
||||
CurrProject.AssemblyList.Clear()
|
||||
|
||||
' caricamento elenco porte
|
||||
If Not bModifiersShift Then
|
||||
If Not bIsSingleDoor Then
|
||||
' Aggiungo porte trovate nella cartella ad un vettore
|
||||
Dim DDFFileArray() As String = Directory.GetFiles(sFilePath)
|
||||
' ripulisco il nome della porta (cancello tutto il percorso del file lasciando solo il nome del file)
|
||||
@@ -375,7 +390,19 @@ Public Class ProjectManagerVM
|
||||
CurrProject.NotifyPropertyChanged("AssemblyList")
|
||||
' Se c'è almeno una porta la visualizzo
|
||||
If CurrProject.AssemblyList.Count > 0 Then
|
||||
CurrProject.SelAssemblyName = CurrProject.AssemblyList(0)
|
||||
Dim bAssemblyIsSelected As Boolean = False
|
||||
If Not String.IsNullOrWhiteSpace(sFilePathComplete) Then
|
||||
For Each ItemFile In CurrProject.AssemblyList
|
||||
If sFilePathComplete = ItemFile.Name Then
|
||||
CurrProject.SelAssemblyName = ItemFile
|
||||
bAssemblyIsSelected = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
If Not bAssemblyIsSelected Then
|
||||
CurrProject.SelAssemblyName = CurrProject.AssemblyList(0)
|
||||
End If
|
||||
Else
|
||||
Map.refPartPageVM.CurrPart = Nothing
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||
@@ -383,7 +410,7 @@ Public Class ProjectManagerVM
|
||||
EgtZoom(ZM.ALL)
|
||||
End If
|
||||
' carico il nome del direttorio e la visbilità della lista delle porte
|
||||
If bModifiersShift Then
|
||||
If bIsSingleDoor Then
|
||||
Map.refMainWindowVM.ProjectNameMsg = CurrProject.SelAssemblyName.Name
|
||||
Map.refAssemblyManagerVM.VisibilityDoorList = Visibility.Collapsed
|
||||
Else
|
||||
@@ -401,7 +428,12 @@ Public Class ProjectManagerVM
|
||||
End If
|
||||
' Aggiungo alla lista dei recenti/ verifico se esite anche se posso salvare un indirizzo comlpeto
|
||||
Map.refOptionsVM.MyProjectDir = sFilePath
|
||||
m_MruFiles.Add(sFilePath)
|
||||
If bIsSingleDoor Then
|
||||
m_MruFiles.Add(CurrProject.SelAssemblyName.Name)
|
||||
Else
|
||||
m_MruFiles.Add(sFilePath)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' OpenCommand
|
||||
@@ -418,7 +450,8 @@ Public Class ProjectManagerVM
|
||||
End Property
|
||||
|
||||
Public Sub OpenMruFile(ByVal param As Object)
|
||||
OpenProject(DirectCast(param, String).Replace("__", "_"))
|
||||
Dim sLastProject As String = DirectCast(param, String).Replace("__", "_")
|
||||
OpenProject(sLastProject)
|
||||
End Sub
|
||||
|
||||
#End Region ' OpenMruFileCommand
|
||||
@@ -566,11 +599,13 @@ Public Class ProjectManagerVM
|
||||
' provo a caricare l'ultimo file aperto
|
||||
If File.Exists(OptionModule.m_sLastProject) Then
|
||||
For Each ItemFile In CurrProject.AssemblyList
|
||||
Dim Index As Integer = 1
|
||||
If ItemFile.Name = OptionModule.m_sLastProject Then
|
||||
CurrProject.SelAssemblyName = ItemFile
|
||||
If OptionModule.m_SingleDoor Then Map.refMainWindowVM.ProjectNameMsg = OptionModule.m_sLastProject
|
||||
Return
|
||||
End If
|
||||
Index = Index + 1
|
||||
Next
|
||||
End If
|
||||
' se non esiste il file allora provo a caricare il primo della lista
|
||||
|
||||
Reference in New Issue
Block a user