Index: src/Deltares.DSoilModel.Data/DSoilModelStiFileTransformer.cs =================================================================== diff -u -r6 -r473 --- src/Deltares.DSoilModel.Data/DSoilModelStiFileTransformer.cs (.../DSoilModelStiFileTransformer.cs) (revision 6) +++ src/Deltares.DSoilModel.Data/DSoilModelStiFileTransformer.cs (.../DSoilModelStiFileTransformer.cs) (revision 473) @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Deltares.Geotechnics; +using Deltares.Geotechnics; using Deltares.Probabilistic; using Deltares.Standard; @@ -15,13 +11,10 @@ using (var soil = owner as Soil) { if (soil != null) { - var stochasts = soil.GetStochasts(); - foreach (var stochast in stochasts) + var stochast = soil.GetStochastByName(property); + if (stochast != null) { - if (stochast.AssociatedPropertyName == property) - { - return stochast.ActualValue; - } + return stochast.ActualValue; } } } @@ -30,21 +23,19 @@ public double SetTransformedValue(object owner, string property, double transformedValue) { - using (var soil = owner as Soil) { + using (var soil = owner as Soil) + { if (soil != null) { - var stochasts = soil.GetStochasts(); - foreach (var stochast in stochasts) + var stochast = soil.GetStochastByName(property); + if (stochast != null) { // Set all ditributions to Deterministic as we do not know anything about them. stochast.DistributionType = DistributionType.Deterministic; - if (stochast.AssociatedPropertyName == property) - { - stochast.ActualValue = transformedValue; - stochast.Mean = transformedValue; - // In property setter, the return value of this method is used to set the stochast mean - return stochast.Mean; - } + stochast.ActualValue = transformedValue; + stochast.Mean = transformedValue; + // In property setter, the return value of this method is used to set the stochast mean + return stochast.Mean; } } }