diff --git a/CompoPanel/CompoPanelViewModel.vb b/CompoPanel/CompoPanelViewModel.vb index f334670..51bbba6 100644 --- a/CompoPanel/CompoPanelViewModel.vb +++ b/CompoPanel/CompoPanelViewModel.vb @@ -32,11 +32,11 @@ Public Class CompoPanelViewModel Dim CompoName As String = String.Empty Dim CompoNameDDF As String = String.Empty ' Carico un vettore con il nome delle Path delle componenti - Dim CompoDirectory As String = String.Empty - If GetPrivateProfileString(S_DOORS, K_COMPODIR, "", CompoDirectory) <> 0 Then - IniFile.m_CompoDir = CompoDirectory - End If - Dim CompoArray() As String = Directory.GetDirectories(CompoDirectory) + 'Dim CompoDirectory As String = String.Empty + 'If GetPrivateProfileString(S_DOORS, K_COMPODIR, "", CompoDirectory) <> 0 Then + IniFile.m_CompoDir = IniFile.m_sDoorsDirPath & "\Compo" + 'End If + Dim CompoArray() As String = Directory.GetDirectories(IniFile.m_CompoDir) ' carico i valori dei bottoni con un preciso ordine For IndexCompoOrder = 0 To DdfFile.CompoListOrder.Count - 1 For Index = 0 To CompoArray.Count - 1 diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index a72ffa2..a37748f 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -72,5 +72,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb index 3705102..7ba6b84 100644 --- a/OptionsWindow/OptionModule.vb +++ b/OptionsWindow/OptionModule.vb @@ -92,8 +92,8 @@ Friend Module OptionModule Dim nOptionLauncher As Integer ' leggo il valore - If Not IsNothing(CStr(GetPrivateProfileInt(S_LAUNCHERWINDOW, K_LAUNCHER, 1))) Then - nOptionLauncher = GetPrivateProfileInt(S_LAUNCHERWINDOW, K_LAUNCHER, 1) + If Not IsNothing(CStr(GetPrivateProfileInt(S_LAUNCHERWINDOW, K_LAUNCHER, 0))) Then + nOptionLauncher = GetPrivateProfileInt(S_LAUNCHERWINDOW, K_LAUNCHER, 0) End If ' leggo il direttorio della guida diff --git a/OptionsWindow/OptionsViewModel.vb b/OptionsWindow/OptionsViewModel.vb index 60f6162..ccf2366 100644 --- a/OptionsWindow/OptionsViewModel.vb +++ b/OptionsWindow/OptionsViewModel.vb @@ -639,27 +639,55 @@ Public Class OptionsViewModel ' chiedo se vuole continuare: vero se cambia li lista Private Function QuestionSetBevel(bCheckBevel As Integer) As Boolean - If bCheckBevel = 1 Then - ' controllo se to oliminando da uno degli elementi della lista: se si chiedo di continuare - If m_rfCurrDoor.LockEdgeType.Name = "BU" Or m_rfCurrDoor.LockEdgeType.Name = "BD" Or m_rfCurrDoor.HingeEdgeType.Name = "BU" Or m_rfCurrDoor.HingeEdgeType.Name = "BD" Then - ' Se blocco tutto non accade nulla - If MessageBox.Show(EgtMsg(50154), EgtMsg(50115), MessageBoxButton.YesNo, MessageBoxImage.Asterisk, MessageBoxResult.No) = MessageBoxResult.No Then - Return False + + If Not IsNothing(m_rfCurrDoor) Then + ' se la porta esiste + If bCheckBevel = 1 Then + ' controllo se sto eliminando da uno degli elementi della lista: se si chiedo di continuare + If m_rfCurrDoor.LockEdgeType.Name = "BU" Or m_rfCurrDoor.LockEdgeType.Name = "BD" Or m_rfCurrDoor.HingeEdgeType.Name = "BU" Or m_rfCurrDoor.HingeEdgeType.Name = "BD" Then + ' Se blocco tutto non accade nulla + If MessageBox.Show(EgtMsg(50154), EgtMsg(50115), MessageBoxButton.YesNo, MessageBoxImage.Asterisk, MessageBoxResult.No) = MessageBoxResult.No Then + Return False + Else + ' se decido di continuare + Return True + End If Else - ' se decido di continuare + ' se non sono presenti elementi nella lista procedo nella eliminazione Return True End If - Else - ' se non sono presenti elementi nella lista + ' se sto attivando un bevel nella lista + ElseIf bCheckBevel = 2 Then Return True + Else + ' per tutti gli altri casi (-1) non accade nulla + Return False End If - ' se sto attivando un bevel nella lista - ElseIf bCheckBevel = 2 Then - Return True + Else - ' per tutti gli altri casi (-1) non accade nulla - Return False + Return True End If + ''If bCheckBevel = 1 Then + '' ' controllo se to oliminando da uno degli elementi della lista: se si chiedo di continuare + '' If m_rfCurrDoor.LockEdgeType.Name = "BU" Or m_rfCurrDoor.LockEdgeType.Name = "BD" Or m_rfCurrDoor.HingeEdgeType.Name = "BU" Or m_rfCurrDoor.HingeEdgeType.Name = "BD" Then + '' ' Se blocco tutto non accade nulla + '' If MessageBox.Show(EgtMsg(50154), EgtMsg(50115), MessageBoxButton.YesNo, MessageBoxImage.Asterisk, MessageBoxResult.No) = MessageBoxResult.No Then + '' Return False + '' Else + '' ' se decido di continuare + '' Return True + '' End If + '' Else + '' ' se non sono presenti elementi nella lista + '' Return True + '' End If + '' ' se sto attivando un bevel nella lista + ''ElseIf bCheckBevel = 2 Then + '' Return True + ''Else + '' ' per tutti gli altri casi (-1) non accade nulla + '' Return False + ''End If End Function ' creo la lista di oggetti aggiornando la visibilità dei bevel Up e Down @@ -676,14 +704,16 @@ Public Class OptionsViewModel Door.m_EdgeTypeList(Index).IsActive = Visibility.Visible End If Next - NotifyPropertyChanged("LockEdgeType") - m_rfCurrDoor.NotifyPropertyChanged("LockEdgeType") - NotifyPropertyChanged("HingeEdgeType") - m_rfCurrDoor.NotifyPropertyChanged("HingeEdgeType") - NotifyPropertyChanged("TopType") - m_rfCurrDoor.NotifyPropertyChanged("TopType") - NotifyPropertyChanged("BottomType") - m_rfCurrDoor.NotifyPropertyChanged("BottomType") + If Not IsNothing(m_rfCurrDoor) Then + NotifyPropertyChanged("LockEdgeType") + m_rfCurrDoor.NotifyPropertyChanged("LockEdgeType") + NotifyPropertyChanged("HingeEdgeType") + m_rfCurrDoor.NotifyPropertyChanged("HingeEdgeType") + NotifyPropertyChanged("TopType") + m_rfCurrDoor.NotifyPropertyChanged("TopType") + NotifyPropertyChanged("BottomType") + m_rfCurrDoor.NotifyPropertyChanged("BottomType") + End If End Sub Public Shared Sub CreateEdgeTypeList()