// Copyright (C) Stichting Deltares 2025. All rights reserved. // // This file is part of the application DAM - UI. // // DAM - UI 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 Deltares.Standard.IO.Xml; namespace Deltares.Dam.Data.IO; /// /// This class is added to be able to retrieve the proper version from the damx xml file via the xmlHandler interface. /// So the only useful methods are GetDamProjectVersion and SetVersion (interface). /// /// public class DamProjectVersionXmlHandler : IXmlHandler { private string damProjectVersion; /// /// Gets the dam project version. /// /// public string GetDamProjectVersion() { return damProjectVersion; } /// /// Sets the version of the file to be deserialized /// /// Version of the xml file public void SetVersion(string version) { damProjectVersion = version; } /// /// This method returns true if the can be handled by this XmlHandler /// /// Type of the objects /// /// True if the type can be handled, false otherwise /// public bool CanHandle(Type type) { return false; } /// /// This method returns true if the and property can be handled by this XmlHandler /// /// Type of the objects /// Indicates whether the property can be handled /// /// True if the type can be handled, false otherwise /// public bool CanHandle(Type type, string property) { return false; } /// /// Indicates the type of the property which should be created /// /// The type in which the property is or was defined /// The name of the property /// /// The type of the property /// /// /// /// If null is returned, the property type is left over to reflection /// public Type GetFormerPropertyType(Type type, string property) { throw new NotImplementedException(); } /// /// When the handler can handle the property, this method can be called to actually perform /// the handling of the value for a specific target. /// /// The object for which the value is handled /// The property which should be handled /// The value which is handled /// The deserialized objects list /// public void Handle(object target, string property, object value, object[] objects) { throw new NotImplementedException(); } /// /// When the handler can handle the property, this method can be called to actually perform /// the handling of the value of the specific target. The value, in this case, can be /// altered before it is set to the target. It is the implementing class' responsibility /// to assign the value to the correct property of the target. /// /// The target object to assign the value for. /// The value to assign to the target /// public void HandleObject(object target, object value) { throw new NotImplementedException(); } /// /// Allows the xml handler to post process each created object, which it can handle /// /// The object to be post processed /// public void Upgrade(object[] target) { throw new NotImplementedException(); } }