diff --git a/WebWindowComplex/Compo/AreaFrame.razor.cs b/WebWindowComplex/Compo/AreaFrame.razor.cs index bd2b64a..281951d 100644 --- a/WebWindowComplex/Compo/AreaFrame.razor.cs +++ b/WebWindowComplex/Compo/AreaFrame.razor.cs @@ -52,14 +52,19 @@ namespace WebWindowComplex.Compo protected override async Task OnInitializedAsync() { - AreaFDict = Vocabulary.Where(x => x.Key.Contains("CWAreaF_")).ToDictionary(x => x.Key, y => y.Value); - if (AreaFDict == null || AreaFDict.Count != 4) + Dictionary AFDict = Vocabulary.Where(x => x.Key.Contains("CWAreaF_")).ToDictionary(x => x.Key, y => y.Value); + if (AFDict == null || AFDict.Count != 4) { List tradList = new List() { "CWAreaF_AreaFrame", "CWAreaF_AggSash", "CWAreaF_AggSplit", "CWAreaF_AggInglesina"}; await EC_ReqTraduzione.InvokeAsync(tradList); } } + protected override void OnParametersSet() + { + AreaFDict = Vocabulary.Where(x => x.Key.Contains("CWAreaF_")).ToDictionary(x => x.Key, y => y.Value); + } + #endregion Protected Properties private Dictionary AreaFDict = new(); diff --git a/WebWindowComplex/Compo/CardFill.razor.cs b/WebWindowComplex/Compo/CardFill.razor.cs index 402294b..46e7ae9 100644 --- a/WebWindowComplex/Compo/CardFill.razor.cs +++ b/WebWindowComplex/Compo/CardFill.razor.cs @@ -55,15 +55,23 @@ namespace WebWindowComplex.Compo #region Protected Properties protected override async Task OnInitializedAsync() { - Dictionary FillDict = Vocabulary.Where(x => x.Key.Contains("CWFill_")).ToDictionary(x => x.Key, y => y.Value); - if (FillDict == null || FillDict.Count != 3) + Dictionary FDict = Vocabulary.Where(x => x.Key.Contains("CWFill_")).ToDictionary(x => x.Key, y => y.Value); + if (FDict == null || FDict.Count != 3) { List tradList = new List() { "CWFill_Fill", "CWFill_Glass", "CWFill_Wood"}; await EC_ReqTraduzione.InvokeAsync(tradList); } } + + protected override void OnParametersSet() + { + FillDict = Vocabulary.Where(x => x.Key.Contains("CWFill_")).ToDictionary(x => x.Key, y => y.Value); + } + #endregion Protected Properties + private Dictionary FillDict = new(); + #region Private Methods /// @@ -102,9 +110,9 @@ namespace WebWindowComplex.Compo private string Traduci(string lemma) { string ans = lemma; - if (Vocabulary != null && Vocabulary.ContainsKey(lemma)) + if (FillDict != null && FillDict.ContainsKey(lemma)) { - ans = Vocabulary.GetValueOrDefault(lemma) ?? ""; + ans = FillDict.GetValueOrDefault(lemma) ?? ""; } return ans; } diff --git a/WebWindowComplex/Compo/CardFrame.razor.cs b/WebWindowComplex/Compo/CardFrame.razor.cs index acfccc8..16792cd 100644 --- a/WebWindowComplex/Compo/CardFrame.razor.cs +++ b/WebWindowComplex/Compo/CardFrame.razor.cs @@ -80,16 +80,23 @@ namespace WebWindowComplex.Compo protected override async Task OnInitializedAsync() { - Dictionary FrameDict = Vocabulary.Where(x => x.Key.Contains("CWFrame_")).ToDictionary(x => x.Key, y => y.Value); - if(FrameDict == null || FrameDict.Count != 9) + Dictionary fDict = Vocabulary.Where(x => x.Key.Contains("CWFrame_")).ToDictionary(x => x.Key, y => y.Value); + if(fDict == null || fDict.Count != 9) { List tradList = new List() { "CWFrame_Frame", "CWFrame_Shape", "CWFrame_Dimension", "CWFrame_Threshold", "CWFrame_Tipology", "CWFrame_BottomRail", "CWFrame_Quantity", "CWFrame_Joints", "CWFrame_Element" }; await EC_ReqTraduzione.InvokeAsync(tradList); } } + protected override void OnParametersSet() + { + FrameDict = Vocabulary.Where(x => x.Key.Contains("CWFrame_")).ToDictionary(x => x.Key, y => y.Value); + } + #endregion Protected Properties + private Dictionary FrameDict = new(); + #region Private Properties private string GetImageFrameShapePath(string fileName) => $"_content/Egw.Lux.WebWindowComplex/icone/frame/shape/{fileName}.svg"; private string GetImageJointShapePath(string fileName) => $"_content/Egw.Lux.WebWindowComplex/icone/joint/shape/All/{fileName}.svg"; @@ -421,9 +428,9 @@ namespace WebWindowComplex.Compo private string Traduci(string lemma) { string ans = lemma; - if (Vocabulary != null && Vocabulary.ContainsKey(lemma)) + if (FrameDict != null && FrameDict.ContainsKey(lemma)) { - ans = Vocabulary.GetValueOrDefault(lemma) ?? ""; + ans = FrameDict.GetValueOrDefault(lemma) ?? ""; } return ans; } diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index a6ca8ac..0929c39 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -114,7 +114,7 @@ FillList="FillList" FrameWindow="FrameWindow" BaseUser="BaseUser" - Vocabulary="@(RestrictDict(new List(){"CWTree_"}))" + Vocabulary="CurrVocabulary" EC_NextStep="NextStepArgs" EC_Remove="RemoveArea" EC_Collapsed="CollapsedRowTree" @@ -136,7 +136,7 @@ - + diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 1589460..777f498 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -319,8 +319,9 @@ namespace WebWindowComplex //PendReq.Remove("Profile"); //await EC_PendantAction.InvokeAsync(PendReq); } - if(Vocabulary != null ) + if(Vocabulary != null || Vocabulary.Count == 0 ) { + CurrVocabulary = Vocabulary; TableCDict = Vocabulary.Where(x => x.Key.Contains("CWTableC_")).ToDictionary(x => x.Key, y => y.Value); if ((TableCDict == null || TableCDict.Count != 10) && !prevReqTrad) { @@ -336,6 +337,8 @@ namespace WebWindowComplex private Dictionary TableCDict = new(); + private Dictionary CurrVocabulary = new(); + private bool reqBool = false; private bool waitShape = false; @@ -1010,7 +1013,6 @@ namespace WebWindowComplex private Task DoReqTraduzione(List lemmaList) { Log.Info("Richiesta Traduzione"); - return EC_ReqTraduzione.InvokeAsync(lemmaList); } @@ -2336,8 +2338,8 @@ namespace WebWindowComplex private Dictionary RestrictDict(List subComp) { Dictionary dict = new Dictionary(); - if(Vocabulary != null && Vocabulary.Count > 0) - dict = Vocabulary.Where(x => subComp.Any(sub => x.Key.Contains(sub))).ToDictionary(x => x.Key, y => y.Value); + if(CurrVocabulary != null && CurrVocabulary.Count > 0) + dict = CurrVocabulary.Where(x => subComp.Any(sub => x.Key.Contains(sub))).ToDictionary(x => x.Key, y => y.Value); return dict; } diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 206eb04..d40300b 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.8.1415 + 3.1.8.1416 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -248,6 +248,8 @@ + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 2db8e85..06c2fa0 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.8.1415 + 3.1.8.1416 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -565,6 +565,8 @@ + +