Esempio n. 1
0
 public override void OnChanged(MaterialRequirement obj, string propertyName, object oldValue, object newValue)
 {
     base.OnChanged(obj, propertyName, oldValue, newValue);
     if (obj.IsLoading)
     {
         return;
     }
     if (propertyName.OneOf(nameof(MaterialRequirement.Material), nameof(MaterialRequirement.Amount)))
     {
         obj.Cost = CalculateCost(obj);
     }
     if (propertyName.Equals(nameof(MaterialRequirement.Cost)))
     {
         PersistentCalculatedTool.MarkAndCalculate(obj.Operation, nameof(MaintenanceOperation.TotalCost));
     }
 }
Esempio n. 2
0
 public override void OnChanged(MaintenanceOperation obj, string propertyName, object oldValue, object newValue)
 {
     base.OnChanged(obj, propertyName, oldValue, newValue);
     if (obj.IsLoading)
     {
         return;
     }
     if (propertyName.Equals(nameof(MaintenanceOperation.Duration)))
     {
         if (obj.Parent != null)
         {
             PersistentCalculatedTool.MarkAndCalculate(obj.Parent, nameof(MaintenanceOperation.Duration));
         }
     }
     if (propertyName.Equals(nameof(MaintenanceOperation.WorkCost)))
     {
         obj.CalculateCost();
     }
 }
Esempio n. 3
0
 public override void BeforeDeleting(MaterialRequirement obj)
 {
     base.BeforeDeleting(obj);
     PersistentCalculatedTool.MarkAndCalculate(obj.Operation, nameof(MaintenanceOperation.TotalCost));
 }