Aggiunto arc element per Frame e Sash (da rivedere)
This commit is contained in:
@@ -108,8 +108,15 @@ namespace WebWindowComplex.Models
|
||||
SashArea.SetSelFamilyHardware("");
|
||||
// Inserisco hardware di default
|
||||
SashArea.SetSelHardwareFromId("000000");
|
||||
if (ParentWindow.AreaList.First().SelShapeIndex == (int)Shapes.ARC ||
|
||||
ParentWindow.AreaList.First().SelShapeIndex == (int)Shapes.DOUBLEARC ||
|
||||
ParentWindow.AreaList.First().SelShapeIndex == (int)Shapes.ARC_FULL ||
|
||||
ParentWindow.AreaList.First().SelShapeIndex == (int)Shapes.THREECENTERARC)
|
||||
SashArea.SashArcElem = new SashArcElement(SashArea, ParentWindow, 10, true);
|
||||
else
|
||||
SashArea.SashArcElem = null;
|
||||
// Salvo gli oggetti già presenti e li cancello da AreaList
|
||||
List<Area> ContentArea = new List<Area>();
|
||||
List <Area> ContentArea = new List<Area>();
|
||||
ContentArea.Add(AreaList[0]);
|
||||
AreaList.Remove(AreaList[0]);
|
||||
// Aggiungo area
|
||||
|
||||
@@ -20,6 +20,18 @@ namespace WebWindowComplex.Models
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public FrameArcElement? FrameArcElem
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_FrameArcElem;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_FrameArcElem = value!;
|
||||
}
|
||||
}
|
||||
|
||||
public bool BottomRail
|
||||
{
|
||||
get
|
||||
@@ -207,11 +219,40 @@ namespace WebWindowComplex.Models
|
||||
break;
|
||||
}
|
||||
}
|
||||
switch (SelShape)
|
||||
{
|
||||
case Shapes.RECTANGLE:
|
||||
case Shapes.RIGHTCHAMFER:
|
||||
case Shapes.LEFTCHAMFER:
|
||||
case Shapes.DOUBLECHAMFER:
|
||||
case Shapes.TRIANGLE:
|
||||
{
|
||||
FrameArcElem = null;
|
||||
SearchSash(this);
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_Shape = SelShape;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void SearchSash(Area node)
|
||||
{
|
||||
if (node != null)
|
||||
{
|
||||
if (node.AreaType.Equals(AreaTypes.SASH))
|
||||
{
|
||||
Sash s = (Sash)node;
|
||||
s.SashArcElem = null;
|
||||
}
|
||||
foreach (var item in node.AreaList)
|
||||
{
|
||||
SearchSash(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Shapes Shape
|
||||
{
|
||||
get
|
||||
@@ -241,14 +282,20 @@ namespace WebWindowComplex.Models
|
||||
|
||||
#region Internal Methods
|
||||
|
||||
internal void SetFrameArcElem(FrameArcElement arcElement)
|
||||
{
|
||||
m_FrameArcElem = arcElement;
|
||||
}
|
||||
|
||||
internal static Area CreateFrame(Window Window)
|
||||
{
|
||||
Frame NewFrame = new Frame(null, Window);
|
||||
NewFrame.SetAreaType(AreaTypes.FRAME);
|
||||
NewFrame.SetSelShape(Shapes.RECTANGLE);
|
||||
NewFrame.SetBottomRail(false);
|
||||
NewFrame.SetBottomRailQty(0);
|
||||
return NewFrame;
|
||||
Frame newFrame = new Frame(null, Window);
|
||||
newFrame.SetAreaType(AreaTypes.FRAME);
|
||||
newFrame.SetSelShape(Shapes.RECTANGLE);
|
||||
newFrame.SetBottomRail(false);
|
||||
newFrame.SetBottomRailQty(0);
|
||||
newFrame.FrameArcElem = null;
|
||||
return newFrame;
|
||||
}
|
||||
|
||||
internal override JsonArea Serialize(bool hideHw)
|
||||
@@ -257,6 +304,10 @@ namespace WebWindowComplex.Models
|
||||
if (nCounterGroup < GroupId)
|
||||
Area.nCounterGroup = GroupId;
|
||||
JsonFrame JsonFrame = new JsonFrame(m_Shape, m_bBottomRail, m_nBottomRailQty, GroupId);
|
||||
if (FrameArcElem != null)
|
||||
JsonFrame.ArcElement = FrameArcElem.Serialize();
|
||||
else
|
||||
JsonFrame.ArcElement = null;
|
||||
foreach (var Dimension in DimensionList)
|
||||
JsonFrame.DimensionList.Add(Dimension.Serialize());
|
||||
foreach (var Joint in JointList)
|
||||
@@ -395,6 +446,8 @@ namespace WebWindowComplex.Models
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private FrameArcElement m_FrameArcElem = new FrameArcElement();
|
||||
|
||||
private bool m_bBottomRail;
|
||||
|
||||
private List<FrameDimension> m_DimensionList = new List<FrameDimension>();
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using WebWindowComplex.Json;
|
||||
using static WebWindowComplex.Json.WindowConst;
|
||||
|
||||
namespace WebWindowComplex.Models
|
||||
{
|
||||
public class FrameArcElement
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public FrameArcElement() { }
|
||||
|
||||
public FrameArcElement(Area ParentArea, Window ParentWindow, double nSection, bool bCutEdge, bool bIsAlign)
|
||||
{
|
||||
m_ParentArea = ParentArea;
|
||||
m_ParentWindow = ParentWindow;
|
||||
m_nSection = nSection;
|
||||
m_bCutEdge = bCutEdge;
|
||||
m_bIsAlign = bIsAlign;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public int nQty
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_nQty;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_nQty = value;
|
||||
}
|
||||
}
|
||||
|
||||
public double nSection
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_nSection;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_nSection = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool bCutEdge
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bCutEdge;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bCutEdge = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool bIsAlign
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bIsAlign;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bIsAlign = value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Internal Methods
|
||||
|
||||
internal void SetQty(int Qty)
|
||||
{
|
||||
m_nQty = Qty;
|
||||
}
|
||||
|
||||
internal void SetSection(double Section)
|
||||
{
|
||||
m_nSection = Section;
|
||||
}
|
||||
|
||||
internal JsonFrameArcElement Serialize()
|
||||
{
|
||||
JsonFrameArcElement jArcElement = new JsonFrameArcElement(nSection, bCutEdge, bIsAlign);
|
||||
return jArcElement;
|
||||
}
|
||||
|
||||
#endregion Internal Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected Area m_ParentArea;
|
||||
protected Window m_ParentWindow;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private double m_nSection;
|
||||
|
||||
private int m_nQty;
|
||||
|
||||
private bool m_bCutEdge = false;
|
||||
|
||||
private bool m_bIsAlign = false;
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -102,7 +102,7 @@ namespace WebWindowComplex.Models
|
||||
if(area is Sash && sName.Equals("Width"))
|
||||
{
|
||||
Sash sash = (Sash)area;
|
||||
int countAbsolute = sash.SashList.Where(x => x.MeasureType.Equals(MeasureTypes.ABSOLUT)).Count();
|
||||
int countAbsolute = sash.SashList.Where(x => x.MeasureType.Equals(MeasureTypes.ABSOLUTE)).Count();
|
||||
if (countAbsolute == sash.SashList.Count)
|
||||
{
|
||||
double sum = sash.SashList.Sum(x => x.dDimension);
|
||||
@@ -132,7 +132,7 @@ namespace WebWindowComplex.Models
|
||||
splitList = split.SplitVertList;
|
||||
else
|
||||
splitList = split.SplitHorizList;
|
||||
int countAbsolute = splitList.Where(x => x.MeasureType.Equals(MeasureTypes.ABSOLUT)).Count();
|
||||
int countAbsolute = splitList.Where(x => x.MeasureType.Equals(MeasureTypes.ABSOLUTE)).Count();
|
||||
if (countAbsolute != 0 && countAbsolute == splitList.Count)
|
||||
{
|
||||
double sum = splitList.Sum(x => x.dDimension);
|
||||
|
||||
@@ -58,6 +58,18 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
}
|
||||
|
||||
public SashArcElement? SashArcElem
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_SashArcElement;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_SashArcElement = value!;
|
||||
}
|
||||
}
|
||||
|
||||
public List<Hardware> HardwareList
|
||||
{
|
||||
get
|
||||
@@ -409,6 +421,13 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
newSash.SetSelFamilyHardwareFromIndex(m_SelHardware.Id);
|
||||
newSash.SetSelHardwareFromId(CustomHwId);
|
||||
if (ParentWindow.AreaList.First().SelShapeIndex == (int)Shapes.ARC ||
|
||||
ParentWindow.AreaList.First().SelShapeIndex == (int)Shapes.DOUBLEARC ||
|
||||
ParentWindow.AreaList.First().SelShapeIndex == (int)Shapes.ARC_FULL ||
|
||||
ParentWindow.AreaList.First().SelShapeIndex == (int)Shapes.THREECENTERARC)
|
||||
newSash.SashArcElem = new SashArcElement(newSash, ParentWindow, 10, true);
|
||||
else
|
||||
newSash.SashArcElem = null;
|
||||
return newSash;
|
||||
}
|
||||
|
||||
@@ -552,7 +571,7 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
switch (split.SplitVertList.ElementAt(i).SelMeasureType)
|
||||
{
|
||||
case MeasureTypes.ABSOLUT:
|
||||
case MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
risultato = CalculateWidthSashGroup(item, split.SplitVertList.ElementAt(i).dDimension);
|
||||
break;
|
||||
@@ -581,7 +600,7 @@ namespace WebWindowComplex.Models
|
||||
Sash sash = (Sash)area;
|
||||
switch (sash.SashList.ElementAt(i).SelMeasureType)
|
||||
{
|
||||
case MeasureTypes.ABSOLUT:
|
||||
case MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
risultato = CalculateWidthSashGroup(item, sash.SashList.ElementAt(i).dDimension);
|
||||
break;
|
||||
@@ -621,13 +640,14 @@ namespace WebWindowComplex.Models
|
||||
foreach(var sashDim in newSash.SashList)
|
||||
{
|
||||
for (var JointIndex = 0; JointIndex <= 3; JointIndex++)
|
||||
sashDim.JointList.Add(new Joint(newSash, JointIndex + 1, Joints.FULL_H));
|
||||
sashDim.JointList.Add(new Joint(newSash, JointIndex + 1, Joints.FULL_V));
|
||||
}
|
||||
newSash.SetSashBottomRail(false);
|
||||
newSash.SetSashBottomRailQty(0);
|
||||
newSash.SetSelFamilyHardware(Sash.s_FamilyHardwareList.First());
|
||||
newSash.ClearHardwareOptionList();
|
||||
newSash.SetFirstHardware();
|
||||
newSash.SashArcElem = null;
|
||||
return newSash;
|
||||
}
|
||||
|
||||
@@ -734,11 +754,20 @@ namespace WebWindowComplex.Models
|
||||
foreach (var HwOption in SelHwOptionList)
|
||||
JsonSash.HwOptionList.Add(new JsonHwOption(HwOption.Key, HwOption.Value));
|
||||
}
|
||||
if (SashArcElem != null)
|
||||
JsonSash.ArcElement = SashArcElem.Serialize();
|
||||
else
|
||||
JsonSash.ArcElement = null;
|
||||
foreach (var Area in AreaList)
|
||||
JsonSash.AreaList.Add(Area.Serialize(hideHw));
|
||||
return JsonSash;
|
||||
}
|
||||
|
||||
internal void SetSashArcElem(SashArcElement arcElement)
|
||||
{
|
||||
m_SashArcElement = arcElement;
|
||||
}
|
||||
|
||||
internal void SetFirstHardware()
|
||||
{
|
||||
if (m_HardwareList.Count > 0)
|
||||
@@ -949,6 +978,7 @@ namespace WebWindowComplex.Models
|
||||
private string m_SelFamilyHardware = "";
|
||||
private Hardware m_SelHardware;
|
||||
private OrientationSash m_SelOrientationSashType;
|
||||
private SashArcElement m_SashArcElement;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using WebWindowComplex.Json;
|
||||
using static WebWindowComplex.Json.WindowConst;
|
||||
|
||||
namespace WebWindowComplex.Models
|
||||
{
|
||||
public class SashArcElement
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public SashArcElement() { }
|
||||
|
||||
public SashArcElement(Area ParentArea, Window ParentWindow, double nSection, bool bCutEdge)
|
||||
{
|
||||
m_ParentArea = ParentArea;
|
||||
m_ParentWindow = ParentWindow;
|
||||
m_nSection = nSection;
|
||||
m_bCutEdge = bCutEdge;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public int nQty
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_nQty;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_nQty = value;
|
||||
}
|
||||
}
|
||||
|
||||
public double nSection
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_nSection;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_nSection = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool bCutEdge
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bCutEdge;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bCutEdge = value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Internal Methods
|
||||
|
||||
internal JsonSashArcElement Serialize()
|
||||
{
|
||||
JsonSashArcElement jArcElement = new JsonSashArcElement(nSection, bCutEdge);
|
||||
return jArcElement;
|
||||
}
|
||||
|
||||
#endregion Internal Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected Area m_ParentArea;
|
||||
protected Window m_ParentWindow;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private double m_nSection;
|
||||
|
||||
private int m_nQty;
|
||||
|
||||
private bool m_bCutEdge = false;
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ namespace WebWindowComplex.Models
|
||||
bool valueAccept = false;
|
||||
switch (MeasureType)
|
||||
{
|
||||
case MeasureTypes.ABSOLUT:
|
||||
case MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
valueAccept = (value < valMaxAbsolut && value > valMinAbsolut) ? true : false;
|
||||
break;
|
||||
@@ -140,7 +140,7 @@ namespace WebWindowComplex.Models
|
||||
case MeasureTypes.PROPORTIONAL:
|
||||
{
|
||||
valMaxAbsolut = 20;
|
||||
valueAccept = (value > 1) ? true : false;
|
||||
valueAccept = (value >= 1) ? true : false;
|
||||
break;
|
||||
}
|
||||
case MeasureTypes.PERCENTAGE:
|
||||
@@ -163,7 +163,8 @@ namespace WebWindowComplex.Models
|
||||
int proportionalCount = dimensions.Where(x => x.MeasureType.Equals(MeasureTypes.PROPORTIONAL)).ToList().Count;
|
||||
int percentageCount = dimensions.Where(x => x.MeasureType.Equals(MeasureTypes.PERCENTAGE)).ToList().Count;
|
||||
// Le dimensioni sono solo in proporzionale
|
||||
if (proportionalCount == absolutValList.Count)
|
||||
if (proportionalCount == absolutValList.Count || SelMeasureType.Equals(MeasureTypes.PROPORTIONAL) ||
|
||||
(SelMeasureType.Equals(MeasureTypes.ABSOLUTE) && proportionalCount == absolutValList.Count -1))
|
||||
{
|
||||
m_dDimension = value;
|
||||
}
|
||||
@@ -220,7 +221,7 @@ namespace WebWindowComplex.Models
|
||||
double valueInAbsolute = 0;
|
||||
switch (MeasureType)
|
||||
{
|
||||
case MeasureTypes.ABSOLUT:
|
||||
case MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
valueInAbsolute = value;
|
||||
break;
|
||||
@@ -399,7 +400,7 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
switch (oldType)
|
||||
{
|
||||
case MeasureTypes.ABSOLUT:
|
||||
case MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
if (newType.Equals(MeasureTypes.PERCENTAGE))
|
||||
{
|
||||
@@ -413,7 +414,7 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
case MeasureTypes.PROPORTIONAL:
|
||||
{
|
||||
if (newType.Equals(MeasureTypes.ABSOLUT))
|
||||
if (newType.Equals(MeasureTypes.ABSOLUTE))
|
||||
{
|
||||
//return Double.Round(ConvertFromPropVal(newType), 2);
|
||||
return ConvertFromPropVal(newType, widthTot);
|
||||
@@ -426,7 +427,7 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
case MeasureTypes.PERCENTAGE:
|
||||
{
|
||||
if (newType.Equals(MeasureTypes.ABSOLUT))
|
||||
if (newType.Equals(MeasureTypes.ABSOLUTE))
|
||||
{
|
||||
//return Double.Round((m_dDimension * m_Parent.Width) / 100, 2);
|
||||
return (m_dDimension * widthTot) / 100;
|
||||
@@ -483,7 +484,7 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
switch (split.SplitVertList.ElementAt(i).SelMeasureType)
|
||||
{
|
||||
case MeasureTypes.ABSOLUT:
|
||||
case MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
risultato = CalculateWidthSashGroup(item, split.SplitVertList.ElementAt(i).dDimension);
|
||||
break;
|
||||
@@ -512,7 +513,7 @@ namespace WebWindowComplex.Models
|
||||
Sash sash = (Sash)area;
|
||||
switch (sash.SashList.ElementAt(i).SelMeasureType)
|
||||
{
|
||||
case MeasureTypes.ABSOLUT:
|
||||
case MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
risultato = CalculateWidthSashGroup(item, sash.SashList.ElementAt(i).dDimension);
|
||||
break;
|
||||
@@ -611,7 +612,7 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
switch (MeasureType)
|
||||
{
|
||||
case MeasureTypes.ABSOLUT:
|
||||
case MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
//return Double.Round(dDimension, 2);
|
||||
return dDimension;
|
||||
@@ -641,7 +642,7 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case MeasureTypes.ABSOLUT:
|
||||
case MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
//return Double.Round(absolutVal, 2);
|
||||
return absolutVal;
|
||||
@@ -682,7 +683,7 @@ namespace WebWindowComplex.Models
|
||||
|
||||
double sumPesi = proportionalList.Sum(p => p.dDimension);
|
||||
if (sumPesi == 0) sumPesi = 1;
|
||||
if (newType.Equals(MeasureTypes.ABSOLUT))
|
||||
if (newType.Equals(MeasureTypes.ABSOLUTE))
|
||||
{
|
||||
return res / sumPesi * dDimension;
|
||||
}
|
||||
@@ -795,7 +796,7 @@ namespace WebWindowComplex.Models
|
||||
|
||||
private List<IdNameStruct> m_MeasureTypeList = new List<IdNameStruct>
|
||||
{
|
||||
new IdNameStruct((int)MeasureTypes.ABSOLUT, "Absolut"),
|
||||
new IdNameStruct((int)MeasureTypes.ABSOLUTE, "Absolut"),
|
||||
new IdNameStruct((int)MeasureTypes.PROPORTIONAL, "Proportional"),
|
||||
new IdNameStruct((int)MeasureTypes.PERCENTAGE, "Percentage"),
|
||||
};
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace WebWindowComplex.Models
|
||||
bool valueAccept = false;
|
||||
switch (MeasureType)
|
||||
{
|
||||
case MeasureTypes.ABSOLUT:
|
||||
case MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
valueAccept = (value < valMaxAbsolut && value > valMinAbsolut) ? true : false;
|
||||
break;
|
||||
@@ -147,7 +147,7 @@ namespace WebWindowComplex.Models
|
||||
double valueInAbsolute = 0;
|
||||
switch (MeasureType)
|
||||
{
|
||||
case MeasureTypes.ABSOLUT:
|
||||
case MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
valueInAbsolute = value;
|
||||
break;
|
||||
@@ -367,7 +367,7 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
switch (oldType)
|
||||
{
|
||||
case MeasureTypes.ABSOLUT:
|
||||
case MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
if (newType.Equals(MeasureTypes.PERCENTAGE))
|
||||
{
|
||||
@@ -381,7 +381,7 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
case MeasureTypes.PROPORTIONAL:
|
||||
{
|
||||
if (newType.Equals(MeasureTypes.ABSOLUT))
|
||||
if (newType.Equals(MeasureTypes.ABSOLUTE))
|
||||
{
|
||||
//return Double.Round(ConvertFromPropVal(newType), 2);
|
||||
return ConvertFromPropVal(newType, widthTot, splitList);
|
||||
@@ -394,7 +394,7 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
case MeasureTypes.PERCENTAGE:
|
||||
{
|
||||
if (newType.Equals(MeasureTypes.ABSOLUT))
|
||||
if (newType.Equals(MeasureTypes.ABSOLUTE))
|
||||
{
|
||||
//return Double.Round((m_dDimension * m_Parent.Width) / 100, 2);
|
||||
return (m_dDimension * widthTot) / 100;
|
||||
@@ -439,7 +439,7 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
switch (split.SplitVertList.ElementAt(i).SelMeasureType)
|
||||
{
|
||||
case MeasureTypes.ABSOLUT:
|
||||
case MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
risultato = CalculateWidthSplitGroup(item, split.SplitVertList.ElementAt(i).dDimension);
|
||||
break;
|
||||
@@ -468,7 +468,7 @@ namespace WebWindowComplex.Models
|
||||
Sash sash = (Sash)area;
|
||||
switch (sash.SashList.ElementAt(i).SelMeasureType)
|
||||
{
|
||||
case MeasureTypes.ABSOLUT:
|
||||
case MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
risultato = CalculateWidthSplitGroup(item, sash.SashList.ElementAt(i).dDimension);
|
||||
break;
|
||||
@@ -518,7 +518,7 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
switch (split.SplitHorizList.ElementAt(i).SelMeasureType)
|
||||
{
|
||||
case MeasureTypes.ABSOLUT:
|
||||
case MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
risultato = CalculateHeightSplitGroup(item, split.SplitVertList.ElementAt(i).dDimension);
|
||||
break;
|
||||
@@ -547,7 +547,7 @@ namespace WebWindowComplex.Models
|
||||
Sash sash = (Sash)area;
|
||||
switch (sash.SashList.ElementAt(i).SelMeasureType)
|
||||
{
|
||||
case MeasureTypes.ABSOLUT:
|
||||
case MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
risultato = CalculateHeightSplitGroup(item, sash.SashList.ElementAt(i).dDimension);
|
||||
break;
|
||||
@@ -646,7 +646,7 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
switch (MeasureType)
|
||||
{
|
||||
case MeasureTypes.ABSOLUT:
|
||||
case MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
//return Double.Round(dDimension, 2);
|
||||
return dDimension;
|
||||
@@ -676,7 +676,7 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case MeasureTypes.ABSOLUT:
|
||||
case MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
//return Double.Round(absolutVal, 2);
|
||||
return absolutVal;
|
||||
@@ -717,7 +717,7 @@ namespace WebWindowComplex.Models
|
||||
|
||||
double sumPesi = proportionalList.Sum(p => p.dDimension);
|
||||
if (sumPesi == 0) sumPesi = 1;
|
||||
if (newType.Equals(MeasureTypes.ABSOLUT))
|
||||
if (newType.Equals(MeasureTypes.ABSOLUTE))
|
||||
{
|
||||
return res / sumPesi * dDimension;
|
||||
}
|
||||
@@ -809,7 +809,7 @@ namespace WebWindowComplex.Models
|
||||
|
||||
private List<IdNameStruct> m_MeasureTypeList = new List<IdNameStruct>
|
||||
{
|
||||
new IdNameStruct((int)MeasureTypes.ABSOLUT, "Absolut"),
|
||||
new IdNameStruct((int)MeasureTypes.ABSOLUTE, "Absolute"),
|
||||
new IdNameStruct((int)MeasureTypes.PROPORTIONAL, "Proportional"),
|
||||
new IdNameStruct((int)MeasureTypes.PERCENTAGE, "Percentage"),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user