Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/TypeConverters/DesignVariableTypeConverter.cs =================================================================== diff -u -r1e49eb86c81e8446aeb6031cfd7a209bb0c11bac -r76fb25cd2af6a3451ffe32852cc34e13e1925b14 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/TypeConverters/DesignVariableTypeConverter.cs (.../DesignVariableTypeConverter.cs) (revision 1e49eb86c81e8446aeb6031cfd7a209bb0c11bac) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/TypeConverters/DesignVariableTypeConverter.cs (.../DesignVariableTypeConverter.cs) (revision 76fb25cd2af6a3451ffe32852cc34e13e1925b14) @@ -24,14 +24,10 @@ using System.Globalization; using System.Linq; using System.Linq.Expressions; - -using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Gui.PropertyBag; using Ringtoets.Piping.Data.Probabilistics; -using Ringtoets.Piping.Forms.PresentationObjects; -using Ringtoets.Piping.Forms.PropertyClasses; using Ringtoets.Piping.Forms.TypeConverters.PropertyDescriptors; using PipingFormsResources = Ringtoets.Piping.Forms.Properties.Resources; @@ -63,7 +59,6 @@ public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes) { -// IObservable observableParent = GetObservableOwnerOfDistribution(context); bool allParametersAreReadonly = PropertyIsReadOnly(context); var designVariable = (DesignVariable)value; @@ -131,32 +126,10 @@ return new ReadOnlyPropertyDescriptorDecorator(textPropertyDescriptor); } -// textPropertyDescriptor.ObservableParent = observableParent; var propertyDescriptor = new ContainingPropertyUpdateDescriptorDecorator(textPropertyDescriptor, parentObject, parentDescriptor); return propertyDescriptor; } - private static IObservable GetObservableOwnerOfDistribution(ITypeDescriptorContext context) - { - if (context == null) - { - return null; - } - // Sadly, we need this hack in order to update the correct class - var dynamicPropertyBag = context.Instance as DynamicPropertyBag; - if (dynamicPropertyBag == null) - { - return null; - } - - // Note: If this type converter is going to be reused for other classes, we - // might want to reconsider how we want to propagate IObservable updates! - var inputParameterContextProperties = dynamicPropertyBag.WrappedObject as PipingInputContextProperties; - return inputParameterContextProperties != null ? - ((PipingInputContext)inputParameterContextProperties.Data).WrappedData : - null; - } - /// /// A generic parameter description class. /// Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/TypeConverters/PropertyDescriptors/ContainingPropertyUpdateDescriptorDecorator.cs =================================================================== diff -u -r1e49eb86c81e8446aeb6031cfd7a209bb0c11bac -r76fb25cd2af6a3451ffe32852cc34e13e1925b14 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/TypeConverters/PropertyDescriptors/ContainingPropertyUpdateDescriptorDecorator.cs (.../ContainingPropertyUpdateDescriptorDecorator.cs) (revision 1e49eb86c81e8446aeb6031cfd7a209bb0c11bac) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/TypeConverters/PropertyDescriptors/ContainingPropertyUpdateDescriptorDecorator.cs (.../ContainingPropertyUpdateDescriptorDecorator.cs) (revision 76fb25cd2af6a3451ffe32852cc34e13e1925b14) @@ -26,6 +26,17 @@ originalPropertyDescriptor = propertyDescription; } + public override void SetValue(object component, object value) + { + originalPropertyDescriptor.SetValue(component, value); + if (source != null && sourceContainingProperty != null) + { + sourceContainingProperty.SetValue(source, component); + } + } + + #region Members delegated to wrapped descriptor + public override bool CanResetValue(object component) { return originalPropertyDescriptor.CanResetValue(component); @@ -41,15 +52,6 @@ originalPropertyDescriptor.ResetValue(component); } - public override void SetValue(object component, object value) - { - originalPropertyDescriptor.SetValue(component, value); - if (source != null && sourceContainingProperty != null) - { - sourceContainingProperty.SetValue(source, component); - } - } - public override bool ShouldSerializeValue(object component) { return originalPropertyDescriptor.ShouldSerializeValue(component); @@ -94,5 +96,71 @@ return originalPropertyDescriptor.DisplayName; } } + + public override AttributeCollection Attributes + { + get + { + return originalPropertyDescriptor.Attributes; + } + } + + public override string Category + { + get + { + return originalPropertyDescriptor.Category; + } + } + + public override TypeConverter Converter + { + get + { + return originalPropertyDescriptor.Converter; + } + } + + public override bool DesignTimeOnly + { + get + { + return originalPropertyDescriptor.DesignTimeOnly; + } + } + + public override bool IsBrowsable + { + get + { + return originalPropertyDescriptor.IsBrowsable; + } + } + + public override bool IsLocalizable + { + get + { + return originalPropertyDescriptor.IsLocalizable; + } + } + + public override string Name + { + get + { + return originalPropertyDescriptor.Name; + } + } + + public override bool SupportsChangeEvents + { + get + { + return originalPropertyDescriptor.SupportsChangeEvents; + } + } + + #endregion } } \ No newline at end of file