parent
f6f5384353
commit
652e9f9ae4
|
@ -140,7 +140,17 @@ namespace RecipeEditorLib.RecipeModel.Params
|
||||||
{
|
{
|
||||||
this.ToList().ForEach(x => x.ResetHighlight());
|
this.ToList().ForEach(x => x.ResetHighlight());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 计算被赋予访问权限的配方参数。
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public int GetParamsCountWhoHaveAccessPerm()
|
||||||
|
{
|
||||||
|
var total = this.ToList().Sum(x => x.GetHighlightedParams().Count);
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Overrided Methods
|
#region Overrided Methods
|
||||||
|
|
|
@ -1498,9 +1498,9 @@
|
||||||
<materialDesign:Badged
|
<materialDesign:Badged
|
||||||
x:Name="txtCellAccessPremCount"
|
x:Name="txtCellAccessPremCount"
|
||||||
BadgeColorZoneMode="Standard"
|
BadgeColorZoneMode="Standard"
|
||||||
BadgeBackground="Green"
|
BadgeBackground="LimeGreen"
|
||||||
BadgeForeground="White"
|
BadgeForeground="White"
|
||||||
Margin="10,0,0,0"
|
Margin="15,0,0,0"
|
||||||
BadgePlacementMode="TopLeft"
|
BadgePlacementMode="TopLeft"
|
||||||
CornerRadius="5,5,5,5"
|
CornerRadius="5,5,5,5"
|
||||||
materialDesign:BadgedAssist.IsMiniBadge="True" VerticalAlignment="Center">
|
materialDesign:BadgedAssist.IsMiniBadge="True" VerticalAlignment="Center">
|
||||||
|
@ -1509,7 +1509,7 @@
|
||||||
Width="100"
|
Width="100"
|
||||||
Height="30"
|
Height="30"
|
||||||
Content="{Binding CellAccessPermButtonContent, Mode=OneWay}"
|
Content="{Binding CellAccessPermButtonContent, Mode=OneWay}"
|
||||||
Margin="5,0,0,0"
|
Margin="0,0,0,0"
|
||||||
ToolTip="Show/Hide Param Values"
|
ToolTip="Show/Hide Param Values"
|
||||||
Click="BtnCellAccessPermissionEditMode_OnClick">
|
Click="BtnCellAccessPermissionEditMode_OnClick">
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -166,6 +166,8 @@ namespace SicUI.Models.RecipeEditors
|
||||||
else
|
else
|
||||||
param.Highlight();
|
param.Highlight();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vm.CountHaveAccessPermParams();
|
||||||
//vm.SelectedGridCellCollection = e.AddedCells;
|
//vm.SelectedGridCellCollection = e.AddedCells;
|
||||||
//vm.ToggleCellAccessPermissionWhitelistMark();
|
//vm.ToggleCellAccessPermissionWhitelistMark();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2028,37 +2028,15 @@ namespace SicUI.Models.RecipeEditors
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Cell访问权限编辑
|
#region Cell访问权限编辑
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 高亮标出允许访问白名单的Cell。
|
/// 计算具有访问权限白名单的参数的总数。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void ToggleCellAccessPermissionWhitelistMark()
|
public void CountHaveAccessPermParams()
|
||||||
{
|
{
|
||||||
if (SelectedGridCellCollection != null)
|
var total = CurrentRecipe.Steps.GetParamsCountWhoHaveAccessPerm();
|
||||||
{
|
CellAccessPermCount = total;
|
||||||
foreach (var dataGridCellInfo in SelectedGridCellCollection)
|
|
||||||
{
|
|
||||||
if (dataGridCellInfo.Column is EditorDataGridTemplateColumnBase col &&
|
|
||||||
dataGridCellInfo.Item is RecipeStep step)
|
|
||||||
{
|
|
||||||
var controlName = col.ControlName;
|
|
||||||
var stepUid = step.StepUid;
|
|
||||||
|
|
||||||
if(string.IsNullOrEmpty(controlName))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
var param = step.FirstOrDefault(x => x.Name == controlName);
|
|
||||||
if(param == null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (param.IsHighlighted)
|
|
||||||
param.ResetHighlight();
|
|
||||||
else
|
|
||||||
param.Highlight();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -2089,6 +2067,8 @@ namespace SicUI.Models.RecipeEditors
|
||||||
|
|
||||||
UpdateView();
|
UpdateView();
|
||||||
|
|
||||||
|
CountHaveAccessPermParams();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2117,6 +2097,8 @@ namespace SicUI.Models.RecipeEditors
|
||||||
|
|
||||||
UpdateView();
|
UpdateView();
|
||||||
|
|
||||||
|
CellAccessPermCount = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -2212,7 +2194,6 @@ namespace SicUI.Models.RecipeEditors
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
private void ClearData()
|
private void ClearData()
|
||||||
{
|
{
|
||||||
_editMode = EditMode.None;
|
_editMode = EditMode.None;
|
||||||
|
@ -2353,7 +2334,10 @@ namespace SicUI.Models.RecipeEditors
|
||||||
NotifyOfPropertyChange(nameof(EnableStep));
|
NotifyOfPropertyChange(nameof(EnableStep));
|
||||||
NotifyOfPropertyChange(nameof(EnableSaveTo));
|
NotifyOfPropertyChange(nameof(EnableSaveTo));
|
||||||
NotifyOfPropertyChange(nameof(EnableSaveToAll));
|
NotifyOfPropertyChange(nameof(EnableSaveToAll));
|
||||||
NotifyOfPropertyChange(nameof(EnableReload));
|
NotifyOfPropertyChange(nameof(EnableLeftTabPanel));
|
||||||
|
NotifyOfPropertyChange(nameof(EnableFilterTreeList));
|
||||||
|
NotifyOfPropertyChange(nameof(EnableRefreshRecipeList));
|
||||||
|
NotifyOfPropertyChange(nameof(CellAccessPermButtonContent));
|
||||||
|
|
||||||
NotifyOfPropertyChange(nameof(CurrentRecipe));
|
NotifyOfPropertyChange(nameof(CurrentRecipe));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue