Index: Core/Plugins/src/Core.Plugins.Map/Core.Plugins.Map.csproj =================================================================== diff -u -rca77db5948e6c622ea1fb3092917341ba1234711 -r7956ca0b04c6022c8a55d6ef7a282e7ac2364a74 --- Core/Plugins/src/Core.Plugins.Map/Core.Plugins.Map.csproj (.../Core.Plugins.Map.csproj) (revision ca77db5948e6c622ea1fb3092917341ba1234711) +++ Core/Plugins/src/Core.Plugins.Map/Core.Plugins.Map.csproj (.../Core.Plugins.Map.csproj) (revision 7956ca0b04c6022c8a55d6ef7a282e7ac2364a74) @@ -83,6 +83,7 @@ + Index: Core/Plugins/src/Core.Plugins.Map/PropertyClasses/MapPointDataProperties.cs =================================================================== diff -u -rc94cb1b5a316ba340decc1afe0e6be1afb49cde1 -r7956ca0b04c6022c8a55d6ef7a282e7ac2364a74 --- Core/Plugins/src/Core.Plugins.Map/PropertyClasses/MapPointDataProperties.cs (.../MapPointDataProperties.cs) (revision c94cb1b5a316ba340decc1afe0e6be1afb49cde1) +++ Core/Plugins/src/Core.Plugins.Map/PropertyClasses/MapPointDataProperties.cs (.../MapPointDataProperties.cs) (revision 7956ca0b04c6022c8a55d6ef7a282e7ac2364a74) @@ -19,11 +19,15 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing.Design; using Core.Common.Gui.Attributes; using Core.Common.Gui.PropertyBag; using Core.Common.Utils.Attributes; using Core.Components.Gis.Data; using Core.Plugins.Map.Properties; +using Core.Plugins.Map.UITypeEditors; namespace Core.Plugins.Map.PropertyClasses { @@ -76,5 +80,25 @@ data.NotifyObservers(); } } + + public IEnumerable GetAvailableMetaDataAttributes() + { + return data.MetaData; + } + + [Editor(typeof(MetaDataAttributeEditor), typeof(UITypeEditor))] + [ResourcesCategory(typeof(Resources), "Categories_Label")] + public string SelectedMetaDataAttribute + { + get + { + return data.SelectedMetaDataAttribute; + } + set + { + data.SelectedMetaDataAttribute = value; + data.NotifyObservers(); + } + } } } \ No newline at end of file Index: Core/Plugins/src/Core.Plugins.Map/UITypeEditors/MetaDataAttributeEditor.cs =================================================================== diff -u --- Core/Plugins/src/Core.Plugins.Map/UITypeEditors/MetaDataAttributeEditor.cs (revision 0) +++ Core/Plugins/src/Core.Plugins.Map/UITypeEditors/MetaDataAttributeEditor.cs (revision 7956ca0b04c6022c8a55d6ef7a282e7ac2364a74) @@ -0,0 +1,45 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Collections.Generic; +using System.ComponentModel; +using Core.Common.Gui.UITypeEditors; +using Core.Plugins.Map.PropertyClasses; + +namespace Core.Plugins.Map.UITypeEditors +{ + /// + /// This class defines a drop down list edit-control from which the user can select a + /// meta data attribute from a collection. + /// + public class MetaDataAttributeEditor : SelectionEditor + { + protected override IEnumerable GetAvailableOptions(ITypeDescriptorContext context) + { + return GetPropertiesObject(context).GetAvailableMetaDataAttributes(); + } + + protected override string GetCurrentOption(ITypeDescriptorContext context) + { + return GetPropertiesObject(context).SelectedMetaDataAttribute; + } + } +} \ No newline at end of file Index: Core/Plugins/test/Core.Plugins.Map.Test/Core.Plugins.Map.Test.csproj =================================================================== diff -u -r85bd9b0f9d23da455c7445094c7ce192c56d64b8 -r7956ca0b04c6022c8a55d6ef7a282e7ac2364a74 --- Core/Plugins/test/Core.Plugins.Map.Test/Core.Plugins.Map.Test.csproj (.../Core.Plugins.Map.Test.csproj) (revision 85bd9b0f9d23da455c7445094c7ce192c56d64b8) +++ Core/Plugins/test/Core.Plugins.Map.Test/Core.Plugins.Map.Test.csproj (.../Core.Plugins.Map.Test.csproj) (revision 7956ca0b04c6022c8a55d6ef7a282e7ac2364a74) @@ -89,6 +89,7 @@ TestView.cs + Index: Core/Plugins/test/Core.Plugins.Map.Test/UITypeEditors/MetaDataAttributeEditorTest.cs =================================================================== diff -u --- Core/Plugins/test/Core.Plugins.Map.Test/UITypeEditors/MetaDataAttributeEditorTest.cs (revision 0) +++ Core/Plugins/test/Core.Plugins.Map.Test/UITypeEditors/MetaDataAttributeEditorTest.cs (revision 7956ca0b04c6022c8a55d6ef7a282e7ac2364a74) @@ -0,0 +1,42 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using Core.Common.Gui.UITypeEditors; +using Core.Plugins.Map.PropertyClasses; +using Core.Plugins.Map.UITypeEditors; +using NUnit.Framework; + +namespace Core.Plugins.Map.Test.UITypeEditors +{ + [TestFixture] + public class MetaDataAttributeEditorTest + { + [Test] + public void DefaultConstructor_ReturnsNewInstance() + { + // Call + var editor = new MetaDataAttributeEditor(); + + // Assert + Assert.IsInstanceOf>(editor); + } + } +} \ No newline at end of file