diff --git a/WebWindowComplex/Compo/AreaSash.razor.cs b/WebWindowComplex/Compo/AreaSash.razor.cs index 62bef39..2a8e41b 100644 --- a/WebWindowComplex/Compo/AreaSash.razor.cs +++ b/WebWindowComplex/Compo/AreaSash.razor.cs @@ -9,6 +9,8 @@ namespace WebWindowComplex.Compo { public partial class AreaSash { + #region Public Properties + /// /// Sash group corrente /// @@ -21,11 +23,11 @@ namespace WebWindowComplex.Compo [Parameter] public SashDimension CurrSashDim { get; set; } = null!; - /// - /// Lista di ante che si stanno editando - /// - [Parameter] - public List SashDimEditList { get; set; } = null!; + ///// + ///// Lista di ante che si stanno editando + ///// + //[Parameter] + //public List SashDimEditList { get; set; } = null!; /// /// Lista delle sash @@ -39,6 +41,12 @@ namespace WebWindowComplex.Compo [CascadingParameter(Name = "User")] public bool User { get; set; } = false!; + /// + /// Lista di sash dimension in stato edit + /// + [CascadingParameter(Name = "SashDimEditList")] + public List SashDimEditList { get; set; } = null!; + /// /// Indice della sash corrente /// @@ -70,10 +78,39 @@ namespace WebWindowComplex.Compo [Parameter] public EventCallback EC_ReqResetDict { get; set; } + #endregion Public Properties + + #region Protected Methods + + //protected override void OnParametersSet() + //{ + // base.OnParametersSet(); + //} + #endregion Protected Methods + + #region Private Fields + + private enum ModeView + { + NULL = 0, + View = 1, + Edit = 2 + } + + private bool ForceChangeAll = false; + + private bool isOpen = false; + + private ModeView mode { get; set; } = ModeView.View; + + #endregion Private Fields + + #region Private Properties + /// /// Anta corrente /// - public Area CurrAnta + private Area CurrAnta { get { @@ -92,32 +129,8 @@ namespace WebWindowComplex.Compo } } - /// - /// Metodo per avere il numero di decimali da usare nella form-input - /// - /// - public int CssDecimals() - { - switch (CurrSashDim.MeasureType) - { - case Json.WindowConst.MeasureTypes.ABSOLUTE: - { - return 2; - } - case Json.WindowConst.MeasureTypes.PROPORTIONAL: - { - return 0; - } - case Json.WindowConst.MeasureTypes.PERCENTAGE: - { - return 1; - } - } - return 0; - } - ///// - ///// Metodo per avere il lo step da usare nella form-input + ///// Metodo per avere lo step da usare nella form-input ///// ///// //public double CssStepNumber() @@ -143,7 +156,7 @@ namespace WebWindowComplex.Compo /// /// Selezione tipo di apertura anta /// - protected int OpeningTypeIndex + private int OpeningTypeIndex { get => CurrSashDim.SelOpeningTypeIndex; set @@ -160,7 +173,7 @@ namespace WebWindowComplex.Compo /// /// Selezione tipo di misura della dimensione dell'anta /// - protected int MeasureTypeIndex + private int MeasureTypeIndex { get => CurrSashDim.SelMeasureTypeIndex; set @@ -176,7 +189,7 @@ namespace WebWindowComplex.Compo /// /// Inserimento dimensione anta /// - protected double Dimension + private double Dimension { get => CurrSashDim.dDimension; set @@ -189,6 +202,34 @@ namespace WebWindowComplex.Compo } } + #endregion Private Properties + + #region Private Methods + + /// + /// Metodo per avere il numero di decimali da usare nella form-input + /// + /// + private int CssDecimals() + { + switch (CurrSashDim.MeasureType) + { + case MeasureTypes.ABSOLUTE: + { + return 2; + } + case MeasureTypes.PROPORTIONAL: + { + return 0; + } + case MeasureTypes.PERCENTAGE: + { + return 1; + } + } + return 0; + } + /// /// Sollevo evento richiesta per cambiare tutti i Joint /// @@ -203,8 +244,11 @@ namespace WebWindowComplex.Compo frame.Shape is Json.WindowConst.Shapes.ARC_FULL || frame.Shape is Json.WindowConst.Shapes.DOUBLEARC || frame.Shape is Json.WindowConst.Shapes.THREECENTERARC) && - (CurrSashGroup.ParentArea.ParentArea is Split && - CurrSashGroup.ParentArea.ParentArea.AreaList.LastOrDefault().AreaList.FirstOrDefault().Equals(CurrSashGroup))) + (CurrSashGroup.ParentArea.ParentArea is Split split && + split != null && + split.AreaList.LastOrDefault() != null && + split.AreaList.LastOrDefault()!.AreaList.FirstOrDefault() != null && + split.AreaList.LastOrDefault()!.AreaList.FirstOrDefault()!.Equals(CurrSashGroup))) { if(CurrSashGroup.SashList.Count == 1) { @@ -319,8 +363,8 @@ namespace WebWindowComplex.Compo /// /// Copio contenuto anta da indexCopy a IndexModify /// - /// Indice dell'ante di cui voglio copiare contenuto - /// Indice dell'ante di cui voglio modificare contenuto + /// Indice dell'anta di cui voglio copiare contenuto + /// Indice dell'anta di cui voglio modificare contenuto /// private Task CopyContentSash(int IndexCopy, int IndexModify) { @@ -375,8 +419,6 @@ namespace WebWindowComplex.Compo return EC_UpdateSash.InvokeAsync(args); } - private bool isOpen = false; - private void ToggleDropdown() { isOpen = !isOpen; @@ -397,26 +439,10 @@ namespace WebWindowComplex.Compo return "btn btn-secondary btn-sm"; } - private enum ModeView - { - NULL = 0, - View = 1, - Edit = 2 - } - - protected override void OnParametersSet() - { - //if (EditMode) - // mode = ModeView.Edit; - //else - // mode = ModeView.View; - } - private ModeView mode { get; set; } = ModeView.View; private void doEdit(int index) { var args = new DataChangeMode { - //Edit = true, IndexSashEdit = index, IndexSashClose = -1 }; @@ -438,7 +464,7 @@ namespace WebWindowComplex.Compo ForceChangeAll = !ForceChangeAll; } - private bool ForceChangeAll = false; + #endregion Private Methods } public class DataChangeMode { diff --git a/WebWindowComplex/Compo/CardFrame.razor b/WebWindowComplex/Compo/CardFrame.razor index bbec106..949407b 100644 --- a/WebWindowComplex/Compo/CardFrame.razor +++ b/WebWindowComplex/Compo/CardFrame.razor @@ -106,7 +106,7 @@ @if (!User) {
-
+
diff --git a/WebWindowComplex/Compo/CardSashGroup.razor b/WebWindowComplex/Compo/CardSashGroup.razor index e3dd50d..abddb98 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor +++ b/WebWindowComplex/Compo/CardSashGroup.razor @@ -214,7 +214,6 @@
SashGroupList { get; set; } = null!; + /// + /// Lista di sash dimension in stato edit + /// + [CascadingParameter(Name = "SashDimEditList")] + public List SashDimEditList { get; set; } = null!; + /// /// Frame corrente /// [Parameter] public Frame FrameWindow { get; set; } = null!; + /// + /// Evento per salvare stato edit singole ante + /// + [Parameter] + public EventCallback> EC_EditSashDim { get; set; } + #endregion Public Properties #region Protected Properties + protected override void OnParametersSet() + { + currSashDimEdit = SashDimEditList; + } + + #endregion Protected Properties + + #region Private Fields + + private bool editMode = false; + private List currSashDimEdit = new List(); + + #endregion Private Fields + + #region Private Properties + /// /// Selezione quantità di ante /// - protected int SashQty + private int SashQty { get => CurrSashGroup.nSashQty; set @@ -100,7 +128,7 @@ namespace WebWindowComplex.Compo }; _ = EC_UpdateSashGroup.InvokeAsync(args); _ = EC_ReqElement.InvokeAsync(CurrSashGroup); - if(CurrSashGroup.SelHardware.Id != "000000") + if (CurrSashGroup.SelHardware.Id != "000000") _ = EC_ReqOptionHw.InvokeAsync(CurrSashGroup); } } @@ -109,7 +137,7 @@ namespace WebWindowComplex.Compo /// /// Selezione quantit� bottom rail /// - protected int SashBottomRailQty + private int SashBottomRailQty { get => CurrSashGroup.SashBottomRailQty; set @@ -133,7 +161,7 @@ namespace WebWindowComplex.Compo /// /// Selezione tipo di orientamento della sash /// - protected int OrientationSashTypeIndex + private int OrientationSashTypeIndex { get => CurrSashGroup.SelOrientationSashTypeIndex; set @@ -153,7 +181,7 @@ namespace WebWindowComplex.Compo /// /// Selezione famiglia hardware /// - protected string FamilyHardware + private string FamilyHardware { get => CurrSashGroup.SelFamilyHardware; set @@ -167,7 +195,7 @@ namespace WebWindowComplex.Compo svgNoHw = true }; _ = EC_UpdateSashGroup.InvokeAsync(args); - _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetHwOpt}); + _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetHwOpt }); _ = EC_ReqOptionHw.InvokeAsync(CurrSashGroup); } } @@ -176,7 +204,7 @@ namespace WebWindowComplex.Compo /// /// Selezione hardware /// - protected string SelHwType + private string SelHwType { get => CurrSashGroup.SelHardwareFromId; set @@ -194,19 +222,19 @@ namespace WebWindowComplex.Compo } } - protected MeasureTypes MeasureType + private MeasureTypes MeasureType { - get + get { MeasureTypes type = CurrSashGroup.SashList.First().SelMeasureType; for (int i = 1; i < CurrSashGroup.SashList.Count; i++) { - if(CurrSashGroup.SashList.ElementAt(i).SelMeasureType != type) + if (CurrSashGroup.SashList.ElementAt(i).SelMeasureType != type) return MeasureTypes.NULL; } return type; } - set + set { for (int i = 0; i < CurrSashGroup.SashList.Count; i++) { @@ -217,17 +245,17 @@ namespace WebWindowComplex.Compo currSash = CurrSashGroup, noSvg = true }; - _= EC_UpdateSashGroup.InvokeAsync(args); + _ = EC_UpdateSashGroup.InvokeAsync(args); } } - protected int ChangeType + private int ChangeType { get { return CurrSashGroup.bIsDimensionLight ? 1 : 0; } - set + set { if (value == 1) CurrSashGroup.bIsDimensionLight = true; @@ -254,21 +282,21 @@ namespace WebWindowComplex.Compo } } - #endregion Protected Properties + #endregion Private Properties - #region Protected Methods + #region Private Methods - /// - /// Metodo per rimuovere area corrente - /// - /// - protected async Task RemoveArea() + /// + /// Metodo per rimuovere area corrente + /// + /// + private async Task RemoveArea() { CurrSashGroup.Remove(); if (FrameWindow.SelThreshold.Name.Contains("Threshold") && SashGroupList.IndexOf(CurrSashGroup) == 0) { Threshold? updThreshold = FrameWindow.ThresholdList.FirstOrDefault(x => x.Name != "Threshold"); - if(updThreshold != null) + if (updThreshold != null) FrameWindow.SelThresholdFromName = updThreshold.Name; } var args = new DataUpdateFrame() @@ -277,8 +305,8 @@ namespace WebWindowComplex.Compo groupIdDelete = CurrSashGroup.GroupId }; // richiesta reset dict shape - await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req=DataAction.ResetDictShape}); - await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDimElem}); + await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape }); + await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDimElem }); await EC_UpdateFrame.InvokeAsync(args); await EC_ReqClose.InvokeAsync(true); } @@ -289,7 +317,7 @@ namespace WebWindowComplex.Compo /// private Task ChangeTypeDimension(bool type) { - if(CurrSashGroup.bIsDimensionLight != type) + if (CurrSashGroup.bIsDimensionLight != type) { CurrSashGroup.bIsDimensionLight = type; foreach (var CurrSashDim in CurrSashGroup.SashList) @@ -344,11 +372,11 @@ namespace WebWindowComplex.Compo ///
/// /// - protected async Task UpdateSashDimension(SashDimension updateSD) + private async Task UpdateSashDimension(SashDimension updateSD) { _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem }); var currRec = CurrSashGroup.SashList.First(x => x.nSashId == updateSD.nSashId); - if(currRec != null) + if (currRec != null) { currRec = updateSD; var args = new DataUpdateSash @@ -365,7 +393,7 @@ namespace WebWindowComplex.Compo /// /// /// - protected async Task UpdateSash(DataUpdateProfile updateS) + private async Task UpdateSash(DataUpdateProfile updateS) { _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem }); if (updateS != null) @@ -386,7 +414,7 @@ namespace WebWindowComplex.Compo /// /// /// - protected async Task UpdateBottomRail(DataBottomRail updRec) + private async Task UpdateBottomRail(DataBottomRail updRec) { if (updRec.sash != null) { @@ -404,7 +432,7 @@ namespace WebWindowComplex.Compo /// /// /// - protected async Task UpdateBottomRail(ElementDimension updRec) + private async Task UpdateBottomRail(ElementDimension updRec) { var currRec = CurrSashGroup.BottomRailElemDimList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex); if (currRec != null) @@ -423,17 +451,11 @@ namespace WebWindowComplex.Compo /// /// /// - protected Task ResetDict(DataUpdateRes args) + private Task ResetDict(DataUpdateRes args) { return EC_ReqResetDict.InvokeAsync(args); } - #endregion Protected Methods - - #region Private Methods - - private bool editMode = false; - private List currSashDimEdit = new List(); private void EditView(DataChangeMode args) { //editMode = args.Edit; @@ -441,6 +463,7 @@ namespace WebWindowComplex.Compo currSashDimEdit.Add(args.IndexSashEdit); if (args.IndexSashClose != -1) currSashDimEdit.Remove(args.IndexSashClose); + _ = EC_EditSashDim.InvokeAsync(currSashDimEdit); } /// diff --git a/WebWindowComplex/Compo/CardSplit.razor.cs b/WebWindowComplex/Compo/CardSplit.razor.cs index 904511b..09bda92 100644 --- a/WebWindowComplex/Compo/CardSplit.razor.cs +++ b/WebWindowComplex/Compo/CardSplit.razor.cs @@ -101,7 +101,7 @@ namespace WebWindowComplex.Compo }; // richiesta reset dict shape await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape }); - await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape }); + await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDimElem }); await EC_UpdateFrame.InvokeAsync(args); await EC_ReqClose.InvokeAsync(true); } @@ -259,7 +259,7 @@ namespace WebWindowComplex.Compo currSplit = CurrSplit, noSvg = updRec.noSvg }; - //await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape }); + await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape }); await EC_UpdateSplit.InvokeAsync(args); } } diff --git a/WebWindowComplex/Compo/CardTree.razor b/WebWindowComplex/Compo/CardTree.razor index 592b846..e0c1fad 100644 --- a/WebWindowComplex/Compo/CardTree.razor +++ b/WebWindowComplex/Compo/CardTree.razor @@ -80,8 +80,7 @@ } @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FRAME && - ((SashGroupList.Count == 0 && SplitList.Count == 0) || !(FrameWindow.AreaList.First() is Split)) && - FrameWindow.AreaList.FirstOrDefault() != null && FrameWindow.AreaList.First()!.AreaList.Count == 0) + ((SashGroupList.Count == 0 && SplitList.Count == 0) || !(FrameWindow.AreaList.First() is Split))) { private LivePayload? prevLiveData = null; + private List m_sashDimEditList = new List(); + #endregion Private Fields #region Private Properties @@ -433,6 +435,12 @@ namespace WebWindowComplex get => m_SashGroupList; } + private List SashDimEditList + { + get => m_sashDimEditList; + set => m_sashDimEditList = value; + } + private string SelColorMaterial { get; set; } = ""; private string SelFamilyHardware { get; set; } = ""; @@ -1808,6 +1816,18 @@ namespace WebWindowComplex } } + /// + /// Aggiornamento lista SashDimension in stato edit + /// + /// + /// + private void UpdateSashDimEditList(List sashEditList) + { + if (sashEditList != null && sashEditList.Count > 0) + { + SashDimEditList = sashEditList; + } + } /// /// Aggiornamento Element a causa di un cambiamento nello split /// diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 7071ff2..113b809 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.4.2916 + 3.1.5.1116 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -186,6 +186,19 @@ + + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 41db710..3222ccb 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.4.2910 + 3.1.5.1116 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -276,6 +276,20 @@ + + + + + + + + + + + + + +