Index: Core/Plugins/src/Core.Plugins.Map/PropertyClasses/FeatureBasedMapDataProperties.cs =================================================================== diff -u -rad09bf3ef6fa7e53040d7e53fa68540f2f1e3336 -r44a6e3afcdfce467ecc9d51d77b5bf4c3a5590eb --- Core/Plugins/src/Core.Plugins.Map/PropertyClasses/FeatureBasedMapDataProperties.cs (.../FeatureBasedMapDataProperties.cs) (revision ad09bf3ef6fa7e53040d7e53fa68540f2f1e3336) +++ Core/Plugins/src/Core.Plugins.Map/PropertyClasses/FeatureBasedMapDataProperties.cs (.../FeatureBasedMapDataProperties.cs) (revision 44a6e3afcdfce467ecc9d51d77b5bf4c3a5590eb) @@ -48,21 +48,29 @@ private const int styleTypePropertyIndex = 5; private const int mapThemeAttributeNamePropertyIndex = 6; private const int mapThemeCategoryPropertyIndex = 7; + private readonly IEnumerable parents; /// /// Creates a new instance of . /// - /// The to - /// show the properties for. - /// Thrown when - /// is null. - protected FeatureBasedMapDataProperties(T data) + /// The to show the properties for. + /// A collection containing all parent of + /// the . + /// Thrown when any parameter is null. + protected FeatureBasedMapDataProperties(T data, IEnumerable parents) { if (data == null) { throw new ArgumentNullException(nameof(data)); } + if (parents == null) + { + throw new ArgumentNullException(nameof(parents)); + } + + this.parents = parents; + Data = data; } Index: Core/Plugins/src/Core.Plugins.Map/PropertyClasses/MapLineDataProperties.cs =================================================================== diff -u -r40f8f3426304293fa0f280caf96e7332527e3dbf -r44a6e3afcdfce467ecc9d51d77b5bf4c3a5590eb --- Core/Plugins/src/Core.Plugins.Map/PropertyClasses/MapLineDataProperties.cs (.../MapLineDataProperties.cs) (revision 40f8f3426304293fa0f280caf96e7332527e3dbf) +++ Core/Plugins/src/Core.Plugins.Map/PropertyClasses/MapLineDataProperties.cs (.../MapLineDataProperties.cs) (revision 44a6e3afcdfce467ecc9d51d77b5bf4c3a5590eb) @@ -48,7 +48,7 @@ /// the . /// Thrown when any parameter is null. public MapLineDataProperties(MapLineData mapLineData, IEnumerable parents) - : base(mapLineData) {} + : base(mapLineData, parents) {} public override string Type { Index: Core/Plugins/src/Core.Plugins.Map/PropertyClasses/MapPointDataProperties.cs =================================================================== diff -u -r149fd073562b9a48f1b5207984108b875d7dcbf1 -r44a6e3afcdfce467ecc9d51d77b5bf4c3a5590eb --- Core/Plugins/src/Core.Plugins.Map/PropertyClasses/MapPointDataProperties.cs (.../MapPointDataProperties.cs) (revision 149fd073562b9a48f1b5207984108b875d7dcbf1) +++ Core/Plugins/src/Core.Plugins.Map/PropertyClasses/MapPointDataProperties.cs (.../MapPointDataProperties.cs) (revision 44a6e3afcdfce467ecc9d51d77b5bf4c3a5590eb) @@ -48,7 +48,7 @@ /// the . /// Thrown when any parameter is null. public MapPointDataProperties(MapPointData mapPointData, IEnumerable parents) - : base(mapPointData) {} + : base(mapPointData, parents) {} public override string Type { Index: Core/Plugins/src/Core.Plugins.Map/PropertyClasses/MapPolygonDataProperties.cs =================================================================== diff -u -rd5e1c0cbaee6d5b1f8c766dc18cca4b787da1878 -r44a6e3afcdfce467ecc9d51d77b5bf4c3a5590eb --- Core/Plugins/src/Core.Plugins.Map/PropertyClasses/MapPolygonDataProperties.cs (.../MapPolygonDataProperties.cs) (revision d5e1c0cbaee6d5b1f8c766dc18cca4b787da1878) +++ Core/Plugins/src/Core.Plugins.Map/PropertyClasses/MapPolygonDataProperties.cs (.../MapPolygonDataProperties.cs) (revision 44a6e3afcdfce467ecc9d51d77b5bf4c3a5590eb) @@ -46,7 +46,7 @@ /// the . /// Thrown when any parameter is null. public MapPolygonDataProperties(MapPolygonData mapPolygonData, IEnumerable parents) - : base(mapPolygonData) {} + : base(mapPolygonData, parents) {} public override string Type { Index: Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/FeatureBasedMapDataPropertiesTest.cs =================================================================== diff -u -r244f2dbdf68c80631424c7b979660336937171bf -r44a6e3afcdfce467ecc9d51d77b5bf4c3a5590eb --- Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/FeatureBasedMapDataPropertiesTest.cs (.../FeatureBasedMapDataPropertiesTest.cs) (revision 244f2dbdf68c80631424c7b979660336937171bf) +++ Core/Plugins/test/Core.Plugins.Map.Test/PropertyClasses/FeatureBasedMapDataPropertiesTest.cs (.../FeatureBasedMapDataPropertiesTest.cs) (revision 44a6e3afcdfce467ecc9d51d77b5bf4c3a5590eb) @@ -27,6 +27,7 @@ using Core.Common.Gui.Converters; using Core.Common.Gui.PropertyBag; using Core.Common.TestUtil; +using Core.Components.Gis.Data; using Core.Components.Gis.Features; using Core.Components.Gis.Geometries; using Core.Components.Gis.TestUtil; @@ -55,21 +56,32 @@ public void Constructor_DataNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => new TestFeatureBasedMapDataProperties(null); + TestDelegate call = () => new TestFeatureBasedMapDataProperties(null, Enumerable.Empty()); // Assert var exception = Assert.Throws(call); Assert.AreEqual("data", exception.ParamName); } [Test] + public void Constructor_ParentsNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new TestFeatureBasedMapDataProperties(new TestFeatureBasedMapData(), null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("parents", exception.ParamName); + } + + [Test] public void Constructor_ExpectedValues() { // Setup var data = new TestFeatureBasedMapData(); // Call - var properties = new TestFeatureBasedMapDataProperties(data); + var properties = new TestFeatureBasedMapDataProperties(data, Enumerable.Empty()); // Assert Assert.IsInstanceOf>(properties); @@ -87,7 +99,7 @@ var data = new TestFeatureBasedMapData(); // Call - var properties = new TestFeatureBasedMapDataProperties(data); + var properties = new TestFeatureBasedMapDataProperties(data, Enumerable.Empty()); // Assert Assert.AreEqual(data.Name, properties.Name); @@ -115,7 +127,7 @@ }; // Call - var properties = new TestFeatureBasedMapDataProperties(mapData); + var properties = new TestFeatureBasedMapDataProperties(mapData, Enumerable.Empty()); // Assert Assert.AreEqual(mapData.Name, properties.Name); @@ -154,7 +166,7 @@ }; // Call - var properties = new TestFeatureBasedMapDataProperties(mapData); + var properties = new TestFeatureBasedMapDataProperties(mapData, Enumerable.Empty()); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); @@ -221,7 +233,7 @@ mapData.Attach(observer); - var properties = new TestFeatureBasedMapDataProperties(mapData); + var properties = new TestFeatureBasedMapDataProperties(mapData, Enumerable.Empty()); // Call properties.IsVisible = false; @@ -257,7 +269,7 @@ }; // Call - var properties = new TestFeatureBasedMapDataProperties(mapData); + var properties = new TestFeatureBasedMapDataProperties(mapData, Enumerable.Empty()); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); @@ -296,7 +308,7 @@ }; // Call - var properties = new TestFeatureBasedMapDataProperties(mapData); + var properties = new TestFeatureBasedMapDataProperties(mapData, Enumerable.Empty()); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); @@ -329,7 +341,7 @@ }; // Call - var properties = new TestFeatureBasedMapDataProperties(mapData); + var properties = new TestFeatureBasedMapDataProperties(mapData, Enumerable.Empty()); // Assert // Assert @@ -374,7 +386,7 @@ } }; - var properties = new TestFeatureBasedMapDataProperties(mapData); + var properties = new TestFeatureBasedMapDataProperties(mapData, Enumerable.Empty()); // Call bool isShowLabelReadOnly = properties.DynamicReadonlyValidator( @@ -402,7 +414,7 @@ } }; - var properties = new TestFeatureBasedMapDataProperties(mapData); + var properties = new TestFeatureBasedMapDataProperties(mapData, Enumerable.Empty()); // Call bool isOtherPropertyReadOnly = properties.DynamicReadonlyValidator(string.Empty); @@ -422,7 +434,7 @@ ShowLabels = showLabels }; - var properties = new TestFeatureBasedMapDataProperties(mapData); + var properties = new TestFeatureBasedMapDataProperties(mapData, Enumerable.Empty()); // Call bool isSelectedMetaDataAttributeVisible = properties.DynamicVisibleValidationMethod( @@ -448,7 +460,7 @@ : null }; - var properties = new TestFeatureBasedMapDataProperties(mapData); + var properties = new TestFeatureBasedMapDataProperties(mapData, Enumerable.Empty()); // Call bool isMapThemeAttributeNameVisible = properties.DynamicVisibleValidationMethod( @@ -477,7 +489,7 @@ }) }; - var properties = new TestFeatureBasedMapDataProperties(mapData); + var properties = new TestFeatureBasedMapDataProperties(mapData, Enumerable.Empty()); // Call bool isOtherPropertyVisible = properties.DynamicVisibleValidationMethod(string.Empty); @@ -488,7 +500,8 @@ private class TestFeatureBasedMapDataProperties : FeatureBasedMapDataProperties { - public TestFeatureBasedMapDataProperties(TestFeatureBasedMapData data) : base(data) {} + public TestFeatureBasedMapDataProperties(TestFeatureBasedMapData data, IEnumerable parents) + : base(data, parents) {} public override string Type {