// 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 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 General Public License for more details. // // You should have received a copy of the GNU 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; using Core.Common.Utils.Attributes; using Core.Components.Gis; using Core.Components.Gis.Data; using Ringtoets.Integration.Forms.Properties; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; using DotspatialFormsResources = Core.Components.DotSpatial.Forms.Properties.Resources; namespace Ringtoets.Integration.Forms.PropertyClasses { /// /// ViewModel of the containing a /// for properties panel. /// public class BackgroundWmtsMapDataContainerProperties : BackgroundMapDataContainerProperties { private readonly WmtsMapData wmtsMapData; /// /// Creates a new instance of . /// /// The data for which the properties are shown. /// Thrown when is /// not an instance containing an instance of . /// Thrown when /// is null. public BackgroundWmtsMapDataContainerProperties(BackgroundMapDataContainer container) : base(Validate(container)) { wmtsMapData = (WmtsMapData) container.MapData; } /// /// Validates the used for this properties /// object. /// /// The data to be used. /// if it's valid. /// Thrown when /// is not suitable for this object. /// Thrown when /// is null. private static BackgroundMapDataContainer Validate(BackgroundMapDataContainer container) { if (container == null) { throw new ArgumentNullException(nameof(container)); } if (!(container.MapData is WmtsMapData)) { throw new ArgumentException($"{typeof(BackgroundMapDataContainer).Name} must contain an instance of {typeof(WmtsMapData).Name}.", nameof(container)); } return container; } [ResourcesCategory(typeof(Resources), nameof(Resources.BackgroundWmtsMapDataContainerProperties_WMTS_Category))] [ResourcesDisplayName(typeof(Resources), nameof(Resources.BackgroundWmtsMapDataContainerProperties_Url_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.BackgroundWmtsMapDataContainerProperties_Url_Description))] public string Url { get { return wmtsMapData.SourceCapabilitiesUrl; } } [ResourcesCategory(typeof(Resources), nameof(Resources.BackgroundWmtsMapDataContainerProperties_WMTS_Category))] [ResourcesDisplayName(typeof(DotspatialFormsResources), nameof(DotspatialFormsResources.WmtsCapability_MapLayer_Id))] [ResourcesDescription(typeof(Resources), nameof(Resources.BackgroundWmtsMapDataContainerProperties_SelectedCapabilityIdentifier_Description))] public string SelectedCapabilityIdentifier { get { return wmtsMapData.SelectedCapabilityIdentifier; } } [ResourcesCategory(typeof(Resources), nameof(Resources.BackgroundWmtsMapDataContainerProperties_WMTS_Category))] [ResourcesDisplayName(typeof(DotspatialFormsResources), nameof(DotspatialFormsResources.WmtsCapability_MapLayer_Format))] [ResourcesDescription(typeof(Resources), nameof(Resources.BackgroundWmtsMapDataContainerProperties_PreferredFormat_Description))] public string PreferredFormat { get { return wmtsMapData.PreferredFormat; } } } }