|
@@ -96,7 +96,18 @@ namespace InABox.Core
|
|
|
|
|
|
public string Caption { get; set; }
|
|
public string Caption { get; set; }
|
|
|
|
|
|
- public long Sequence { get; set; }
|
|
|
|
|
|
+ private decimal _propertySequence;
|
|
|
|
+
|
|
|
|
+ private long _sequence;
|
|
|
|
+ public long Sequence
|
|
|
|
+ {
|
|
|
|
+ get => _sequence;
|
|
|
|
+ set
|
|
|
|
+ {
|
|
|
|
+ _sequence = value;
|
|
|
|
+ _propertySequence = CalculatePropertySequence();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
[NullEditor]
|
|
[NullEditor]
|
|
public string Page { get; set; }
|
|
public string Page { get; set; }
|
|
@@ -105,7 +116,16 @@ namespace InABox.Core
|
|
|
|
|
|
public LoggablePropertyAttribute? Loggable { get; set; }
|
|
public LoggablePropertyAttribute? Loggable { get; set; }
|
|
|
|
|
|
- public IProperty? Parent { get; set; }
|
|
|
|
|
|
+ private IProperty? _parent;
|
|
|
|
+ public IProperty? Parent
|
|
|
|
+ {
|
|
|
|
+ get => _parent;
|
|
|
|
+ set
|
|
|
|
+ {
|
|
|
|
+ _parent = value;
|
|
|
|
+ _propertySequence = CalculatePropertySequence();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
public bool IsEntityLink { get; set; }
|
|
public bool IsEntityLink { get; set; }
|
|
|
|
|
|
@@ -146,6 +166,22 @@ namespace InABox.Core
|
|
return _setter;
|
|
return _setter;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public decimal PropertySequence() => _propertySequence;
|
|
|
|
+
|
|
|
|
+ private decimal CalculatePropertySequence()
|
|
|
|
+ {
|
|
|
|
+ var sequence = 0.0M;
|
|
|
|
+ IProperty? property = this;
|
|
|
|
+ while(property != null)
|
|
|
|
+ {
|
|
|
|
+ sequence = property.Sequence + sequence / 1000.0M;
|
|
|
|
+
|
|
|
|
+ property = property.Parent;
|
|
|
|
+ }
|
|
|
|
+ return sequence;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
public override string ToString()
|
|
public override string ToString()
|
|
{
|
|
{
|
|
return string.Format("{0}.{1}", Class, Name);
|
|
return string.Format("{0}.{1}", Class, Name);
|