-aggiunto livello utenza per strategie
This commit is contained in:
@@ -272,6 +272,9 @@
|
||||
<Compile Include="StrategyManager\StrategyV.xaml.vb">
|
||||
<DependentUpon>StrategyV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="StrategyManager\UserAdminV.xaml.vb">
|
||||
<DependentUpon>UserAdminV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SupervisorCommThread\SupervisorComm.vb" />
|
||||
<Compile Include="SupervisorCommThread\SupervisorCommThread.vb" />
|
||||
<Compile Include="ToolsDbWindow\MyToolDbWindowVM.vb" />
|
||||
@@ -776,6 +779,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="StrategyManager\UserAdminV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="UpdateBTLWnd\OnlyProdUpdateBTLWndV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -1117,6 +1124,9 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewPage\configurationIsChecked.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewPage\padlock.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.OptimizerR32.exe
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
<UserControl x:Class="ForcedStrategyBTLV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:Optmizer="clr-namespace:EgtBEAMWALL.Optimizer">
|
||||
xmlns:Optimizer="clr-namespace:EgtBEAMWALL.Optimizer">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Margin="2,0,2,0"
|
||||
Grid.RowSpan="2"
|
||||
Style="{StaticResource OnlyProdPage_Border}">
|
||||
<ListBox ItemsSource="{Binding StrategyList}"
|
||||
SelectedItem="{Binding SelStrategy}"
|
||||
@@ -16,7 +21,7 @@
|
||||
HorizontalAlignment="Left"
|
||||
Style="{StaticResource NewAddFeature_ListBox}">
|
||||
<ListBox.Resources>
|
||||
<DataTemplate DataType="{x:Type Optmizer:Strategy}">
|
||||
<DataTemplate DataType="{x:Type Optimizer:Strategy}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton IsChecked="{Binding IsSelected, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}"
|
||||
GroupName="ForcedStrategy"/>
|
||||
@@ -37,7 +42,10 @@
|
||||
</ListBox>
|
||||
</Border>
|
||||
|
||||
<GroupBox Grid.Column="1"
|
||||
<Optimizer:UserAdminV Grid.Column="1" Tag="{Binding SelStrategy}"/>
|
||||
|
||||
<GroupBox Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Foreground="Black"
|
||||
BorderThickness="2"
|
||||
Margin="0,-5,0,0"
|
||||
@@ -47,7 +55,7 @@
|
||||
FontWeight="Bold"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</GroupBox.Header>
|
||||
<Optmizer:ParameterStrategyV Tag="{Binding SelStrategy}"/>
|
||||
<Optimizer:ParameterStrategyV Tag="{Binding SelStrategy}"/>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtBEAMWALL.Optimizer.StrategyManagerVM
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports Newtonsoft.Json
|
||||
@@ -29,17 +30,78 @@ Public Class ForcedStrategyBTLVM
|
||||
End Get
|
||||
Set(value As Strategy)
|
||||
m_SelStrategy = value
|
||||
If Map.refStrategyManagerVM.bOK AndAlso Not IsNothing(m_SelStrategy) Then
|
||||
For Each Param As StrategyParameter In m_SelStrategy.ParameterList
|
||||
' Rendo visibili i parametri che hanno sMinUserLevel a 10
|
||||
SetUserAdmin_IsChecked(True)
|
||||
Map.refStrategyManagerVM.UserLevelVisibility(Param, Visibility.Visible)
|
||||
Next
|
||||
End If
|
||||
If m_bUserAdmin_IsChecked AndAlso Not IsNothing(m_SelStrategy) Then
|
||||
Map.refStrategyManagerVM.ShowParamStrategy(m_SelStrategy)
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(SelStrategy))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ForcedStrategyBTL_Visibility As Visibility
|
||||
Private m_bUserAdmin_IsChecked As Boolean = False
|
||||
Public Property UserAdmin_IsChecked As Boolean
|
||||
Get
|
||||
Return If(Map.refMainWindowVM.MainWindowM.nUserLevel > 5, Visibility.Visible, Visibility.Collapsed)
|
||||
Return m_bUserAdmin_IsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bUserAdmin_IsChecked = value
|
||||
Map.refStrategyManagerVM.ShowParamStrategy(m_SelStrategy)
|
||||
NotifyPropertyChanged(NameOf(UserAdmin_IsChecked))
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetUserAdmin_IsChecked(value As Boolean)
|
||||
m_bUserAdmin_IsChecked = value
|
||||
NotifyPropertyChanged(NameOf(UserAdmin_IsChecked))
|
||||
End Sub
|
||||
|
||||
Private m_UserFontWeight As FontWeight = FontWeights.Bold
|
||||
Public ReadOnly Property UserFontWeight As FontWeight
|
||||
Get
|
||||
Return m_UserFontWeight
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetUserFontWeight(value As FontWeight)
|
||||
m_UserFontWeight = value
|
||||
NotifyPropertyChanged(NameOf(UserFontWeight))
|
||||
End Sub
|
||||
|
||||
Private m_AdminFontWeight As FontWeight = FontWeights.Normal
|
||||
Public ReadOnly Property AdminFontWeight As FontWeight
|
||||
Get
|
||||
Return m_AdminFontWeight
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetAdminFontWeight(value As FontWeight)
|
||||
m_AdminFontWeight = value
|
||||
NotifyPropertyChanged(NameOf(AdminFontWeight))
|
||||
End Sub
|
||||
|
||||
Private m_CurrentFeature As BTLFeatureM
|
||||
|
||||
' Definizione Comandi
|
||||
Private m_UnlockAllCommand As ICommand
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property UserMsg As String
|
||||
Get
|
||||
Return EgtMsg(61748)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_CurrentFeature As BTLFeatureM
|
||||
Public ReadOnly Property AdminMsg As String
|
||||
Get
|
||||
Return EgtMsg(61749)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' Fields & Properties
|
||||
|
||||
@@ -224,4 +286,35 @@ Public Class ForcedStrategyBTLVM
|
||||
|
||||
#End Region ' Methods
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "UnlockAllCommand"
|
||||
|
||||
Public ReadOnly Property UnlockAllCommand As ICommand
|
||||
Get
|
||||
If m_UnlockAllCommand Is Nothing Then
|
||||
m_UnlockAllCommand = New Command(AddressOf UnlockAll)
|
||||
End If
|
||||
Return m_UnlockAllCommand
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Funzione sblocca tutti paramatri delle strategie con una password
|
||||
''' </summary>
|
||||
Public Sub UnlockAll()
|
||||
Map.refStrategyManagerVM.UnLockParameter(m_SelStrategy)
|
||||
For Each Param As StrategyParameter In m_SelStrategy.ParameterList
|
||||
If Param.sMinUserLevel >= UserLevel.MEDIUM Then
|
||||
' Rendo visibili i parametri che hanno sMinUserLevel a 10
|
||||
SetUserAdmin_IsChecked(True)
|
||||
Map.refStrategyManagerVM.UserLevelVisibility(Param, Visibility.Visible)
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' UnlockAllCommand
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
End Class
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<UserControl x:Class="ForcedStrategyPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:Optmizer="clr-namespace:EgtBEAMWALL.Optimizer">
|
||||
xmlns:Optimizer="clr-namespace:EgtBEAMWALL.Optimizer">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
@@ -11,7 +12,8 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Margin="2,0,2,0"
|
||||
<Border Grid.RowSpan="2"
|
||||
Margin="2,0,2,0"
|
||||
Style="{StaticResource OnlyProdPage_Border}">
|
||||
<ListBox ItemsSource="{Binding StrategyList}"
|
||||
SelectedItem="{Binding SelStrategy}"
|
||||
@@ -19,7 +21,7 @@
|
||||
IsSynchronizedWithCurrentItem="True"
|
||||
Style="{StaticResource NewAddFeature_ListBox}">
|
||||
<ListBox.Resources>
|
||||
<DataTemplate DataType="{x:Type Optmizer:Strategy}">
|
||||
<DataTemplate DataType="{x:Type Optimizer:Strategy}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton IsChecked="{Binding IsSelected, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}"
|
||||
GroupName="ForcedStrategy"/>
|
||||
@@ -40,7 +42,10 @@
|
||||
</ListBox>
|
||||
</Border>
|
||||
|
||||
<GroupBox Grid.Column="1"
|
||||
<Optimizer:UserAdminV Grid.Column="1" Tag="{Binding SelStrategy}"/>
|
||||
|
||||
<GroupBox Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Foreground="Black"
|
||||
BorderThickness="2"
|
||||
Margin="0,-5,0,0"
|
||||
@@ -50,7 +55,7 @@
|
||||
FontWeight="Bold"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</GroupBox.Header>
|
||||
<Optmizer:ParameterStrategyV Tag="{Binding SelStrategy}"/>
|
||||
<Optimizer:ParameterStrategyV Tag="{Binding SelStrategy}"/>
|
||||
</GroupBox>
|
||||
|
||||
<StackPanel Grid.Row="2"
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtBEAMWALL.Optimizer.StrategyManagerVM
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports Newtonsoft.Json
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class ForcedStrategyPanelVM
|
||||
Inherits VMBase
|
||||
@@ -29,21 +30,80 @@ Public Class ForcedStrategyPanelVM
|
||||
End Get
|
||||
Set(value As Strategy)
|
||||
m_SelStrategy = value
|
||||
If Map.refStrategyManagerVM.bOK AndAlso Not IsNothing(m_SelStrategy) Then
|
||||
For Each Param As StrategyParameter In m_SelStrategy.ParameterList
|
||||
' Rendo visibili i parametri che hanno sMinUserLevel a 10
|
||||
SetUserAdmin_IsChecked(True)
|
||||
Map.refStrategyManagerVM.UserLevelVisibility(Param, Visibility.Visible)
|
||||
Next
|
||||
End If
|
||||
If m_bUserAdmin_IsChecked AndAlso Not IsNothing(m_SelStrategy) Then
|
||||
Map.refStrategyManagerVM.ShowParamStrategy(m_SelStrategy)
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(SelStrategy))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ForcedStrategy_Visibility As Visibility
|
||||
Private m_bUserAdmin_IsChecked As Boolean = False
|
||||
Public Property UserAdmin_IsChecked As Boolean
|
||||
Get
|
||||
Return If(Map.refMainWindowVM.MainWindowM.nUserLevel > 5, Visibility.Visible, Visibility.Collapsed)
|
||||
Return m_bUserAdmin_IsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bUserAdmin_IsChecked = value
|
||||
Map.refStrategyManagerVM.ShowParamStrategy(m_SelStrategy)
|
||||
NotifyPropertyChanged(NameOf(UserAdmin_IsChecked))
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetUserAdmin_IsChecked(value As Boolean)
|
||||
m_bUserAdmin_IsChecked = value
|
||||
NotifyPropertyChanged(NameOf(UserAdmin_IsChecked))
|
||||
End Sub
|
||||
|
||||
Private m_UserFontWeight As FontWeight = FontWeights.Bold
|
||||
Public ReadOnly Property UserFontWeight As FontWeight
|
||||
Get
|
||||
Return m_UserFontWeight
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetUserFontWeight(value As FontWeight)
|
||||
m_UserFontWeight = value
|
||||
NotifyPropertyChanged(NameOf(UserFontWeight))
|
||||
End Sub
|
||||
|
||||
Private m_AdminFontWeight As FontWeight = FontWeights.Normal
|
||||
Public ReadOnly Property AdminFontWeight As FontWeight
|
||||
Get
|
||||
Return m_AdminFontWeight
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetAdminFontWeight(value As FontWeight)
|
||||
m_AdminFontWeight = value
|
||||
NotifyPropertyChanged(NameOf(AdminFontWeight))
|
||||
End Sub
|
||||
|
||||
Private m_CurrentFeature As BTLFeatureM
|
||||
|
||||
' Definizione Comandi
|
||||
Private m_cmdOk As ICommand
|
||||
Private m_cmdCancel As ICommand
|
||||
Private m_UnlockAllCommand As ICommand
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property UserMsg As String
|
||||
Get
|
||||
Return EgtMsg(61748)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property AdminMsg As String
|
||||
Get
|
||||
Return EgtMsg(61749)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region ' Fields & Properties
|
||||
|
||||
@@ -265,6 +325,33 @@ Public Class ForcedStrategyPanelVM
|
||||
|
||||
#End Region ' Cancel_Command
|
||||
|
||||
#Region "UnlockAllCommand"
|
||||
|
||||
Public ReadOnly Property UnlockAllCommand As ICommand
|
||||
Get
|
||||
If m_UnlockAllCommand Is Nothing Then
|
||||
m_UnlockAllCommand = New Command(AddressOf UnlockAll)
|
||||
End If
|
||||
Return m_UnlockAllCommand
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Funzione sblocca tutti paramatri delle strategie con una password
|
||||
''' </summary>
|
||||
Public Sub UnlockAll()
|
||||
Map.refStrategyManagerVM.UnLockParameter(m_SelStrategy)
|
||||
For Each Param As StrategyParameter In m_SelStrategy.ParameterList
|
||||
If Param.sMinUserLevel >= UserLevel.MEDIUM Then
|
||||
' Rendo visibili i parametri che hanno sMinUserLevel a 10
|
||||
SetUserAdmin_IsChecked(True)
|
||||
Map.refStrategyManagerVM.UserLevelVisibility(Param, Visibility.Visible)
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' UnlockAllCommand
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
End Class
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -427,20 +427,35 @@ Public Class JsonDefaultStrategyParameter
|
||||
Case "b"
|
||||
StrategyParameter = New BooleanStrategyParameter()
|
||||
DirectCast(StrategyParameter, BooleanStrategyParameter).SetValue(m_sValue)
|
||||
If m_sMinUserLevel = 1 Then
|
||||
DirectCast(StrategyParameter, BooleanStrategyParameter).SetbBooleanVisibility(Visibility.Visible)
|
||||
End If
|
||||
Case "d"
|
||||
StrategyParameter = New DoubleStrategyParameter()
|
||||
DirectCast(StrategyParameter, DoubleStrategyParameter).SetValue(m_sValue)
|
||||
If m_sMinUserLevel = 1 Then
|
||||
DirectCast(StrategyParameter, DoubleStrategyParameter).SetbDoubleVisibility(Visibility.Visible)
|
||||
End If
|
||||
Case "combo"
|
||||
StrategyParameter = New ComboStrategyParameter()
|
||||
For Each Choice In Choices
|
||||
DirectCast(StrategyParameter, ComboStrategyParameter).ComboList.Add(Choice.Deserialize())
|
||||
Next
|
||||
DirectCast(StrategyParameter, ComboStrategyParameter).SetSelValue(m_sValue)
|
||||
If m_sMinUserLevel = 1 Then
|
||||
DirectCast(StrategyParameter, ComboStrategyParameter).SetbComboBoxVisibility(Visibility.Visible)
|
||||
End If
|
||||
Case "tool"
|
||||
StrategyParameter = New ListStrategyParameter(m_sSubType)
|
||||
If m_sMinUserLevel = 1 Then
|
||||
DirectCast(StrategyParameter, ListStrategyParameter).SetbListBoxVisibility(Visibility.Visible)
|
||||
End If
|
||||
Case "s"
|
||||
StrategyParameter = New StringStrategyParameter()
|
||||
DirectCast(StrategyParameter, StringStrategyParameter).SetValue(m_sValue)
|
||||
If m_sMinUserLevel = 1 Then
|
||||
DirectCast(StrategyParameter, StringStrategyParameter).SetbStringVisibility(Visibility.Visible)
|
||||
End If
|
||||
Case Else
|
||||
EgtOutLog("Tipo: " & m_sType & " non presente")
|
||||
Return Nothing
|
||||
|
||||
@@ -182,16 +182,6 @@ Public Class JsonStrategy
|
||||
Next
|
||||
End Sub
|
||||
|
||||
'Friend Function Deserialize(StrategyIndex As Integer) As Strategy
|
||||
' Dim Strategy As New Strategy() With {.sStrategyID = m_sStrategyID,
|
||||
' .nIndexInList = StrategyIndex}
|
||||
' ' Recupero file StrategyJson
|
||||
' For Each Parameter In ParameterList
|
||||
' Strategy.ParameterList.Add(Parameter.Deserialize())
|
||||
' Next
|
||||
' Return Strategy
|
||||
'End Function
|
||||
|
||||
#End Region ' Constructor
|
||||
|
||||
End Class
|
||||
@@ -257,23 +247,37 @@ Public Class JsonStrategyParameter
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sMinUserLevel As Integer
|
||||
<JsonIgnore>
|
||||
Public Property sMinUserLevel As Integer
|
||||
Get
|
||||
Return m_sMinUserLevel
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_sMinUserLevel = value
|
||||
NotifyPropertyChanged(NameOf(sMinUserLevel))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Fields & Propeties
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
<JsonConstructor>
|
||||
Sub New(sName As String, sNameNge As String, sValue As String, sType As String, sSubType As String)
|
||||
Sub New(sName As String, sNameNge As String, sValue As String, sType As String, sSubType As String, nMinUserLevel As Integer)
|
||||
m_sName = sName
|
||||
m_sNameNge = sNameNge
|
||||
m_sValue = sValue
|
||||
m_sType = sType
|
||||
m_sSubType = sSubType
|
||||
m_sMinUserLevel = nMinUserLevel
|
||||
End Sub
|
||||
|
||||
Sub New(StrategyParameter As StrategyParameter)
|
||||
m_sName = StrategyParameter.sName
|
||||
m_sNameNge = StrategyParameter.sNameNge
|
||||
m_sSubType = StrategyParameter.sSubType
|
||||
m_sMinUserLevel = StrategyParameter.sMinUserLevel
|
||||
Select Case StrategyParameter.GetType()
|
||||
Case GetType(BooleanStrategyParameter)
|
||||
m_sValue = If(DirectCast(StrategyParameter, BooleanStrategyParameter).bValue, "true", "false")
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
<ItemsControl.Resources>
|
||||
<DataTemplate DataType="{x:Type Optmizer:BooleanStrategyParameter}">
|
||||
<UniformGrid Columns="2"
|
||||
Margin="5,2,5,0">
|
||||
Margin="5,2,5,0"
|
||||
Visibility="{Binding bBooleanVisibility}">
|
||||
<TextBlock Text="{Binding sDescriptionShort}"
|
||||
HorizontalAlignment="Left"
|
||||
TextWrapping="WrapWithOverflow"
|
||||
@@ -22,7 +23,8 @@
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type Optmizer:DoubleStrategyParameter}">
|
||||
<UniformGrid Columns="2"
|
||||
Margin="5,2,5,0">
|
||||
Margin="5,2,5,0"
|
||||
Visibility="{Binding bDoubleVisibility}">
|
||||
<TextBlock Text="{Binding sDescriptionShort}"
|
||||
HorizontalAlignment="Left"
|
||||
TextWrapping="WrapWithOverflow"
|
||||
@@ -33,7 +35,8 @@
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type Optmizer:ComboStrategyParameter}">
|
||||
<UniformGrid Columns="2"
|
||||
Margin="5,2,5,0">
|
||||
Margin="5,2,5,0"
|
||||
Visibility="{Binding bComboBoxVisibility}">
|
||||
<TextBlock Text="{Binding sDescriptionShort}"
|
||||
HorizontalAlignment="Left"
|
||||
TextWrapping="WrapWithOverflow"
|
||||
@@ -49,7 +52,8 @@
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type Optmizer:StringStrategyParameter}">
|
||||
<UniformGrid Columns="2"
|
||||
Margin="5,2,5,0">
|
||||
Margin="5,2,5,0"
|
||||
Visibility="{Binding bStringVisibility}">
|
||||
<TextBlock Text="{Binding sDescriptionShort}"
|
||||
HorizontalAlignment="Left"
|
||||
TextWrapping="WrapWithOverflow"
|
||||
@@ -59,7 +63,8 @@
|
||||
</UniformGrid>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type Optmizer:ListStrategyParameter}">
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid Margin="5,5,5,0"
|
||||
Visibility="{Binding bListBoxVisibility}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
</StackPanel>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
@@ -51,7 +52,7 @@
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border Grid.RowSpan="2"
|
||||
<Border Grid.RowSpan="3"
|
||||
Style="{StaticResource OnlyProdPage_Border}">
|
||||
<TreeView BorderThickness="0"
|
||||
Width="300"
|
||||
@@ -90,11 +91,14 @@
|
||||
</TreeView.ItemContainerStyle>
|
||||
</TreeView>
|
||||
</Border>
|
||||
|
||||
<Optimizer:StrategyV Grid.Column="1"
|
||||
Grid.RowSpan="2"/>
|
||||
|
||||
<GroupBox Grid.Column="2"
|
||||
<Optimizer:StrategyV Grid.Column="1"
|
||||
Grid.RowSpan="3"/>
|
||||
|
||||
<Optimizer:UserAdminV Grid.Column="2" Tag="{Binding SelTreeItem.SelParamStrategy}"/>
|
||||
|
||||
<GroupBox Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Foreground="Black"
|
||||
BorderThickness="2"
|
||||
Margin="0,-11,0,0"
|
||||
@@ -107,7 +111,7 @@
|
||||
<Optimizer:ParameterStrategyV Tag="{Binding SelTreeItem.SelParamStrategy}"/>
|
||||
</GroupBox>
|
||||
|
||||
<StackPanel Grid.Row="1"
|
||||
<StackPanel Grid.Row="2"
|
||||
Grid.Column="2"
|
||||
Width="600"/>
|
||||
</Grid>
|
||||
|
||||
@@ -3,6 +3,7 @@ Imports System.ComponentModel
|
||||
Imports System.Globalization
|
||||
Imports System.IO
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtBEAMWALL.Optimizer.StrategyManagerVM
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports Newtonsoft.Json
|
||||
@@ -12,6 +13,12 @@ Public Class StrategyManagerVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Public Enum UserLevel As Integer
|
||||
BASE = 1
|
||||
MEDIUM = 5
|
||||
FULL = 10
|
||||
End Enum
|
||||
|
||||
Private m_StrategyTypeList As New List(Of IdNameStruct)({New IdNameStruct(BWType.BEAM, "Beam"), New IdNameStruct(BWType.WALL, "Wall")})
|
||||
Public ReadOnly Property StrategyTypeList As List(Of IdNameStruct)
|
||||
Get
|
||||
@@ -148,6 +155,55 @@ Public Class StrategyManagerVM
|
||||
NotifyPropertyChanged(NameOf(StrategyManager_Visibility))
|
||||
End Sub
|
||||
|
||||
Private m_bUserAdmin_IsChecked As Boolean = False
|
||||
Public Property UserAdmin_IsChecked As Boolean
|
||||
Get
|
||||
Return m_bUserAdmin_IsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bUserAdmin_IsChecked = value
|
||||
ShowParamStrategy(m_SelTreeItem.SelParamStrategy)
|
||||
NotifyPropertyChanged(NameOf(UserAdmin_IsChecked))
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetUserAdmin_IsChecked(value As Boolean)
|
||||
m_bUserAdmin_IsChecked = value
|
||||
NotifyPropertyChanged(NameOf(UserAdmin_IsChecked))
|
||||
End Sub
|
||||
|
||||
Private m_UserFontWeight As FontWeight = FontWeights.Bold
|
||||
Public ReadOnly Property UserFontWeight As FontWeight
|
||||
Get
|
||||
Return m_UserFontWeight
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetUserFontWeight(value As FontWeight)
|
||||
m_UserFontWeight = value
|
||||
NotifyPropertyChanged(NameOf(UserFontWeight))
|
||||
End Sub
|
||||
|
||||
Private m_AdminFontWeight As FontWeight = FontWeights.Normal
|
||||
Public ReadOnly Property AdminFontWeight As FontWeight
|
||||
Get
|
||||
Return m_AdminFontWeight
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetAdminFontWeight(value As FontWeight)
|
||||
m_AdminFontWeight = value
|
||||
NotifyPropertyChanged(NameOf(AdminFontWeight))
|
||||
End Sub
|
||||
|
||||
Private m_bOK As Boolean = False
|
||||
Public ReadOnly Property bOK As Boolean
|
||||
Get
|
||||
Return m_bOK
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetbOk(value As Boolean)
|
||||
m_bOK = value
|
||||
NotifyPropertyChanged(NameOf(bOK))
|
||||
End Sub
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property SaveToolTip As String
|
||||
@@ -168,6 +224,18 @@ Public Class StrategyManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property UserMsg As String
|
||||
Get
|
||||
Return EgtMsg(61748)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property AdminMsg As String
|
||||
Get
|
||||
Return EgtMsg(61749)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
' Definizione Comandi
|
||||
@@ -180,6 +248,7 @@ Public Class StrategyManagerVM
|
||||
Private m_MoveDownSelectedStrategyCommand As ICommand
|
||||
Private m_cmdOk As ICommand
|
||||
Private m_cmdCancel As ICommand
|
||||
Private m_UnlockAllCommand As ICommand
|
||||
|
||||
#End Region ' Field & Properties
|
||||
|
||||
@@ -188,20 +257,8 @@ Public Class StrategyManagerVM
|
||||
Sub New()
|
||||
' Setto riferimento
|
||||
Map.SetRefStrategyManagerVM(Me)
|
||||
'' imposto Type a primo della lista per default
|
||||
'Select Case CurrentMachine.nType
|
||||
' Case MachineType.BEAM
|
||||
' m_SelStrategyType = m_StrategyTypeList.FirstOrDefault(Function(x) x.Id = BWType.BEAM)
|
||||
' Case MachineType.WALL
|
||||
' m_SelStrategyType = m_StrategyTypeList.FirstOrDefault(Function(x) x.Id = BWType.WALL)
|
||||
' Case MachineType.BOTH
|
||||
' m_SelStrategyType = m_StrategyTypeList.FirstOrDefault(Function(x) x.Id = BWType.BEAM)
|
||||
'End Select
|
||||
'NotifyPropertyChanged(NameOf(StrategyType_Visibility))
|
||||
' Assegno riferimento funzione per aggiornare elemento selezionato dall'albero
|
||||
Topology.refUpdateSelTreeItem = AddressOf UpdateSelTreeItem
|
||||
'' aggiorno liste
|
||||
'Update()
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
@@ -246,6 +303,69 @@ Public Class StrategyManagerVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Funzione che gestisce la visibilità dei parametri in base al livello utente
|
||||
''' </summary>
|
||||
''' <param name="Param"></param>
|
||||
Friend Sub UserLevelVisibility(Param As StrategyParameter, Visibility As Visibility)
|
||||
Select Case Param.GetType()
|
||||
Case GetType(BooleanStrategyParameter)
|
||||
DirectCast(Param, BooleanStrategyParameter).SetbBooleanVisibility(Visibility)
|
||||
Case GetType(DoubleStrategyParameter)
|
||||
DirectCast(Param, DoubleStrategyParameter).SetbDoubleVisibility(Visibility)
|
||||
Case GetType(ComboStrategyParameter)
|
||||
DirectCast(Param, ComboStrategyParameter).SetbComboBoxVisibility(Visibility)
|
||||
Case GetType(StringStrategyParameter)
|
||||
DirectCast(Param, StringStrategyParameter).SetbStringVisibility(Visibility)
|
||||
Case GetType(ListStrategyParameter)
|
||||
DirectCast(Param, ListStrategyParameter).SetbListBoxVisibility(Visibility)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Friend Sub ShowParamStrategy(Strategy As Strategy)
|
||||
SetAdminFontWeight(If(m_bUserAdmin_IsChecked, FontWeights.Bold, FontWeights.Normal))
|
||||
SetUserFontWeight(If(m_bUserAdmin_IsChecked, FontWeights.Normal, FontWeights.Bold))
|
||||
For Each Param As StrategyParameter In m_SelTreeItem.SelParamStrategy.ParameterList
|
||||
Select Case Param.sMinUserLevel
|
||||
Case UserLevel.MEDIUM
|
||||
UserLevelVisibility(Param, If(m_bUserAdmin_IsChecked, Visibility.Visible, Visibility.Collapsed))
|
||||
Case Else
|
||||
If Not m_bUserAdmin_IsChecked Then
|
||||
UserLevelVisibility(Param, If(Param.sMinUserLevel = UserLevel.BASE, Visibility.Visible, Visibility.Collapsed))
|
||||
End If
|
||||
End Select
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Friend Sub UnLockParameter(Strategy As Strategy)
|
||||
Dim InputPwdWndVM As New InputPwdWndVM()
|
||||
Dim InputPwdWnd As New OnlyProdInputPwdWndV(Application.Current.MainWindow, InputPwdWndVM)
|
||||
Dim sPwdIni As String = String.Empty
|
||||
If InputPwdWnd.ShowDialog() Then
|
||||
If GetMainPrivateProfileString("Strategy", "ParamPassword", "", sPwdIni) <> 0 Then
|
||||
If sPwdIni <> InputPwdWndVM.sPassword Then
|
||||
MessageBox.Show("Password Errata", EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
SetAdminFontWeight(If(m_bUserAdmin_IsChecked, FontWeights.Bold, FontWeights.Normal))
|
||||
SetUserFontWeight(If(m_bUserAdmin_IsChecked, FontWeights.Normal, FontWeights.Bold))
|
||||
SetbOk(True)
|
||||
End Sub
|
||||
|
||||
Friend Sub UnLockStrategyParam(Strategy As Strategy)
|
||||
If Map.refStrategyManagerVM.bOK AndAlso Not IsNothing(Strategy) Then
|
||||
For Each Param As StrategyParameter In Strategy.ParameterList
|
||||
' Rendo visibili i parametri che hanno sMinUserLevel a 10
|
||||
Map.refStrategyManagerVM.SetUserAdmin_IsChecked(True)
|
||||
Map.refStrategyManagerVM.UserLevelVisibility(Param, Visibility.Visible)
|
||||
Next
|
||||
End If
|
||||
If Map.refStrategyManagerVM.UserAdmin_IsChecked AndAlso Not IsNothing(Strategy) Then
|
||||
Map.refStrategyManagerVM.ShowParamStrategy(Strategy)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Methods
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -486,6 +606,33 @@ Public Class StrategyManagerVM
|
||||
|
||||
#End Region ' Cancel_Command
|
||||
|
||||
#Region "UnlockAllCommand"
|
||||
|
||||
Public ReadOnly Property UnlockAllCommand As ICommand
|
||||
Get
|
||||
If m_UnlockAllCommand Is Nothing Then
|
||||
m_UnlockAllCommand = New Command(AddressOf UnlockAll)
|
||||
End If
|
||||
Return m_UnlockAllCommand
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Funzione sblocca tutti paramatri delle strategie con una password
|
||||
''' </summary>
|
||||
Public Sub UnlockAll()
|
||||
UnLockParameter(m_SelTreeItem.SelParamStrategy)
|
||||
For Each Param As StrategyParameter In m_SelTreeItem.SelParamStrategy.ParameterList
|
||||
If Param.sMinUserLevel >= UserLevel.MEDIUM Then
|
||||
' Rendo visibili i parametri che hanno sMinUserLevel a 10
|
||||
Map.refStrategyManagerVM.SetUserAdmin_IsChecked(True)
|
||||
UserLevelVisibility(Param, Visibility.Visible)
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' UnlockAllCommand
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
End Class
|
||||
@@ -790,6 +937,7 @@ Public Class Topology
|
||||
End Get
|
||||
Set(value As Strategy)
|
||||
m_SelParamStrategy = value
|
||||
Map.refStrategyManagerVM.UnLockStrategyParam(m_SelParamStrategy)
|
||||
NotifyPropertyChanged(NameOf(SelParamStrategy))
|
||||
End Set
|
||||
End Property
|
||||
@@ -951,16 +1099,31 @@ Public Class Strategy
|
||||
Select Case DefaultParameter.GetType()
|
||||
Case GetType(BooleanStrategyParameter)
|
||||
DirectCast(DefaultParameter, BooleanStrategyParameter).SetValue(Parameter.sValue)
|
||||
If Parameter.sMinUserLevel = 1 Then
|
||||
DirectCast(DefaultParameter, BooleanStrategyParameter).SetbBooleanVisibility(Visibility.Visible)
|
||||
End If
|
||||
Case GetType(DoubleStrategyParameter)
|
||||
DirectCast(DefaultParameter, DoubleStrategyParameter).SetValue(Parameter.sValue)
|
||||
If Parameter.sMinUserLevel = 1 Then
|
||||
DirectCast(DefaultParameter, DoubleStrategyParameter).SetbDoubleVisibility(Visibility.Visible)
|
||||
End If
|
||||
Case GetType(ComboStrategyParameter)
|
||||
DirectCast(DefaultParameter, ComboStrategyParameter).SetSelValue(Parameter.sValue)
|
||||
If Parameter.sMinUserLevel = 1 Then
|
||||
DirectCast(DefaultParameter, ComboStrategyParameter).SetbComboBoxVisibility(Visibility.Visible)
|
||||
End If
|
||||
Case GetType(StringStrategyParameter)
|
||||
DirectCast(DefaultParameter, StringStrategyParameter).SetValue(Parameter.sValue)
|
||||
If Parameter.sMinUserLevel = 1 Then
|
||||
DirectCast(DefaultParameter, StringStrategyParameter).SetbStringVisibility(Visibility.Visible)
|
||||
End If
|
||||
Case GetType(ListStrategyParameter)
|
||||
DirectCast(DefaultParameter, ListStrategyParameter).SetSelValue(Parameter.sValue)
|
||||
DirectCast(DefaultParameter, ListStrategyParameter).CreateToolsViews()
|
||||
DirectCast(DefaultParameter, ListStrategyParameter).ToolView()
|
||||
If Parameter.sMinUserLevel = 1 Then
|
||||
DirectCast(DefaultParameter, ListStrategyParameter).SetbListBoxVisibility(Visibility.Visible)
|
||||
End If
|
||||
End Select
|
||||
End If
|
||||
Next
|
||||
@@ -1112,6 +1275,17 @@ Public Class BooleanStrategyParameter
|
||||
m_bValue = sValue.ToLower() = "true"
|
||||
End Sub
|
||||
|
||||
Private m_bBooleanVisibility As Visibility = Visibility.Collapsed
|
||||
Public ReadOnly Property bBooleanVisibility As Visibility
|
||||
Get
|
||||
Return m_bBooleanVisibility
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetbBooleanVisibility(value As Visibility)
|
||||
m_bBooleanVisibility = value
|
||||
NotifyPropertyChanged(NameOf(bBooleanVisibility))
|
||||
End Sub
|
||||
|
||||
#End Region ' Fields & Properties
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
@@ -1135,7 +1309,7 @@ Public Class BooleanStrategyParameter
|
||||
If bValue Then
|
||||
sValue = "true"
|
||||
End If
|
||||
Dim JsonStrategyParameter As New JsonStrategyParameter(sName, sNameNge, sValue, "b", If(Not String.IsNullOrEmpty(sSubType), sSubType, ""))
|
||||
Dim JsonStrategyParameter As New JsonStrategyParameter(sName, sNameNge, sValue, "b", If(Not String.IsNullOrEmpty(sSubType), sSubType, ""), sMinUserLevel)
|
||||
Return JsonStrategyParameter
|
||||
End Function
|
||||
|
||||
@@ -1180,6 +1354,17 @@ Public Class DoubleStrategyParameter
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private m_bDoubleVisibility As Visibility = Visibility.Collapsed
|
||||
Public ReadOnly Property bDoubleVisibility As Visibility
|
||||
Get
|
||||
Return m_bDoubleVisibility
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetbDoubleVisibility(value As Visibility)
|
||||
m_bDoubleVisibility = value
|
||||
NotifyPropertyChanged(NameOf(bDoubleVisibility))
|
||||
End Sub
|
||||
|
||||
#End Region ' Fields & Properties
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
@@ -1201,7 +1386,7 @@ Public Class DoubleStrategyParameter
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Overrides Function Serialize() As JsonStrategyParameter
|
||||
Dim JsonStrategyParameter As New JsonStrategyParameter(sName, sNameNge, sValue, "d", If(Not String.IsNullOrEmpty(sSubType), sSubType, ""))
|
||||
Dim JsonStrategyParameter As New JsonStrategyParameter(sName, sNameNge, sValue, "d", If(Not String.IsNullOrEmpty(sSubType), sSubType, ""), sMinUserLevel)
|
||||
Return JsonStrategyParameter
|
||||
End Function
|
||||
|
||||
@@ -1228,6 +1413,17 @@ Public Class StringStrategyParameter
|
||||
m_sValue = dValue
|
||||
End Sub
|
||||
|
||||
Private m_bStringVisibility As Visibility = Visibility.Collapsed
|
||||
Public ReadOnly Property bStringVisibility As Visibility
|
||||
Get
|
||||
Return m_bStringVisibility
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetbStringVisibility(value As Visibility)
|
||||
m_bStringVisibility = value
|
||||
NotifyPropertyChanged(NameOf(bStringVisibility))
|
||||
End Sub
|
||||
|
||||
#End Region ' Fields & Properties
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
@@ -1249,7 +1445,7 @@ Public Class StringStrategyParameter
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Overrides Function Serialize() As JsonStrategyParameter
|
||||
Dim JsonStrategyParameter As New JsonStrategyParameter(sName, sNameNge, sValue, "s", If(Not String.IsNullOrEmpty(sSubType), sSubType, ""))
|
||||
Dim JsonStrategyParameter As New JsonStrategyParameter(sName, sNameNge, sValue, "s", If(Not String.IsNullOrEmpty(sSubType), sSubType, ""), sMinUserLevel)
|
||||
Return JsonStrategyParameter
|
||||
End Function
|
||||
|
||||
@@ -1287,6 +1483,17 @@ Public Class ComboStrategyParameter
|
||||
m_SelValue = m_ComboList.FirstOrDefault(Function(x) x.sValue = sValue)
|
||||
End Sub
|
||||
|
||||
Private m_bComboBoxVisibility As Visibility = Visibility.Collapsed
|
||||
Public ReadOnly Property bComboBoxVisibility As Visibility
|
||||
Get
|
||||
Return m_bComboBoxVisibility
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetbComboBoxVisibility(value As Visibility)
|
||||
m_bComboBoxVisibility = value
|
||||
NotifyPropertyChanged(NameOf(bComboBoxVisibility))
|
||||
End Sub
|
||||
|
||||
#End Region ' Fields & Properties
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
@@ -1307,7 +1514,7 @@ Public Class ComboStrategyParameter
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Overrides Function Serialize() As JsonStrategyParameter
|
||||
Dim JsonStrategyParameter As New JsonStrategyParameter(sName, sNameNge, m_SelValue.sValue, "combo", If(Not String.IsNullOrEmpty(sSubType), sSubType, ""))
|
||||
Dim JsonStrategyParameter As New JsonStrategyParameter(sName, sNameNge, m_SelValue.sValue, "combo", If(Not String.IsNullOrEmpty(sSubType), sSubType, ""), sMinUserLevel)
|
||||
Return JsonStrategyParameter
|
||||
End Function
|
||||
|
||||
@@ -1412,6 +1619,17 @@ Public Class ListStrategyParameter
|
||||
NotifyPropertyChanged(NameOf(AvailableToolListIsEnable))
|
||||
End Sub
|
||||
|
||||
Private m_bListBoxVisibility As Visibility = Visibility.Collapsed
|
||||
Public ReadOnly Property bListBoxVisibility As Visibility
|
||||
Get
|
||||
Return m_bListBoxVisibility
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetbListBoxVisibility(value As Visibility)
|
||||
m_bListBoxVisibility = value
|
||||
NotifyPropertyChanged(NameOf(bListBoxVisibility))
|
||||
End Sub
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property SelectAllToolTip As String
|
||||
@@ -1481,7 +1699,7 @@ Public Class ListStrategyParameter
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Dim JsonStrategyParameter As New JsonStrategyParameter(sName, sNameNge, sInfo, "tool", If(Not String.IsNullOrEmpty(sSubType), sSubType, ""))
|
||||
Dim JsonStrategyParameter As New JsonStrategyParameter(sName, sNameNge, sInfo, "tool", If(Not String.IsNullOrEmpty(sSubType), sSubType, ""), sMinUserLevel)
|
||||
Return JsonStrategyParameter
|
||||
End Function
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
<Grid x:Class="UserAdminV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,0,0,10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding UserMsg}"
|
||||
HorizontalAlignment="Left"
|
||||
TextWrapping="WrapWithOverflow"
|
||||
Margin="0,0,5,0"
|
||||
FontWeight="{Binding UserFontWeight}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<ToggleButton Grid.Column="1"
|
||||
IsChecked="{Binding UserAdmin_IsChecked}"
|
||||
Style="{StaticResource Parameter_ToggleButton}"/>
|
||||
<TextBlock Grid.Column="2"
|
||||
Text="{Binding AdminMsg}"
|
||||
HorizontalAlignment="Left"
|
||||
TextWrapping="WrapWithOverflow"
|
||||
Margin="5,0,5,0"
|
||||
FontWeight="{Binding AdminFontWeight}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<Button Grid.Column="3"
|
||||
Margin="0,0,10,0"
|
||||
Command="{Binding UnlockAllCommand}"
|
||||
Style="{StaticResource OnlyProdToolBarInverted_SmallButton}">
|
||||
<Image Source="/Resources/NewPage/padlock.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class UserAdminV
|
||||
|
||||
End Class
|
||||
@@ -2985,6 +2985,41 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="Parameter_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
|
||||
<Setter Property="Width" Value="60"/>
|
||||
<Setter Property="Height" Value="20"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<Grid>
|
||||
<!-- Background -->
|
||||
<Border x:Name="BackgroundBorder"
|
||||
CornerRadius="10"
|
||||
Background="{StaticResource Omag_LightGray}"
|
||||
BorderBrush="{StaticResource Omag_Gray}"
|
||||
BorderThickness="1"/>
|
||||
<!-- Slider Circle -->
|
||||
<Ellipse x:Name="Slider"
|
||||
Width="12" Height="12"
|
||||
Fill="{StaticResource BeamWall_Glacier}"
|
||||
Margin="3"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<!--<Setter TargetName="BackgroundBorder" Property="Background" Value="MediumSeaGreen"/>-->
|
||||
<Setter TargetName="Slider" Property="HorizontalAlignment" Value="Right"/>
|
||||
<Setter TargetName="Slider" Property="Fill" Value="{StaticResource BeamWall_Kashmir}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!--#endregion ToggleButton Style-->
|
||||
|
||||
<!--#region TextBox-->
|
||||
|
||||
Reference in New Issue
Block a user