WebWindowComplex:
- Aggiunto Nuget Web.Window.Data - Aggiornate classi Window e JsonUtility - Aggiornata interfaccia
This commit is contained in:
@@ -4,9 +4,7 @@
|
||||
<PageTitle>EditJWD</PageTitle>
|
||||
|
||||
|
||||
<TableComp IN_TemplateDTOList="@AvailTemplateList"
|
||||
IN_SelTemplate="@SelTemplate"
|
||||
IN_FamilyHardwareList="@AvailFamilyHardwareList"
|
||||
<TableComp IN_FamilyHardwareList="@AvailFamilyHardwareList"
|
||||
IN_SelFamilyHardware="@SelFamilyHardware"
|
||||
IN_HardwareList="@AvailHardwareList"
|
||||
IN_ColorMaterialList="@AvailColorMaterialList"
|
||||
@@ -16,7 +14,6 @@
|
||||
IN_GlassList="@AvailGlassList"
|
||||
IN_SelGlass="@SelGlass"
|
||||
EC_OnUpdate="SaveJWD"
|
||||
EC_OnSelectedTemplate="SetTemplate"
|
||||
LiveSVG="@currSvg"
|
||||
CurrJwd="@InitialJwd">
|
||||
</TableComp>
|
||||
@@ -6,6 +6,7 @@ using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using System.Diagnostics;
|
||||
using System.Security.AccessControl;
|
||||
using Egw.Window.Data;
|
||||
using WebWindowComplex;
|
||||
using WebWindowComplex.DTO;
|
||||
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
IN_SelGlass="@SelGlass"
|
||||
EC_OnUpdate="SaveJWD"
|
||||
EC_OnSelectedTemplate="SetTemplate"
|
||||
LiveSVG="@currSvg"
|
||||
CurrJwd="@InitialJwd">
|
||||
LiveSVG="@currSvg">
|
||||
</TableComp>
|
||||
@*
|
||||
<p>
|
||||
|
||||
@@ -6,6 +6,7 @@ using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using System.Diagnostics;
|
||||
using System.Security.AccessControl;
|
||||
using Egw.Window.Data;
|
||||
using WebWindowComplex;
|
||||
using WebWindowComplex.DTO;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>2.7.9.3009</Version>
|
||||
<Version>2.7.9.3011</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione JWD per LUX</Description>
|
||||
@@ -89,6 +89,17 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -105,8 +105,21 @@ namespace WebWindowComplex.Json
|
||||
|
||||
public class JsonArea
|
||||
{
|
||||
private List<JsonArea> m_AreaList = new List<JsonArea>();
|
||||
private int m_nIdGroup;
|
||||
[JsonProperty]
|
||||
public int IdGroup
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_nIdGroup;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_nIdGroup = value;
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonArea> m_AreaList = new List<JsonArea>();
|
||||
[JsonProperty]
|
||||
public List<JsonArea> AreaList
|
||||
{
|
||||
@@ -219,16 +232,18 @@ namespace WebWindowComplex.Json
|
||||
{
|
||||
}
|
||||
|
||||
public JsonFrame(Shapes Shape, bool BottomRail, int BottomRailQty) : base(AreaTypes.FRAME)
|
||||
public JsonFrame(Shapes Shape, bool BottomRail, int BottomRailQty, int nIdGroup) : base(AreaTypes.FRAME)
|
||||
{
|
||||
m_Shape = Shape;
|
||||
m_bBottomRail = BottomRail;
|
||||
m_nBottomRailQty = BottomRailQty;
|
||||
IdGroup = nIdGroup;
|
||||
}
|
||||
|
||||
internal override Area Deserialize(Area ParentArea, Window ParentWindow)
|
||||
{
|
||||
Frame newFrame = new Frame(null, ParentWindow);
|
||||
newFrame.SetIdGroup(IdGroup);
|
||||
newFrame.SetAreaType(AreaTypes.FRAME);
|
||||
newFrame.SetSelShape(m_Shape);
|
||||
newFrame.SetBottomRail(m_bBottomRail);
|
||||
@@ -355,18 +370,20 @@ namespace WebWindowComplex.Json
|
||||
{
|
||||
}
|
||||
|
||||
public JsonSash(bool bIsSashVertical, SashTypes SashType, bool SashBottomRail, int SashBottomRailQty, string Hardware) : base(AreaTypes.SASH)
|
||||
public JsonSash(bool bIsSashVertical, SashTypes SashType, bool SashBottomRail, int SashBottomRailQty, string Hardware, int nIdGroup) : base(AreaTypes.SASH)
|
||||
{
|
||||
m_bIsSashVertical = bIsSashVertical;
|
||||
m_SashType = SashType;
|
||||
m_bBottomRail = SashBottomRail;
|
||||
m_nBottomRailQty = SashBottomRailQty;
|
||||
m_Hardware = Hardware;
|
||||
IdGroup = nIdGroup;
|
||||
}
|
||||
|
||||
internal override Area Deserialize(Area ParentArea, Window ParentWindow)
|
||||
{
|
||||
Sash newSash = new Sash(ParentArea, ParentWindow);
|
||||
newSash.SetIdGroup(IdGroup);
|
||||
newSash.SetAreaType(AreaTypes.SASH);
|
||||
newSash.SetSashQty(m_SashList.Count);
|
||||
newSash.SetIsSashVertical(m_bIsSashVertical);
|
||||
@@ -411,17 +428,45 @@ namespace WebWindowComplex.Json
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonSplitDimension> m_SplitPositionList = new List<JsonSplitDimension>();
|
||||
private bool m_SplitStartVert;
|
||||
[JsonProperty]
|
||||
public List<JsonSplitDimension> SplitPositionList
|
||||
public bool SplitStartVert
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_SplitPositionList;
|
||||
return m_SplitStartVert;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_SplitPositionList = value;
|
||||
m_SplitStartVert = value;
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonSplitDimension> m_SplitVertList = new List<JsonSplitDimension>();
|
||||
[JsonProperty]
|
||||
public List<JsonSplitDimension> SplitVertList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_SplitVertList;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_SplitVertList = value;
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonSplitDimension> m_SplitHorizList = new List<JsonSplitDimension>();
|
||||
[JsonProperty]
|
||||
public List<JsonSplitDimension> SplitHorizList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_SplitHorizList;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_SplitHorizList = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -429,22 +474,42 @@ namespace WebWindowComplex.Json
|
||||
{
|
||||
}
|
||||
|
||||
public JsonSplit(SplitShapes SplitShape) : base(AreaTypes.SPLIT)
|
||||
public JsonSplit(SplitShapes SplitShape, int nIdGroup) : base(AreaTypes.SPLIT)
|
||||
{
|
||||
m_SplitShape = SplitShape;
|
||||
IdGroup = nIdGroup;
|
||||
}
|
||||
|
||||
internal override Area Deserialize(Area ParentArea, Window ParentWindow)
|
||||
{
|
||||
Split Split = new Split(ParentArea, ParentWindow);
|
||||
Split.SetIdGroup(IdGroup);
|
||||
Split.SetAreaType(AreaTypes.SPLIT);
|
||||
Split.SetSplitShape(m_SplitShape, true);
|
||||
Split.SetSplitQty(m_SplitPositionList.Count - 1, true);
|
||||
//Split.AppliedDone();
|
||||
for (var SplitIndex = 0; SplitIndex <= m_SplitPositionList.Count - 1; SplitIndex++)
|
||||
Split.SetSplitStartVert(m_SplitStartVert);
|
||||
if (m_SplitVertList.Count == 0)
|
||||
Split.SetSplitQtyVert(0, true);
|
||||
else
|
||||
{
|
||||
Split.SplitPositionList[SplitIndex].SetIsRelative(m_SplitPositionList[SplitIndex].bIsRelative);
|
||||
Split.SplitPositionList[SplitIndex].SetDimension(m_SplitPositionList[SplitIndex].dDimension);
|
||||
//Split.SplitVertList.Clear();
|
||||
Split.SetSplitQtyVert(m_SplitVertList.Count - 1, true);
|
||||
for (var SplitIndex = 0; SplitIndex <= m_SplitVertList.Count - 1; SplitIndex++)
|
||||
{
|
||||
Split.SplitVertList[SplitIndex].SetIsRelative(m_SplitVertList[SplitIndex].bIsRelative);
|
||||
Split.SplitVertList[SplitIndex].SetDimension(m_SplitVertList[SplitIndex].dDimension);
|
||||
}
|
||||
}
|
||||
if (m_SplitHorizList.Count == 0)
|
||||
Split.SetSplitQtyHoriz(0, true);
|
||||
else
|
||||
{
|
||||
//Split.SplitHorizList.Clear();
|
||||
Split.SetSplitQtyHoriz(m_SplitHorizList.Count - 1, true);
|
||||
for (var SplitIndex = 0; SplitIndex <= m_SplitHorizList.Count - 1; SplitIndex++)
|
||||
{
|
||||
Split.SplitHorizList[SplitIndex].SetIsRelative(m_SplitHorizList[SplitIndex].bIsRelative);
|
||||
Split.SplitHorizList[SplitIndex].SetDimension(m_SplitHorizList[SplitIndex].dDimension);
|
||||
}
|
||||
}
|
||||
foreach (var Area in AreaList)
|
||||
{
|
||||
@@ -463,22 +528,27 @@ namespace WebWindowComplex.Json
|
||||
public JsonSplitted() : base(AreaTypes.SPLITTED)
|
||||
{
|
||||
}
|
||||
public JsonSplitted(int nIdGroup) : base(AreaTypes.SPLITTED)
|
||||
{
|
||||
IdGroup = nIdGroup;
|
||||
}
|
||||
|
||||
internal override Area Deserialize(Area ParentArea, Window ParentWindow)
|
||||
{
|
||||
Splitted Split = new Splitted(ParentArea, ParentWindow);
|
||||
Split.SetAreaType(AreaTypes.SPLITTED);
|
||||
Splitted newSplitted = new Splitted(ParentArea, ParentWindow);
|
||||
newSplitted.SetIdGroup(IdGroup);
|
||||
newSplitted.SetAreaType(AreaTypes.SPLITTED);
|
||||
//Split.AppliedDone();
|
||||
foreach (var Area in AreaList)
|
||||
{
|
||||
var AreaDeserealized = Area.Deserialize(Split, ParentWindow);
|
||||
var AreaDeserealized = Area.Deserialize(newSplitted, ParentWindow);
|
||||
if (AreaDeserealized != null)
|
||||
{
|
||||
Split.AreaList.Add(AreaDeserealized);
|
||||
newSplitted.AreaList.Add(AreaDeserealized);
|
||||
}
|
||||
}
|
||||
|
||||
return Split;
|
||||
return newSplitted;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -503,14 +573,16 @@ namespace WebWindowComplex.Json
|
||||
{
|
||||
}
|
||||
|
||||
public JsonFill(FillTypes FillType) : base(AreaTypes.FILL)
|
||||
public JsonFill(FillTypes FillType, int nIdGroup) : base(AreaTypes.FILL)
|
||||
{
|
||||
m_FillType = FillType;
|
||||
IdGroup = nIdGroup;
|
||||
}
|
||||
|
||||
internal override Area Deserialize(Area ParentArea, Window ParentWindow)
|
||||
{
|
||||
Fill Fill = new Fill(ParentArea, ParentWindow);
|
||||
Fill.SetIdGroup(IdGroup);
|
||||
Fill.SetAreaType(AreaTypes.FILL);
|
||||
Fill.SetFillType(m_FillType);
|
||||
//Fill.AppliedDone();
|
||||
@@ -612,6 +684,16 @@ namespace WebWindowComplex.Json
|
||||
|
||||
public class JsonSashDimension
|
||||
{
|
||||
private int m_nSashId;
|
||||
[JsonProperty]
|
||||
public int nSashId
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_nSashId;
|
||||
}
|
||||
}
|
||||
|
||||
private Openings m_OpeningType;
|
||||
[JsonProperty]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
@@ -651,11 +733,12 @@ namespace WebWindowComplex.Json
|
||||
}
|
||||
}
|
||||
|
||||
public JsonSashDimension(Openings OpeningType, bool bHasHandle, double dDimension)
|
||||
public JsonSashDimension(Openings OpeningType, bool bHasHandle, double dDimension, int nSashId)
|
||||
{
|
||||
m_OpeningType = OpeningType;
|
||||
m_bHasHandle = bHasHandle;
|
||||
m_dDimension = dDimension;
|
||||
m_nSashId = nSashId;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+487
-422
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,12 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.Net.Http.Headers;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Reflection.Metadata;
|
||||
using System.Reflection.Metadata.Ecma335;
|
||||
using System.Runtime.InteropServices;
|
||||
using WebWindow.Base;
|
||||
using Egw.Window.Data;
|
||||
using WebWindowComplex.DTO;
|
||||
using WebWindowComplex.Json;
|
||||
using static WebWindowComplex.Json.WindowConst;
|
||||
@@ -295,6 +297,62 @@ namespace WebWindowComplex
|
||||
Sash.s_SelFamilyHW = IN_SelFamilyHardware;
|
||||
}
|
||||
|
||||
// Ancora da fare...
|
||||
protected async Task DoClose()
|
||||
{
|
||||
await EC_OnClose.InvokeAsync(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Anteprima SVG
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected async Task DoPreviewSvg()
|
||||
{
|
||||
if (m_CurrWindow != null)
|
||||
{
|
||||
var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented);
|
||||
Dictionary<string, string> Args = new Dictionary<string, string>();
|
||||
Args.Add("Mode", $"{(int)Enums.QuestionModes.PREVIEW}");
|
||||
Args.Add("Jwd", CurrJwd);
|
||||
await EC_OnUpdate.InvokeAsync(Args);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo di reset dei dati a quelli del template
|
||||
/// </summary>
|
||||
protected async Task DoReset()
|
||||
{
|
||||
// Aggiornati parametri di ingresso selezionati
|
||||
Area.nCounterGroup = 0;
|
||||
UpdateSelParameter();
|
||||
JsonWindow WindowFromJson;
|
||||
if (string.IsNullOrEmpty(CurrJwd))
|
||||
WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", "");
|
||||
else
|
||||
WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(m_CurrJwd!, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", "");
|
||||
if (m_CurrWindow != null)
|
||||
{
|
||||
m_CurrWindow.OnPreview -= M_CurrWindow_OnPreview;
|
||||
m_CurrWindow = null;
|
||||
}
|
||||
m_CurrWindow = WindowFromJson.Deserialize();
|
||||
m_CurrWindow.OnPreview += M_CurrWindow_OnPreview;
|
||||
// Aggiorante liste sash, split, splitted, fill e itemTable
|
||||
UpdateLists();
|
||||
currSash = -1;
|
||||
currStep = CompileStep.Gerarchia;
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
// Ancora da fare..
|
||||
protected async Task DoSave()
|
||||
{
|
||||
//manca salvataggio JWD
|
||||
await EC_OnClose.InvokeAsync(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per la scelta della maniglia univoca
|
||||
/// </summary>
|
||||
@@ -316,6 +374,20 @@ namespace WebWindowComplex
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item.bHasHandle)
|
||||
{
|
||||
switch (item.SelOpeningType)
|
||||
{
|
||||
case Openings.TILTTURN_LEFT:
|
||||
item.SetOpeningType(Openings.TURNONLY_LEFT);
|
||||
break;
|
||||
case Openings.TILTTURN_RIGHT:
|
||||
item.SetOpeningType(Openings.TURNONLY_RIGHT);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
item.bHasHandle = false;
|
||||
}
|
||||
}
|
||||
@@ -323,58 +395,55 @@ namespace WebWindowComplex
|
||||
}
|
||||
}
|
||||
|
||||
// Ancora da fare...
|
||||
protected async Task DoClose()
|
||||
{
|
||||
await EC_OnClose.InvokeAsync(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Anteprima SVG
|
||||
/// Metodo per la scelta dello split intero nella modalità griglia
|
||||
/// </summary>
|
||||
/// <param name="currSplit"> split su cui si sceglie </param>
|
||||
/// <returns></returns>
|
||||
protected async Task DoPreviewSvg()
|
||||
protected void changeStartVert(ChangeEventArgs e, Split currSplit)
|
||||
{
|
||||
if (m_CurrWindow != null)
|
||||
// Cerco la Sash che si sta considerando nella lista Sash
|
||||
foreach (Split s in SplitList)
|
||||
{
|
||||
var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented);
|
||||
Dictionary<string, string> Args = new Dictionary<string, string>();
|
||||
Args.Add("Mode", $"{(int)Enums.EngineQueryType.Preview}");
|
||||
Args.Add("Jwd", CurrJwd);
|
||||
await EC_OnUpdate.InvokeAsync(Args);
|
||||
if (s.Equals(currSplit))
|
||||
{
|
||||
s.SetSplitStartVert((bool)e.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo di reset dei dati a quelli del template
|
||||
/// Metodo per determinare la descrizione del parent dello split corrente
|
||||
/// </summary>
|
||||
protected async Task DoReset()
|
||||
/// <param name="currSplit"> split corrente </param>
|
||||
/// <returns></returns>
|
||||
protected string descParentSplit(Split currSplit)
|
||||
{
|
||||
// Aggiornati parametri di ingresso selezionati
|
||||
UpdateSelParameter();
|
||||
JsonWindow WindowFromJson;
|
||||
if (string.IsNullOrEmpty(CurrJwd))
|
||||
WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", "");
|
||||
else
|
||||
WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(m_CurrJwd!, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", "");
|
||||
if (m_CurrWindow != null)
|
||||
if ((currSplit.ParentArea is Splitted || currSplit.ParentArea is Sash) && SashList.Count > 0)
|
||||
{
|
||||
m_CurrWindow.OnPreview -= M_CurrWindow_OnPreview;
|
||||
m_CurrWindow = null;
|
||||
for (int j = 0; j < SashList.Count; j++)
|
||||
{
|
||||
if (SashList[j].Equals(currSplit.ParentArea))
|
||||
{
|
||||
return "Sash " + (j + 1);
|
||||
}
|
||||
else if (SashList[j].Equals(currSplit.ParentArea.ParentArea))
|
||||
{
|
||||
for (int k = 0; k < SashList[j].AreaList.Count; k++)
|
||||
{
|
||||
if (SashList[j].AreaList[k].AreaList[0].Equals(currSplit))
|
||||
{
|
||||
return "Sash " + (j + 1) + " - anta " + (k + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
m_CurrWindow = WindowFromJson.Deserialize();
|
||||
m_CurrWindow.OnPreview += M_CurrWindow_OnPreview;
|
||||
// Aggiorante liste sash, split, splitted, fill e itemTable
|
||||
UpdateLists();
|
||||
currSash = -1;
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
// Ancora da fare..
|
||||
protected async Task DoSave()
|
||||
{
|
||||
//manca salvataggio JWD
|
||||
await EC_OnClose.InvokeAsync(true);
|
||||
else
|
||||
{
|
||||
return "Frame";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -387,20 +456,6 @@ namespace WebWindowComplex
|
||||
await EC_OnSelectedTemplate.InvokeAsync(newSel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per cambiare step e aggiornare preview svg
|
||||
/// </summary>
|
||||
/// <param name="newStep"> step successivo </param>
|
||||
protected async void NextStepAndPreview(CompileStep newStep, int Index = -1)
|
||||
{
|
||||
currStep = newStep;
|
||||
if (newStep == CompileStep.Sash)
|
||||
currSash = Index;
|
||||
else
|
||||
currSash = -1;
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per riempire le liste Sash, Split, Splitted e Fill
|
||||
/// </summary>
|
||||
@@ -719,8 +774,9 @@ namespace WebWindowComplex
|
||||
/// <returns></returns>
|
||||
private async Task CopySash(Splitted currSplitted, int numSash)
|
||||
{
|
||||
//Rimuovo contenuto di Splitted
|
||||
//Rimuovo contenuto di Splitted e rimuovo area da conteggio gruppi
|
||||
currSplitted.AreaList.RemoveAll(i => i != null);
|
||||
//Area.DelCounterGroup();
|
||||
// Copio sash
|
||||
Area a = SashList[numSash].Copy(currSplitted);
|
||||
a.SetParentArea(currSplitted);
|
||||
@@ -729,17 +785,6 @@ namespace WebWindowComplex
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per scambiare due aree di uno split
|
||||
/// </summary>
|
||||
/// <param name="currArea"> Area corrente </param>
|
||||
/// <returns></returns>
|
||||
private async Task SwapTwoAree(Area currArea)
|
||||
{
|
||||
currArea.SwapAree();
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
@@ -768,6 +813,47 @@ namespace WebWindowComplex
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per scambiare due aree di uno split
|
||||
/// </summary>
|
||||
/// <param name="currArea"> Area corrente </param>
|
||||
/// <returns></returns>
|
||||
private async Task SwapTwoAree(Area currArea)
|
||||
{
|
||||
currArea.SwapAree();
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per eliminare Split o Sash
|
||||
/// </summary>
|
||||
/// <param name="currArea"> Area corrente </param>
|
||||
/// <returns></returns>
|
||||
private void RemoveArea(Area currArea)
|
||||
{
|
||||
if (currArea is Split)
|
||||
((Split)currArea).Remove();
|
||||
else if (currArea is Sash)
|
||||
{
|
||||
((Sash)currArea).Remove();
|
||||
}
|
||||
currStep = CompileStep.Gerarchia;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per cambiare step e aggiornare preview svg
|
||||
/// </summary>
|
||||
/// <param name="newStep"> step successivo </param>
|
||||
private async void NextStepAndPreview(CompileStep newStep, int Index = -1)
|
||||
{
|
||||
currStep = newStep;
|
||||
if (newStep == CompileStep.Sash)
|
||||
currSash = Index;
|
||||
else
|
||||
currSash = -1;
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per andare allo step successivo
|
||||
/// </summary>
|
||||
@@ -781,7 +867,7 @@ namespace WebWindowComplex
|
||||
private void M_CurrWindow_OnPreview(object? sender, OnPreviewEventArgs e)
|
||||
{
|
||||
Dictionary<string, string> Args = new Dictionary<string, string>();
|
||||
Args.Add("Mode", $"{(int)Enums.EngineQueryType.Preview}");
|
||||
Args.Add("Mode", $"{(int)Enums.QuestionModes.PREVIEW}");
|
||||
Args.Add("Jwd", e.sJwd);
|
||||
EC_OnUpdate.InvokeAsync(Args);
|
||||
}
|
||||
@@ -812,13 +898,31 @@ namespace WebWindowComplex
|
||||
return (currStep == CompileStep.Template) ? "col-12" : "col-6";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calcola larghezza border descrizione split
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string splitCss(Split currSplit)
|
||||
{
|
||||
return (currSplit.SelSplitShape == SplitShapes.GRID) ? "col-sm-12" : "col-sm-6";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calcola larghezza border descrizione split
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string splitContentCss(Split currSplit)
|
||||
{
|
||||
return (currSplit.SelSplitShape == SplitShapes.GRID) ? "col-sm-6" : "col-sm-12";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calcola larghezza colonna header nav
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string headerCss()
|
||||
{
|
||||
return (currStep == CompileStep.Template) ? "col-10 d-grid gap-1 px-2 d-md-flex justify-content-md-start" : "col-8 d-grid gap-1 px-2 d-md-flex justify-content-md-start";
|
||||
return (currStep == CompileStep.Template) ? "col-8 d-grid gap-1 px-2 d-md-flex justify-content-md-start" : "col-8 d-grid gap-1 px-2 d-md-flex justify-content-md-start";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -827,7 +931,7 @@ namespace WebWindowComplex
|
||||
/// <returns></returns>
|
||||
private string buttonCss()
|
||||
{
|
||||
return (currStep == CompileStep.Template) ? "col-2 d-grid gap-1 d-md-flex justify-content-md-end" : "col-4 d-grid gap-1 d-md-flex justify-content-md-end";
|
||||
return (currStep == CompileStep.Template) ? "col-4 d-grid gap-1 d-md-flex justify-content-md-end" : "col-4 d-grid gap-1 d-md-flex justify-content-md-end";
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>2.7.9.3009</Version>
|
||||
<Version>2.7.9.3011</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione Configurazioni avanzate Window per LUX</Description>
|
||||
@@ -18,6 +18,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Egw.Window.Data" Version="2.7.9.2909" />
|
||||
<PackageReference Include="EgwCoreLib.Razor" Version="1.5.2507.1815" />
|
||||
<PackageReference Include="EgwCoreLib.Utils" Version="1.5.2507.1815" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.19" />
|
||||
@@ -67,6 +68,17 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+491
-197
@@ -5,10 +5,12 @@ using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Runtime.Intrinsics.Arm;
|
||||
using System.Xml.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using WebWindowComplex.Json;
|
||||
using static WebWindowComplex.ParametriOpzioni;
|
||||
using Egw.Window.Data;
|
||||
using static WebWindowComplex.Json.WindowConst;
|
||||
using static WebWindowComplex.ParametriOpzioni;
|
||||
|
||||
namespace WebWindowComplex
|
||||
{
|
||||
@@ -96,7 +98,6 @@ namespace WebWindowComplex
|
||||
internal string sSerialized()
|
||||
{
|
||||
return JsonConvert.SerializeObject(Serialize(), Formatting.Indented);
|
||||
|
||||
}
|
||||
|
||||
internal void OnUpdatePreview(string sJwd)
|
||||
@@ -122,6 +123,35 @@ namespace WebWindowComplex
|
||||
|
||||
public abstract class Area
|
||||
{
|
||||
// Conteggio dei macro elementi
|
||||
private static int m_CounterGroup = 0;
|
||||
public static void AddCounterGroup()
|
||||
{
|
||||
m_CounterGroup++;
|
||||
}
|
||||
public static int nCounterGroup
|
||||
{
|
||||
get => m_CounterGroup;
|
||||
set => m_CounterGroup = value;
|
||||
}
|
||||
|
||||
private int m_IdGroup;
|
||||
public int IdGroup
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_IdGroup;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
m_IdGroup = value;
|
||||
}
|
||||
}
|
||||
public void SetIdGroup(int nIdGroup)
|
||||
{
|
||||
m_IdGroup = nIdGroup;
|
||||
}
|
||||
|
||||
protected Window m_ParentWindow;
|
||||
public Window ParentWindow
|
||||
@@ -206,7 +236,8 @@ namespace WebWindowComplex
|
||||
// Aggiungo Area split di default
|
||||
Split SplitArea = Split.CreateSplit(this, SplitShapes.HORIZONTAL);
|
||||
// imposto i parametri di default
|
||||
SplitArea.SetSplitQty(1);
|
||||
SplitArea.SetSplitQtyHoriz(1);
|
||||
SplitArea.SetSplitStartVert(false);
|
||||
// Aggiungo area
|
||||
AreaList.Add(SplitArea);
|
||||
// Creo le due aree Splitted
|
||||
@@ -380,6 +411,8 @@ namespace WebWindowComplex
|
||||
break;
|
||||
}
|
||||
}
|
||||
// salvo tipo Joint
|
||||
Joints oldJointType = JointList[0].SelJointType;
|
||||
// aggiungo Joint
|
||||
m_JointList.Clear();
|
||||
switch (SelShape)
|
||||
@@ -391,17 +424,21 @@ namespace WebWindowComplex
|
||||
case Shapes.ARC:
|
||||
case Shapes.DOUBLEARC:
|
||||
{
|
||||
JointList.Add(new Joint(this, 1, Joints.FULL_H));
|
||||
JointList.Add(new Joint(this, 2, Joints.FULL_H));
|
||||
JointList.Add(new Joint(this, 3, Joints.FULL_H));
|
||||
JointList.Add(new Joint(this, 4, Joints.FULL_H));
|
||||
JointList.Add(new Joint(this, 1, oldJointType));
|
||||
JointList.Add(new Joint(this, 2, oldJointType));
|
||||
JointList.Add(new Joint(this, 3, oldJointType));
|
||||
JointList.Add(new Joint(this, 4, oldJointType));
|
||||
//JointList.Add(new Joint(this, 1, Joints.FULL_H));
|
||||
//JointList.Add(new Joint(this, 2, Joints.FULL_H));
|
||||
//JointList.Add(new Joint(this, 3, Joints.FULL_H));
|
||||
//JointList.Add(new Joint(this, 4, Joints.FULL_H));
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.ARC_FULL:
|
||||
{
|
||||
JointList.Add(new Joint(this, 1, Joints.FULL_H));
|
||||
JointList.Add(new Joint(this, 2, Joints.FULL_H));
|
||||
JointList.Add(new Joint(this, 1, oldJointType));
|
||||
JointList.Add(new Joint(this, 2, oldJointType));
|
||||
JointList.Add(new Joint(this, 3, Joints.ANGLED));
|
||||
JointList.Add(new Joint(this, 4, Joints.ANGLED));
|
||||
break;
|
||||
@@ -409,8 +446,8 @@ namespace WebWindowComplex
|
||||
|
||||
case Shapes.TRIANGLE:
|
||||
{
|
||||
JointList.Add(new Joint(this, 1, Joints.FULL_H));
|
||||
JointList.Add(new Joint(this, 2, Joints.FULL_H));
|
||||
JointList.Add(new Joint(this, 1, oldJointType));
|
||||
JointList.Add(new Joint(this, 2, oldJointType));
|
||||
JointList.Add(new Joint(this, 3, Joints.ANGLED));
|
||||
break;
|
||||
}
|
||||
@@ -621,7 +658,10 @@ namespace WebWindowComplex
|
||||
|
||||
internal override JsonArea Serialize()
|
||||
{
|
||||
JsonFrame JsonFrame = new JsonFrame(m_Shape, m_bBottomRail, m_nBottomRailQty);
|
||||
Area.nCounterGroup = 0;
|
||||
if (nCounterGroup < IdGroup)
|
||||
Area.nCounterGroup = IdGroup;
|
||||
JsonFrame JsonFrame = new JsonFrame(m_Shape, m_bBottomRail, m_nBottomRailQty, IdGroup);
|
||||
foreach (var Dimension in DimensionList)
|
||||
JsonFrame.DimensionList.Add(Dimension.Serialize());
|
||||
foreach (var Joint in JointList)
|
||||
@@ -667,7 +707,7 @@ namespace WebWindowComplex
|
||||
// aggiungo area Sash di default
|
||||
for (var SplitIndex = m_SashList.Count; SplitIndex <= value - 1; SplitIndex++)
|
||||
{
|
||||
SashList.Add(new SashDimension(dNewDimension, true, this));
|
||||
SashList.Add(new SashDimension(dNewDimension, true, this, SplitIndex + 1));
|
||||
}
|
||||
}
|
||||
else if (value < m_SashList.Count)
|
||||
@@ -759,8 +799,9 @@ namespace WebWindowComplex
|
||||
|
||||
}
|
||||
// Aggiungo all'ultimo Splitted l'area di vetro
|
||||
Fill newFill = new Fill(AreaList[1], ParentWindow);
|
||||
newFill.SetFillType(FillTypes.GLASS);
|
||||
Fill newFill = Fill.CreateFill(AreaList[1], FillTypes.GLASS);
|
||||
//Fill newFill = new Fill(AreaList[1], ParentWindow);
|
||||
//newFill.SetFillType(FillTypes.GLASS);
|
||||
newFill.SetAreaType(AreaTypes.FILL);
|
||||
AreaList[AreaList.Count - 1].AreaList.Add(newFill);
|
||||
}
|
||||
@@ -773,37 +814,6 @@ namespace WebWindowComplex
|
||||
break;
|
||||
}
|
||||
}
|
||||
//if (AreaList[AreaList.Count - 1].AreaList.Count == 0)
|
||||
//{
|
||||
// if (ContentArea.Count > 0)
|
||||
// {
|
||||
// if (ContentArea[0] is Fill)
|
||||
// {
|
||||
// for (int SplitIndex = 0; SplitIndex <= AreaList.Count() - 1; SplitIndex++)
|
||||
// {
|
||||
// if (SplitIndex == 0)
|
||||
// {
|
||||
// AreaList[0].AreaList.Add(ContentArea[0]);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Fill f1 = (Fill)ContentArea[0];
|
||||
// AreaList[SplitIndex].AreaList.Add(Fill.CreateFill(AreaList[SplitIndex], f1.FillType));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// AreaList[0].AreaList.Add(ContentArea[0]);
|
||||
// AreaList[1].AreaList.Add(ContentArea[0]);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Fill f1 = (Fill)AreaList[AreaList.Count - 2].AreaList[0];
|
||||
// AreaList[AreaList.Count - 1].AreaList.Add(Fill.CreateFill(AreaList[AreaList.Count - 1], f1.FillType));
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
RefreshHardwareList();
|
||||
@@ -829,7 +839,7 @@ namespace WebWindowComplex
|
||||
dNewDimension = dLastDimension / (Qty + 1 - nSashQty);
|
||||
// aggiungo area Sash di default
|
||||
for (var SplitIndex = m_SashList.Count; SplitIndex <= Qty - 1; SplitIndex++)
|
||||
SashList.Add(new SashDimension(dNewDimension, true, this));
|
||||
SashList.Add(new SashDimension(dNewDimension, true, this, SplitIndex + 1));
|
||||
}
|
||||
else if (Qty < m_SashList.Count)
|
||||
{
|
||||
@@ -1135,7 +1145,7 @@ namespace WebWindowComplex
|
||||
|
||||
internal void SetSelHardwareFromId(string sId)
|
||||
{
|
||||
m_SelHardware = m_HardwareList.FirstOrDefault(x => x.sId == sId) ?? new Hardware("", "", "", "", "", 0, 0);
|
||||
m_SelHardware = m_HardwareList.FirstOrDefault(x => x.Id == sId) ?? new Hardware("", "", "", "", "", 0, 0);
|
||||
if (m_SelHardware == null)
|
||||
m_SelHardware = m_HardwareList[0];
|
||||
}
|
||||
@@ -1184,6 +1194,8 @@ namespace WebWindowComplex
|
||||
internal static Sash CreateSash(Area Area)
|
||||
{
|
||||
Sash newSash = new Sash(Area, Area.ParentWindow);
|
||||
AddCounterGroup();
|
||||
newSash.SetIdGroup(nCounterGroup);
|
||||
newSash.SetAreaType(AreaTypes.SASH);
|
||||
newSash.SetSashQty(1);
|
||||
newSash.SetOrientationSashType(OrientationSash.VERTICAL);
|
||||
@@ -1317,7 +1329,7 @@ namespace WebWindowComplex
|
||||
string sSashShape = FindSashShape();
|
||||
string sOpeningType = ConvertOpeningType();
|
||||
m_HardwareList = new ObservableCollection<Hardware>(from Hardware in m_HardwareCompleteList
|
||||
where Hardware.sId == "000000" || (Hardware.sFamily == s_SelFamilyHW && Hardware.nSashQty == nSashQty && Hardware.sShape == sSashShape && Hardware.sOpeningType == sOpeningType)
|
||||
where Hardware.Id == "000000" || (Hardware.FamilyName == s_SelFamilyHW && Hardware.SashQty == nSashQty && Hardware.Shape == sSashShape && Hardware.OpeningType == sOpeningType)
|
||||
select Hardware);
|
||||
}
|
||||
|
||||
@@ -1358,6 +1370,8 @@ namespace WebWindowComplex
|
||||
public override Sash Copy(Area newParentArea)
|
||||
{
|
||||
Sash newSash = new Sash(newParentArea, m_ParentWindow);
|
||||
AddCounterGroup();
|
||||
newSash.SetIdGroup(nCounterGroup);
|
||||
newSash.SetAreaType(AreaType);
|
||||
// Imposta la quantità di ante e definisce SashDimension di ogni anta ai valori di default
|
||||
newSash.SetSashQty(nSashQty);
|
||||
@@ -1387,9 +1401,20 @@ namespace WebWindowComplex
|
||||
return newSash;
|
||||
}
|
||||
|
||||
public void Remove()
|
||||
{
|
||||
ParentArea.AreaList.Remove(this);
|
||||
Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS);
|
||||
newFill.SetAreaType(AreaTypes.FILL);
|
||||
ParentArea.AreaList.Add(newFill);
|
||||
m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
|
||||
}
|
||||
|
||||
internal override JsonArea Serialize()
|
||||
{
|
||||
JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_bSashBottomRail, m_nSashBottomRailQty, m_SelHardware.sId);
|
||||
if (nCounterGroup < IdGroup)
|
||||
Area.nCounterGroup = IdGroup;
|
||||
JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_bSashBottomRail, m_nSashBottomRailQty, m_SelHardware.Id, IdGroup);
|
||||
foreach (var SashDimension in SashList)
|
||||
JsonSash.SashList.Add(SashDimension.Serialize());
|
||||
foreach (var Joint in JointList)
|
||||
@@ -1402,101 +1427,247 @@ namespace WebWindowComplex
|
||||
|
||||
public class Split : Area
|
||||
{
|
||||
public int nSplitQty
|
||||
private bool m_bSplitStartVert = true;
|
||||
public bool bSplitStartVert
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_SplitPositionList.Count > 0 ? m_SplitPositionList.Count - 1 : 0;
|
||||
return m_bSplitStartVert;
|
||||
}
|
||||
set
|
||||
{
|
||||
// Ricalcolo dimensioni aggiungendo split
|
||||
if (value > m_SplitPositionList.Count - 1)
|
||||
m_bSplitStartVert = value;
|
||||
m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
|
||||
}
|
||||
}
|
||||
internal void SetSplitStartVert(bool SplitStartVert)
|
||||
{
|
||||
bSplitStartVert = SplitStartVert;
|
||||
}
|
||||
public int nSplitQtyVert
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_SplitVertList.Count > 0 ? m_SplitVertList.Count - 1 : 0;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == 0)
|
||||
{
|
||||
// recupero larghezza ultimo
|
||||
double dLastDimension = 100;
|
||||
double dNewDimension = 100;
|
||||
if (m_SplitPositionList.Count > 0)
|
||||
for (var SplitIndex = m_SplitVertList.Count - 1; SplitIndex >= value; SplitIndex += -1)
|
||||
m_SplitVertList.RemoveAt(SplitIndex);
|
||||
if (nSplitQtyHoriz == 0)
|
||||
{
|
||||
dLastDimension = m_SplitPositionList[m_SplitPositionList.Count - 1].dDimension;
|
||||
dNewDimension = dLastDimension / (value + 1 - nSplitQty);
|
||||
m_SplitPositionList[m_SplitPositionList.Count - 1].SetDimension(dNewDimension);
|
||||
ParentArea.AreaList.Remove(this);
|
||||
Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS);
|
||||
newFill.SetAreaType(AreaTypes.FILL);
|
||||
ParentArea.AreaList.Add(newFill);
|
||||
}
|
||||
else
|
||||
dNewDimension = dLastDimension / (value + 1 - nSplitQty);
|
||||
// aggiungo area Split di default
|
||||
for (var SplitIndex = m_SplitPositionList.Count; SplitIndex <= value; SplitIndex++)
|
||||
SplitPositionList.Add(new SplitDimension(dNewDimension, true, this));
|
||||
SetSplitShape(SplitShapes.HORIZONTAL);
|
||||
}
|
||||
else if (value == 0)
|
||||
{
|
||||
SplitPositionList.RemoveAt(1);
|
||||
SplitPositionList.RemoveAt(0);
|
||||
}
|
||||
// Ricalcolo dimensioni rimuovendo split
|
||||
else
|
||||
{
|
||||
double dLastDimension = 0;
|
||||
for (var SplitIndex = m_SplitPositionList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1)
|
||||
// Ricalcolo dimensioni aggiungendo split
|
||||
if (value > m_SplitVertList.Count - 1)
|
||||
{
|
||||
dLastDimension += m_SplitPositionList[SplitIndex].dDimension;
|
||||
SplitPositionList.RemoveAt(SplitIndex);
|
||||
// recupero larghezza ultimo
|
||||
double dLastDimension = 100;
|
||||
double dNewDimension = 100;
|
||||
if (m_SplitVertList.Count > 0)
|
||||
{
|
||||
dLastDimension = m_SplitVertList[m_SplitVertList.Count - 1].dDimension;
|
||||
dNewDimension = dLastDimension / (value + 1 - nSplitQtyVert);
|
||||
m_SplitVertList[m_SplitVertList.Count - 1].SetDimension(dNewDimension);
|
||||
}
|
||||
else
|
||||
dNewDimension = dLastDimension / (value + 1 - nSplitQtyVert);
|
||||
// aggiungo area Split di default
|
||||
for (var SplitIndex = m_SplitVertList.Count; SplitIndex <= value; SplitIndex++)
|
||||
m_SplitVertList.Add(new SplitDimension(dNewDimension, true, this, true));
|
||||
}
|
||||
dLastDimension += m_SplitPositionList[SplitPositionList.Count - 1].dDimension;
|
||||
SplitPositionList[SplitPositionList.Count - 1].SetDimension(dLastDimension);
|
||||
}
|
||||
// Se aggiungo split devo aggiungere vetro nell'area splitted aggiunta
|
||||
for (var SplitIndex = AreaList.Count; SplitIndex <= SplitPositionList.Count - 1; SplitIndex++)
|
||||
{
|
||||
AreaList.Add(Splitted.CreateSplitted(this));
|
||||
Fill newFill = new Fill(AreaList.Last(), ParentWindow);
|
||||
newFill.SetFillType(FillTypes.GLASS);
|
||||
newFill.SetAreaType(AreaTypes.FILL);
|
||||
AreaList[AreaList.Count - 1].AreaList.Add(newFill);
|
||||
}
|
||||
// Se ho più di uno split, elimino l'ultimo
|
||||
if (AreaList.Count > 2)
|
||||
{
|
||||
for (var SplitIndex = SplitPositionList.Count; SplitIndex <= AreaList.Count - 1; SplitIndex++)
|
||||
else if (value == 0)
|
||||
{
|
||||
AreaList.Remove(AreaList[AreaList.Count - 1]);
|
||||
m_SplitVertList.RemoveAt(1);
|
||||
m_SplitVertList.RemoveAt(0);
|
||||
}
|
||||
// Ricalcolo dimensioni rimuovendo split
|
||||
else
|
||||
{
|
||||
double dLastDimension = 0;
|
||||
for (var SplitIndex = m_SplitVertList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1)
|
||||
{
|
||||
dLastDimension += m_SplitVertList[SplitIndex].dDimension;
|
||||
m_SplitVertList.RemoveAt(SplitIndex);
|
||||
}
|
||||
dLastDimension += m_SplitVertList[m_SplitVertList.Count - 1].dDimension;
|
||||
m_SplitVertList[m_SplitVertList.Count - 1].SetDimension(dLastDimension);
|
||||
}
|
||||
// Controllo quanti split orizzontali ci sono
|
||||
int nHoriz = m_SplitHorizList.Count > 0 ? m_SplitHorizList.Count : 1;
|
||||
// Se aggiungo split devo aggiungere vetro nell'area splitted aggiunta
|
||||
for (var SplitIndex = AreaList.Count; SplitIndex <= (m_SplitVertList.Count * nHoriz) - 1; SplitIndex++)
|
||||
{
|
||||
AreaList.Add(Splitted.CreateSplitted(this));
|
||||
Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS);
|
||||
newFill.SetAreaType(AreaTypes.FILL);
|
||||
AreaList[AreaList.Count - 1].AreaList.Add(newFill);
|
||||
}
|
||||
// Se ho più di uno split, elimino l'ultimo
|
||||
if (AreaList.Count > 2)
|
||||
{
|
||||
int nAreaList = AreaList.Count - 1;
|
||||
for (var SplitIndex = (m_SplitVertList.Count * nHoriz); SplitIndex <= nAreaList; SplitIndex++)
|
||||
{
|
||||
AreaList.Remove(AreaList[AreaList.Count - 1]);
|
||||
}
|
||||
}
|
||||
// Se elimino l'unico split presente
|
||||
else
|
||||
{
|
||||
Splitted s = (Splitted)AreaList[0];
|
||||
s.SetParentArea(ParentArea);
|
||||
ParentArea.AreaList.Add(s);
|
||||
ParentArea.AreaList.Remove(this);
|
||||
}
|
||||
}
|
||||
// Se elimino l'unico split presente
|
||||
else
|
||||
{
|
||||
Splitted s = (Splitted)AreaList[0];
|
||||
s.SetParentArea(ParentArea);
|
||||
ParentArea.AreaList.Add(s);
|
||||
ParentArea.AreaList.Remove(this);
|
||||
}
|
||||
m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
|
||||
}
|
||||
}
|
||||
|
||||
internal void SetSplitQty(int Qty, bool NotifyProperty = false)
|
||||
internal void SetSplitQtyVert(int QtyVert, bool NotifyProperty = false)
|
||||
{
|
||||
if (Qty > m_SplitPositionList.Count)
|
||||
if (QtyVert > m_SplitVertList.Count)
|
||||
{
|
||||
// recupero larghezza ultimo
|
||||
double dLastDimension = 100;
|
||||
double dNewDimension = 100;
|
||||
if (m_SplitPositionList.Count > 0)
|
||||
if (m_SplitVertList.Count > 0)
|
||||
{
|
||||
dLastDimension = m_SplitPositionList[m_SplitPositionList.Count - 1].dDimension;
|
||||
dNewDimension = dLastDimension / (Qty + 1 - nSplitQty);
|
||||
m_SplitPositionList[m_SplitPositionList.Count - 1].dDimension = dNewDimension;
|
||||
dLastDimension = m_SplitVertList[m_SplitVertList.Count - 1].dDimension;
|
||||
dNewDimension = dLastDimension / (QtyVert + 1 - nSplitQtyVert);
|
||||
m_SplitVertList[m_SplitVertList.Count - 1].dDimension = dNewDimension;
|
||||
}
|
||||
else
|
||||
dNewDimension = dLastDimension / (Qty + 1 - nSplitQty);
|
||||
dNewDimension = dLastDimension / (QtyVert + 1 - nSplitQtyVert);
|
||||
// aggiungo area Split di default
|
||||
for (var SplitIndex = m_SplitPositionList.Count; SplitIndex <= Qty; SplitIndex++)
|
||||
SplitPositionList.Add(new SplitDimension(dNewDimension, true, this));
|
||||
for (var SplitIndex = m_SplitVertList.Count; SplitIndex <= QtyVert; SplitIndex++)
|
||||
m_SplitVertList.Add(new SplitDimension(dNewDimension, true, this, true));
|
||||
}
|
||||
else if (Qty < m_SplitPositionList.Count)
|
||||
else if (QtyVert < m_SplitVertList.Count)
|
||||
{
|
||||
for (var SplitIndex = m_SplitPositionList.Count - 1; SplitIndex >= Qty; SplitIndex += -1)
|
||||
SplitPositionList.RemoveAt(SplitIndex);
|
||||
for (var SplitIndex = m_SplitVertList.Count - 1; SplitIndex >= QtyVert; SplitIndex += -1)
|
||||
m_SplitVertList.RemoveAt(SplitIndex);
|
||||
}
|
||||
}
|
||||
|
||||
public int nSplitQtyHoriz
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_SplitHorizList.Count > 0 ? m_SplitHorizList.Count - 1 : 0;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == 0)
|
||||
{
|
||||
for (var SplitIndex = m_SplitHorizList.Count - 1; SplitIndex >= value; SplitIndex += -1)
|
||||
m_SplitHorizList.RemoveAt(SplitIndex);
|
||||
if (nSplitQtyVert == 0)
|
||||
{
|
||||
ParentArea.AreaList.Remove(this);
|
||||
Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS);
|
||||
newFill.SetAreaType(AreaTypes.FILL);
|
||||
ParentArea.AreaList.Add(newFill);
|
||||
}
|
||||
else
|
||||
SetSplitShape(SplitShapes.VERTICAL);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Ricalcolo dimensioni aggiungendo split
|
||||
if (value > m_SplitHorizList.Count - 1)
|
||||
{
|
||||
// recupero larghezza ultimo
|
||||
double dLastDimension = 100;
|
||||
double dNewDimension = 100;
|
||||
if (m_SplitHorizList.Count > 0)
|
||||
{
|
||||
dLastDimension = m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension;
|
||||
dNewDimension = dLastDimension / (value + 1 - nSplitQtyHoriz);
|
||||
m_SplitHorizList[m_SplitHorizList.Count - 1].SetDimension(dNewDimension);
|
||||
}
|
||||
else
|
||||
dNewDimension = dLastDimension / (value + 1 - nSplitQtyHoriz);
|
||||
// aggiungo area Split di default
|
||||
for (var SplitIndex = m_SplitHorizList.Count; SplitIndex <= value; SplitIndex++)
|
||||
m_SplitHorizList.Add(new SplitDimension(dNewDimension, true, this, false));
|
||||
}
|
||||
// Ricalcolo dimensioni rimuovendo split
|
||||
else
|
||||
{
|
||||
double dLastDimension = 0;
|
||||
for (var SplitIndex = m_SplitHorizList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1)
|
||||
{
|
||||
dLastDimension += m_SplitHorizList[SplitIndex].dDimension;
|
||||
m_SplitHorizList.RemoveAt(SplitIndex);
|
||||
}
|
||||
dLastDimension += m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension;
|
||||
m_SplitHorizList[m_SplitHorizList.Count - 1].SetDimension(dLastDimension);
|
||||
}
|
||||
// Controllo quanti split verticali ci sono
|
||||
int nVert = m_SplitVertList.Count > 0 ? m_SplitVertList.Count : 1;
|
||||
// Se aggiungo split devo aggiungere vetro nell'area splitted aggiunta
|
||||
for (var SplitIndex = AreaList.Count; SplitIndex <= (m_SplitHorizList.Count * nVert) - 1; SplitIndex++)
|
||||
{
|
||||
AreaList.Add(Splitted.CreateSplitted(this));
|
||||
Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS);
|
||||
newFill.SetAreaType(AreaTypes.FILL);
|
||||
AreaList[AreaList.Count - 1].AreaList.Add(newFill);
|
||||
}
|
||||
// Se ho più di uno split, elimino l'ultimo
|
||||
if (AreaList.Count > 2)
|
||||
{
|
||||
int nAreaList = AreaList.Count - 1;
|
||||
for (var SplitIndex = (m_SplitHorizList.Count * nVert); SplitIndex <= nAreaList; SplitIndex++)
|
||||
{
|
||||
AreaList.Remove(AreaList[AreaList.Count - 1]);
|
||||
}
|
||||
}
|
||||
// Se elimino l'unico split presente
|
||||
else
|
||||
{
|
||||
Splitted s = (Splitted)AreaList[0];
|
||||
s.SetParentArea(ParentArea);
|
||||
ParentArea.AreaList.Add(s);
|
||||
ParentArea.AreaList.Remove(this);
|
||||
}
|
||||
}
|
||||
m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
|
||||
}
|
||||
}
|
||||
internal void SetSplitQtyHoriz(int QtyHoriz, bool NotifyProperty = false)
|
||||
{
|
||||
if (QtyHoriz > m_SplitHorizList.Count)
|
||||
{
|
||||
// recupero larghezza ultimo
|
||||
double dLastDimension = 100;
|
||||
double dNewDimension = 100;
|
||||
if (m_SplitHorizList.Count > 0)
|
||||
{
|
||||
dLastDimension = m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension;
|
||||
dNewDimension = dLastDimension / (QtyHoriz + 1 - nSplitQtyHoriz);
|
||||
m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension = dNewDimension;
|
||||
}
|
||||
else
|
||||
dNewDimension = dLastDimension / (QtyHoriz + 1 - nSplitQtyHoriz);
|
||||
// aggiungo area Split di default
|
||||
for (var SplitIndex = m_SplitHorizList.Count; SplitIndex <= QtyHoriz; SplitIndex++)
|
||||
m_SplitHorizList.Add(new SplitDimension(dNewDimension, true, this, false));
|
||||
}
|
||||
else if (QtyHoriz < m_SplitHorizList.Count)
|
||||
{
|
||||
for (var SplitIndex = m_SplitHorizList.Count - 1; SplitIndex >= QtyHoriz; SplitIndex += -1)
|
||||
m_SplitHorizList.RemoveAt(SplitIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1525,6 +1696,39 @@ namespace WebWindowComplex
|
||||
set
|
||||
{
|
||||
m_SelSplitShape = (SplitShapes)IdNameStruct.IdFromInd(value, m_SplitShapeList);
|
||||
// Cancello elementi nello split e azzero quantità orizzontale e verticale
|
||||
AreaList.Clear();
|
||||
SetSplitQtyVert(0);
|
||||
SetSplitQtyHoriz(0);
|
||||
if (m_SelSplitShape == SplitShapes.VERTICAL)
|
||||
{
|
||||
// Inserisco valori di default
|
||||
SetSplitQtyVert(1);
|
||||
SetSplitStartVert(true);
|
||||
}
|
||||
else if (m_SelSplitShape == SplitShapes.HORIZONTAL)
|
||||
{
|
||||
// Inserisco valori di default
|
||||
SetSplitQtyHoriz(1);
|
||||
SetSplitStartVert(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Inserisco valori di default
|
||||
SetSplitQtyVert(1);
|
||||
SetSplitQtyHoriz(1);
|
||||
SetSplitStartVert(true);
|
||||
}
|
||||
// Aggiungo area Splitted e vetro
|
||||
int nVert = m_SplitVertList.Count > 0 ? m_SplitVertList.Count : 1;
|
||||
int nHoriz = m_SplitHorizList.Count > 0 ? m_SplitHorizList.Count : 1;
|
||||
for (var SplitIndex = 0; SplitIndex <= (nVert * nHoriz) - 1; SplitIndex++)
|
||||
{
|
||||
AreaList.Add(Splitted.CreateSplitted(this));
|
||||
Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS);
|
||||
newFill.SetAreaType(AreaTypes.FILL);
|
||||
AreaList[SplitIndex].AreaList.Add(newFill);
|
||||
}
|
||||
m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
|
||||
}
|
||||
}
|
||||
@@ -1562,6 +1766,32 @@ namespace WebWindowComplex
|
||||
}
|
||||
}
|
||||
|
||||
private ObservableCollection<SplitDimension> m_SplitVertList = new ObservableCollection<SplitDimension>();
|
||||
public ObservableCollection<SplitDimension> SplitVertList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_SplitVertList;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_SplitVertList = value;
|
||||
}
|
||||
}
|
||||
|
||||
private ObservableCollection<SplitDimension> m_SplitHorizList = new ObservableCollection<SplitDimension>();
|
||||
public ObservableCollection<SplitDimension> SplitHorizList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_SplitHorizList;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_SplitHorizList = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Split(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow)
|
||||
{
|
||||
}
|
||||
@@ -1569,6 +1799,8 @@ namespace WebWindowComplex
|
||||
internal static Split CreateSplit(Area Area, SplitShapes SplitShape)
|
||||
{
|
||||
Split Split = new Split(Area, Area.ParentWindow);
|
||||
AddCounterGroup();
|
||||
Split.SetIdGroup(nCounterGroup);
|
||||
Split.SetAreaType(AreaTypes.SPLIT);
|
||||
Split.SetSplitShape(SplitShape, true);
|
||||
return Split;
|
||||
@@ -1577,7 +1809,11 @@ namespace WebWindowComplex
|
||||
public override Split Copy(Area newParentArea)
|
||||
{
|
||||
Split newSplit = new Split(newParentArea, ParentWindow);
|
||||
newSplit.SetSplitQty(nSplitQty);
|
||||
AddCounterGroup();
|
||||
newSplit.SetIdGroup(nCounterGroup);
|
||||
newSplit.SetSplitStartVert(bSplitStartVert);
|
||||
newSplit.SetSplitQtyVert(nSplitQtyVert);
|
||||
newSplit.SetSplitQtyHoriz(nSplitQtyHoriz);
|
||||
newSplit.SetSplitShape(SelSplitShape, true);
|
||||
newSplit.SetAreaType(AreaType);
|
||||
foreach (var item in AreaList)
|
||||
@@ -1588,11 +1824,27 @@ namespace WebWindowComplex
|
||||
return newSplit;
|
||||
}
|
||||
|
||||
public void Remove()
|
||||
{
|
||||
ParentArea.AreaList.Remove(this);
|
||||
Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS);
|
||||
newFill.SetAreaType(AreaTypes.FILL);
|
||||
ParentArea.AreaList.Add(newFill);
|
||||
m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
|
||||
}
|
||||
|
||||
internal override JsonArea Serialize()
|
||||
{
|
||||
JsonSplit JsonSplit = new JsonSplit(m_SelSplitShape);
|
||||
foreach (var SplitPosition in m_SplitPositionList)
|
||||
JsonSplit.SplitPositionList.Add(SplitPosition.Serialize());
|
||||
if (nCounterGroup < IdGroup)
|
||||
Area.nCounterGroup = IdGroup;
|
||||
JsonSplit JsonSplit = new JsonSplit(m_SelSplitShape, IdGroup);
|
||||
//foreach (var SplitPosition in m_SplitPositionList)
|
||||
// JsonSplit.SplitPositionList.Add(SplitPosition.Serialize());
|
||||
JsonSplit.SplitStartVert = bSplitStartVert;
|
||||
foreach (var SplitVert in m_SplitVertList)
|
||||
JsonSplit.SplitVertList.Add(SplitVert.Serialize());
|
||||
foreach (var SplitHoriz in m_SplitHorizList)
|
||||
JsonSplit.SplitHorizList.Add(SplitHoriz.Serialize());
|
||||
foreach (var Area in AreaList)
|
||||
JsonSplit.AreaList.Add(Area.Serialize());
|
||||
return JsonSplit;
|
||||
@@ -1601,7 +1853,6 @@ namespace WebWindowComplex
|
||||
|
||||
public class Splitted : Area
|
||||
{
|
||||
|
||||
public Splitted(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow)
|
||||
{
|
||||
}
|
||||
@@ -1609,6 +1860,8 @@ namespace WebWindowComplex
|
||||
internal static Splitted CreateSplitted(Area ParentArea)
|
||||
{
|
||||
Splitted Splitted = new Splitted(ParentArea, ParentArea.ParentWindow);
|
||||
AddCounterGroup();
|
||||
Splitted.SetIdGroup(nCounterGroup);
|
||||
Splitted.SetAreaType(AreaTypes.SPLITTED);
|
||||
return Splitted;
|
||||
}
|
||||
@@ -1616,6 +1869,8 @@ namespace WebWindowComplex
|
||||
public override Splitted Copy(Area newParentArea)
|
||||
{
|
||||
Splitted newSplitted = new Splitted(newParentArea, ParentWindow);
|
||||
AddCounterGroup();
|
||||
newSplitted.SetIdGroup(nCounterGroup);
|
||||
newSplitted.SetAreaType(AreaType);
|
||||
foreach (var item in AreaList)
|
||||
{
|
||||
@@ -1627,7 +1882,9 @@ namespace WebWindowComplex
|
||||
|
||||
internal override JsonArea Serialize()
|
||||
{
|
||||
JsonSplitted JsonSplitted = new JsonSplitted();
|
||||
if (nCounterGroup < IdGroup)
|
||||
Area.nCounterGroup = IdGroup;
|
||||
JsonSplitted JsonSplitted = new JsonSplitted(IdGroup);
|
||||
foreach (var Area in AreaList)
|
||||
JsonSplitted.AreaList.Add(Area.Serialize());
|
||||
return JsonSplitted;
|
||||
@@ -1692,6 +1949,8 @@ namespace WebWindowComplex
|
||||
internal static Fill CreateFill(Area AreaParent, FillTypes FillType)
|
||||
{
|
||||
Fill Fill = new Fill(AreaParent, AreaParent.ParentWindow);
|
||||
AddCounterGroup();
|
||||
Fill.SetIdGroup(nCounterGroup);
|
||||
Fill.SetAreaType(AreaTypes.FILL);
|
||||
Fill.SetFillType(FillType);
|
||||
return Fill;
|
||||
@@ -1700,6 +1959,8 @@ namespace WebWindowComplex
|
||||
public override Fill Copy(Area newParentArea)
|
||||
{
|
||||
Fill newFill = new Fill(newParentArea, m_ParentWindow);
|
||||
AddCounterGroup();
|
||||
newFill.SetIdGroup(nCounterGroup);
|
||||
newFill.SetFillType(SelFillType);
|
||||
newFill.SetAreaType(AreaType);
|
||||
return newFill;
|
||||
@@ -1707,7 +1968,9 @@ namespace WebWindowComplex
|
||||
|
||||
internal override JsonArea Serialize()
|
||||
{
|
||||
JsonFill JsonFill = new JsonFill(FillType);
|
||||
if (nCounterGroup < IdGroup)
|
||||
Area.nCounterGroup = IdGroup;
|
||||
JsonFill JsonFill = new JsonFill(FillType, IdGroup);
|
||||
foreach (var Area in AreaList)
|
||||
JsonFill.AreaList.Add(Area.Serialize());
|
||||
return JsonFill;
|
||||
@@ -1724,6 +1987,7 @@ namespace WebWindowComplex
|
||||
return m_ParentArea;
|
||||
}
|
||||
}
|
||||
|
||||
private int m_nIndex;
|
||||
public int nIndex
|
||||
{
|
||||
@@ -1797,82 +2061,82 @@ namespace WebWindowComplex
|
||||
}
|
||||
}
|
||||
|
||||
public class Hardware
|
||||
{
|
||||
private string m_sId;
|
||||
public string sId
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sId;
|
||||
}
|
||||
}
|
||||
//public class Hardware
|
||||
//{
|
||||
// private string m_sId;
|
||||
// public string sId
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// return m_sId;
|
||||
// }
|
||||
// }
|
||||
|
||||
private string m_sFamily;
|
||||
public string sFamily
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sFamily;
|
||||
}
|
||||
}
|
||||
// private string m_sFamily;
|
||||
// public string sFamily
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// return m_sFamily;
|
||||
// }
|
||||
// }
|
||||
|
||||
private string m_sName;
|
||||
public string sName
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sName;
|
||||
}
|
||||
}
|
||||
// private string m_sName;
|
||||
// public string sName
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// return m_sName;
|
||||
// }
|
||||
// }
|
||||
|
||||
private string m_sOpeningType;
|
||||
public string sOpeningType
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sOpeningType;
|
||||
}
|
||||
}
|
||||
// private string m_sOpeningType;
|
||||
// public string sOpeningType
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// return m_sOpeningType;
|
||||
// }
|
||||
// }
|
||||
|
||||
private string m_sShape;
|
||||
public string sShape
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sShape;
|
||||
}
|
||||
}
|
||||
// private string m_sShape;
|
||||
// public string sShape
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// return m_sShape;
|
||||
// }
|
||||
// }
|
||||
|
||||
private int m_nSashQty;
|
||||
public int nSashQty
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_nSashQty;
|
||||
}
|
||||
}
|
||||
// private int m_nSashQty;
|
||||
// public int nSashQty
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// return m_nSashQty;
|
||||
// }
|
||||
// }
|
||||
|
||||
private int m_nSashPosition;
|
||||
public int nSashPosition
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_nSashPosition;
|
||||
}
|
||||
}
|
||||
// private int m_nSashPosition;
|
||||
// public int nSashPosition
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// return m_nSashPosition;
|
||||
// }
|
||||
// }
|
||||
|
||||
public Hardware(string sId, string sFamily, string sName, string sOpeningType, string sShape, int nSashQty, int nSashPosition)
|
||||
{
|
||||
m_sId = sId;
|
||||
m_sFamily = sFamily;
|
||||
m_sName = sName;
|
||||
m_sOpeningType = sOpeningType;
|
||||
m_sShape = sShape;
|
||||
m_nSashQty = nSashQty;
|
||||
m_nSashPosition = nSashPosition;
|
||||
}
|
||||
}
|
||||
// public Hardware(string sId, string sFamily, string sName, string sOpeningType, string sShape, int nSashQty, int nSashPosition)
|
||||
// {
|
||||
// m_sId = sId;
|
||||
// m_sFamily = sFamily;
|
||||
// m_sName = sName;
|
||||
// m_sOpeningType = sOpeningType;
|
||||
// m_sShape = sShape;
|
||||
// m_nSashQty = nSashQty;
|
||||
// m_nSashPosition = nSashPosition;
|
||||
// }
|
||||
//}
|
||||
|
||||
public partial class ParametriOpzioni
|
||||
{
|
||||
@@ -2087,6 +2351,15 @@ namespace WebWindowComplex
|
||||
// reference
|
||||
private Sash m_Parent;
|
||||
|
||||
private int m_nSashId;
|
||||
public int nSashId
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_nSashId;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_bIsRelative = false;
|
||||
public bool bIsRelative
|
||||
{
|
||||
@@ -2264,17 +2537,18 @@ namespace WebWindowComplex
|
||||
|
||||
public SashDimension Copy()
|
||||
{
|
||||
SashDimension newSashDim = new SashDimension(dDimension, bIsRelative, m_Parent);
|
||||
SashDimension newSashDim = new SashDimension(dDimension, bIsRelative, m_Parent, m_nSashId);
|
||||
newSashDim.SetOpeningType(SelOpeningType);
|
||||
newSashDim.SetHasHandle(bHasHandle);
|
||||
return newSashDim;
|
||||
}
|
||||
|
||||
public SashDimension(double dDimension, bool bIsRelative, Sash Parent)
|
||||
public SashDimension(double dDimension, bool bIsRelative, Sash Parent, int nSashId)
|
||||
{
|
||||
m_dDimension = dDimension;
|
||||
m_bIsRelative = bIsRelative;
|
||||
m_Parent = Parent;
|
||||
m_nSashId = nSashId;
|
||||
// assengno maniglia
|
||||
if (Parent.SashList.Count == 0 || !Parent.SashList.Any(x => x.bHasHandle))
|
||||
m_bHasHandle = true;
|
||||
@@ -2299,13 +2573,13 @@ namespace WebWindowComplex
|
||||
|
||||
case Openings.TILTTURN_LEFT:
|
||||
{
|
||||
SetOpeningType(Openings.TILTTURN_RIGHT);
|
||||
SetOpeningType(Openings.TURNONLY_RIGHT);
|
||||
break;
|
||||
}
|
||||
|
||||
case Openings.TILTTURN_RIGHT:
|
||||
{
|
||||
SetOpeningType(Openings.TILTTURN_LEFT);
|
||||
SetOpeningType(Openings.TURNONLY_LEFT);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2352,7 +2626,7 @@ namespace WebWindowComplex
|
||||
|
||||
internal JsonSashDimension Serialize()
|
||||
{
|
||||
JsonSashDimension JsonSashDimension = new JsonSashDimension(OpeningType, m_bHasHandle, m_dDimension);
|
||||
JsonSashDimension JsonSashDimension = new JsonSashDimension(OpeningType, m_bHasHandle, m_dDimension, m_nSashId);
|
||||
return JsonSashDimension;
|
||||
}
|
||||
}
|
||||
@@ -2375,6 +2649,20 @@ namespace WebWindowComplex
|
||||
m_bIsRelative = value;
|
||||
}
|
||||
|
||||
private bool m_bIsVertListDim = false;
|
||||
public bool bIsVertListDim
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bIsVertListDim;
|
||||
}
|
||||
}
|
||||
internal void SetIsVertListDim(bool value)
|
||||
{
|
||||
m_bIsVertListDim = value;
|
||||
}
|
||||
|
||||
|
||||
private double m_dDimension;
|
||||
public double dDimension
|
||||
{
|
||||
@@ -2390,8 +2678,13 @@ namespace WebWindowComplex
|
||||
// se sono in percentuale
|
||||
if (m_bIsRelative)
|
||||
{
|
||||
List<SplitDimension> RelativeDimList = new List<SplitDimension>();
|
||||
if (bIsVertListDim)
|
||||
RelativeDimList = m_Parent.SplitVertList.Where(x => x.bIsRelative).ToList();
|
||||
else
|
||||
RelativeDimList = m_Parent.SplitHorizList.Where(x => x.bIsRelative).ToList();
|
||||
// verifico se ci sono assoluti
|
||||
List<SplitDimension> RelativeDimList = m_Parent.SplitPositionList.Where(x => x.bIsRelative).ToList();
|
||||
//List<SplitDimension> RelativeDimList = m_Parent.SplitPositionList.Where(x => x.bIsRelative).ToList();
|
||||
if (RelativeDimList.Count > 0)
|
||||
{
|
||||
if (m_Parent.bIsPercentage)
|
||||
@@ -2462,14 +2755,15 @@ namespace WebWindowComplex
|
||||
|
||||
public SplitDimension Copy()
|
||||
{
|
||||
SplitDimension newSplitDim = new SplitDimension(dDimension, bIsRelative, m_Parent);
|
||||
SplitDimension newSplitDim = new SplitDimension(dDimension, bIsRelative, m_Parent, bIsVertListDim);
|
||||
return newSplitDim;
|
||||
}
|
||||
public SplitDimension(double dDimension, bool bIsRelative, Split Parent)
|
||||
public SplitDimension(double dDimension, bool bIsRelative, Split Parent, bool IsVertList)
|
||||
{
|
||||
m_dDimension = dDimension;
|
||||
m_bIsRelative = bIsRelative;
|
||||
m_Parent = Parent;
|
||||
m_bIsVertListDim = IsVertList;
|
||||
}
|
||||
|
||||
internal JsonSplitDimension Serialize()
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>2.7.9.3009</Version>
|
||||
<Version>2.7.9.3011</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione JWD per LUX</Description>
|
||||
@@ -111,6 +111,18 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -310,7 +310,7 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => currSplit.Remove()">Remove split</button>
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RemoveArea(currSplit)">Remove split</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -460,7 +460,7 @@
|
||||
<div class="col-sm-6"></div>
|
||||
<div class="col-sm-6">
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => item.Remove()">Remove window</button>
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RemoveArea(item)">Remove window</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+27
-11
@@ -785,17 +785,6 @@ namespace WebWindowTest
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per scambiare due aree di uno split
|
||||
/// </summary>
|
||||
/// <param name="currArea"> Area corrente </param>
|
||||
/// <returns></returns>
|
||||
private async Task SwapTwoAree(Area currArea)
|
||||
{
|
||||
currArea.SwapAree();
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
@@ -824,6 +813,33 @@ namespace WebWindowTest
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per scambiare due aree di uno split
|
||||
/// </summary>
|
||||
/// <param name="currArea"> Area corrente </param>
|
||||
/// <returns></returns>
|
||||
private async Task SwapTwoAree(Area currArea)
|
||||
{
|
||||
currArea.SwapAree();
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per eliminare Split o Sash
|
||||
/// </summary>
|
||||
/// <param name="currArea"> Area corrente </param>
|
||||
/// <returns></returns>
|
||||
private void RemoveArea(Area currArea)
|
||||
{
|
||||
if(currArea is Split)
|
||||
((Split)currArea).Remove();
|
||||
else if (currArea is Sash)
|
||||
{
|
||||
((Sash)currArea).Remove();
|
||||
}
|
||||
currStep = CompileStep.Gerarchia;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per cambiare step e aggiornare preview svg
|
||||
/// </summary>
|
||||
|
||||
@@ -129,10 +129,6 @@ namespace WebWindowTest
|
||||
{
|
||||
m_CounterGroup++;
|
||||
}
|
||||
//public static void DelCounterGroup()
|
||||
//{
|
||||
// m_CounterGroup--;
|
||||
//}
|
||||
public static int nCounterGroup
|
||||
{
|
||||
get => m_CounterGroup;
|
||||
|
||||
Reference in New Issue
Block a user