-aggiornato nomi macro list
This commit is contained in:
@@ -51,8 +51,8 @@
|
||||
Grid.Row="1"
|
||||
Margin="0,5,0,0"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding MacroList}"
|
||||
SelectedIndex="{Binding nSelMacro}"
|
||||
<ComboBox ItemsSource="{Binding MacroCustomList}"
|
||||
SelectedIndex="{Binding nSelMacroCustom}"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
DisplayMemberPath="Name"
|
||||
|
||||
@@ -59,21 +59,21 @@ Public Class AddFeatureWndVM
|
||||
|
||||
#Region "New Macro OnlyProdPage"
|
||||
|
||||
Private m_NewMacroCustomList As New ObservableCollection(Of Object)
|
||||
Public ReadOnly Property NewMacroCustomList As ObservableCollection(Of Object)
|
||||
Private m_MacroDefaultList As New ObservableCollection(Of Object)
|
||||
Public ReadOnly Property MacroDefaultList As ObservableCollection(Of Object)
|
||||
Get
|
||||
Return m_NewMacroCustomList
|
||||
Return m_MacroDefaultList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nSelMacroCustom As Integer = -1
|
||||
Public Property nSelMacroCustom As Integer
|
||||
Private m_nSelMacroDefault As Integer = -1
|
||||
Public Property nSelMacroDefault As Integer
|
||||
Get
|
||||
Return m_nSelMacroCustom
|
||||
Return m_nSelMacroDefault
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
If value <> m_nSelMacroCustom Then
|
||||
m_nSelMacroCustom = value
|
||||
If value <> m_nSelMacroDefault Then
|
||||
m_nSelMacroDefault = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
@@ -97,9 +97,9 @@ Public Class AddFeatureWndVM
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(sDrawPath))
|
||||
' carico eventuali file Macro
|
||||
MacroList.Clear()
|
||||
MacroCustomList.Clear()
|
||||
If Core.Configuration.bOnlyProd Then
|
||||
NewMacroCustomList.Clear()
|
||||
MacroDefaultList.Clear()
|
||||
End If
|
||||
m_MacroFilePathList = New List(Of String)
|
||||
m_MacroCustomFilePathList = New List(Of String)
|
||||
@@ -112,7 +112,7 @@ Public Class AddFeatureWndVM
|
||||
GetMacroListDefault(nGRPFromFileName, nPRCFromFileName, sMacroNameFromFileName, nIdMacroName)
|
||||
' ricavo lista file Macro Custom
|
||||
If Core.Configuration.bOnlyProd Then GetMacroListCustom(nGRPFromFileName, nPRCFromFileName, sMacroNameFromFileName, nIdMacroName)
|
||||
If MacroList.Count > 0 Then
|
||||
If MacroCustomList.Count > 0 Then
|
||||
MacroList_IsEnabled = True
|
||||
Else
|
||||
MacroList_IsEnabled = False
|
||||
@@ -136,21 +136,21 @@ Public Class AddFeatureWndVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_MacroList As New ObservableCollection(Of Object)
|
||||
Public ReadOnly Property MacroList As ObservableCollection(Of Object)
|
||||
Private m_MacroCustomList As New ObservableCollection(Of Object)
|
||||
Public ReadOnly Property MacroCustomList As ObservableCollection(Of Object)
|
||||
Get
|
||||
Return m_MacroList
|
||||
Return m_MacroCustomList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nSelMacro As Integer = -1
|
||||
Public Property nSelMacro As Integer
|
||||
Private m_nSelMacroCustom As Integer = -1
|
||||
Public Property nSelMacroCustom As Integer
|
||||
Get
|
||||
Return m_nSelMacro
|
||||
Return m_nSelMacroCustom
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
If value <> m_nSelMacro Then
|
||||
m_nSelMacro = value
|
||||
If value <> m_nSelMacroCustom Then
|
||||
m_nSelMacroCustom = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
@@ -256,9 +256,9 @@ Public Class AddFeatureWndVM
|
||||
End If
|
||||
If nGRPFromFileName = CalcBeamPrivateProfileGRP(nSelPRC.nGRP) AndAlso nPRCFromFileName = nSelPRC.nPRC Then
|
||||
If Core.Configuration.bOnlyProd Then
|
||||
MacroList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName, Map.refMainWindowVM.MainWindowM.sMacroCustomDir & "\Template\" & sMacroNameFromFileName & ".png"))
|
||||
MacroCustomList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName, Map.refMainWindowVM.MainWindowM.sMacroCustomDir & "\Template\" & sMacroNameFromFileName & ".png"))
|
||||
Else
|
||||
MacroList.Add(New IdNameStruct(nIdMacroName, sMacroNameFromFileName))
|
||||
MacroCustomList.Add(New IdNameStruct(nIdMacroName, sMacroNameFromFileName))
|
||||
End If
|
||||
m_MacroFilePathList.Add(File)
|
||||
nIdMacroName += 1
|
||||
@@ -287,7 +287,7 @@ Public Class AddFeatureWndVM
|
||||
sMacroNameFromFileName = DataFromFileName(1)
|
||||
End If
|
||||
If nGRPFromFileName = CalcBeamPrivateProfileGRP(nSelPRC.nGRP) AndAlso nPRCFromFileName = nSelPRC.nPRC Then
|
||||
NewMacroCustomList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName))
|
||||
MacroDefaultList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName))
|
||||
m_MacroCustomFilePathList.Add(File)
|
||||
nIdMacroName += 1
|
||||
End If
|
||||
|
||||
@@ -65,8 +65,8 @@
|
||||
<TextBlock Text="{Binding Custom_Msg}"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource ListTextBlock}"/>
|
||||
<ListBox ItemsSource="{Binding MacroList}"
|
||||
SelectedIndex="{Binding nSelMacro}"
|
||||
<ListBox ItemsSource="{Binding MacroCustomList}"
|
||||
SelectedIndex="{Binding nSelMacroCustom}"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
@@ -101,8 +101,8 @@
|
||||
<TextBlock Text="{Binding Default_Msg}"
|
||||
Grid.Column="2"
|
||||
Style="{StaticResource ListTextBlock}"/>
|
||||
<ListBox ItemsSource="{Binding NewMacroCustomList}"
|
||||
SelectedIndex="{Binding nSelMacroCustom}"
|
||||
<ListBox ItemsSource="{Binding MacroDefaultList}"
|
||||
SelectedIndex="{Binding nSelMacroDefault}"
|
||||
Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
BorderThickness="0"
|
||||
|
||||
@@ -125,7 +125,7 @@ Public Class FeatureListManagerVM
|
||||
' Creo table e setto variabili
|
||||
CreateMacroTable()
|
||||
Dim bOk As Boolean
|
||||
If AddFeatureWndVM.nSelMacroCustom >= 0 Then
|
||||
If AddFeatureWndVM.nSelMacroDefault >= 0 Then
|
||||
bOk = EgtLuaExecFile(AddFeatureWndVM.m_MacroCustomFilePathList(nSelMacro))
|
||||
Else
|
||||
bOk = EgtLuaExecFile(AddFeatureWndVM.m_MacroFilePathList(nSelMacro))
|
||||
@@ -296,17 +296,17 @@ Public Class FeatureListManagerVM
|
||||
Dim AddNewFeatureWnd As New NewAddFeatureWndV(Application.Current.MainWindow, AddFeatureWndVM)
|
||||
If AddNewFeatureWnd.ShowDialog() Then
|
||||
' verifico se una Macro è selezionata
|
||||
If AddFeatureWndVM.nSelMacroCustom >= 0 Then
|
||||
CreateNewFeature(AddFeatureWndVM.NewMacroCustomList.Count, AddFeatureWndVM.nSelMacroCustom, AddFeatureWndVM, nNewFeatureId, bMacroFlag, NewFeat)
|
||||
If AddFeatureWndVM.nSelMacroDefault >= 0 Then
|
||||
CreateNewFeature(AddFeatureWndVM.MacroDefaultList.Count, AddFeatureWndVM.nSelMacroDefault, AddFeatureWndVM, nNewFeatureId, bMacroFlag, NewFeat)
|
||||
Else
|
||||
CreateNewFeature(AddFeatureWndVM.MacroList.Count, AddFeatureWndVM.nSelMacro, AddFeatureWndVM, nNewFeatureId, bMacroFlag, NewFeat)
|
||||
CreateNewFeature(AddFeatureWndVM.MacroCustomList.Count, AddFeatureWndVM.nSelMacroCustom, AddFeatureWndVM, nNewFeatureId, bMacroFlag, NewFeat)
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
Dim AddFeatureWnd As New AddFeatureWndV(Application.Current.MainWindow, AddFeatureWndVM)
|
||||
If AddFeatureWnd.ShowDialog() Then
|
||||
' verifico se una Macro è selezionata
|
||||
CreateNewFeature(AddFeatureWndVM.MacroList.Count, AddFeatureWndVM.nSelMacro, AddFeatureWndVM, nNewFeatureId, bMacroFlag, NewFeat)
|
||||
CreateNewFeature(AddFeatureWndVM.MacroCustomList.Count, AddFeatureWndVM.nSelMacroCustom, AddFeatureWndVM, nNewFeatureId, bMacroFlag, NewFeat)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -93,7 +93,7 @@ Public Class MacroFeatureWndVM
|
||||
|
||||
Public ReadOnly Property bCustomVisibility As Visibility
|
||||
Get
|
||||
Return If(Map.refMainWindowVM.MainWindowM.nUserLevel > 5, Visibility.Visible, Visibility.Collapsed)
|
||||
Return If(Map.refMainWindowVM.MainWindowM.nUserLevel >= 10, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -197,10 +197,10 @@ Public Class MacroFeatureWndVM
|
||||
"MACRO.PROCID") 'nSelFeature.ParentPart.NewProcId() &
|
||||
Next
|
||||
If bOnlyProd Then
|
||||
If m_bIsCustomChecked AndAlso Map.refMainWindowVM.MainWindowM.nUserLevel > 5 Then
|
||||
File.WriteAllLines(Map.refMainWindowVM.MainWindowM.sMacroCustomDir & "\" & FileName & ".lua", FileContent, Text.Encoding.UTF8)
|
||||
ElseIf Not bIsCustomChecked AndAlso Map.refMainWindowVM.MainWindowM.nUserLevel > 5 Then
|
||||
If m_bIsCustomChecked AndAlso Map.refMainWindowVM.MainWindowM.nUserLevel >= 10 Then
|
||||
File.WriteAllLines(Map.refMainWindowVM.MainWindowM.sMacroDefaultDir & "\" & FileName & ".lua", FileContent, Text.Encoding.UTF8)
|
||||
ElseIf Not bIsCustomChecked AndAlso Map.refMainWindowVM.MainWindowM.nUserLevel >= 10 Then
|
||||
File.WriteAllLines(Map.refMainWindowVM.MainWindowM.sMacroCustomDir & "\" & FileName & ".lua", FileContent, Text.Encoding.UTF8)
|
||||
Else
|
||||
File.WriteAllLines(Map.refMainWindowVM.MainWindowM.sMacroDefaultDir & "\" & FileName & ".lua", FileContent, Text.Encoding.UTF8)
|
||||
End If
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<CheckBox Content="Custom Macro"
|
||||
<CheckBox Content="Default Macro"
|
||||
IsChecked="{Binding bIsCustomChecked}"
|
||||
Visibility="{Binding bCustomVisibility}"
|
||||
Grid.Column="2"
|
||||
|
||||
Reference in New Issue
Block a user