// Copyright (C) Stichting Deltares 2017. All rights reserved. // // This file is part of the DAM Engine. // // The DAM Engine is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero 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 Affero General Public License for more details. // // You should have received a copy of the GNU Affero 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 System.Collections; namespace Deltares.DamEngine.Calculators.General { /// /// Application context class, which governs application wide overrides for visibility, /// enabledness or domain data collections. /// public interface IContext { /// /// Method indicating a visibility override value for a given instance object. /// /// Object being evaluated. /// Name of the member which is part of . /// True if visible; False if hidden; Null if no override. bool? IsVisible(object source, string member); /// /// Method indicating if the enabled override value for a given instance object. /// /// Object being evaluated. /// Name of the member which is part of . /// True if enabled; False if disabled; Null if no override. bool? IsEnabled(object source, string member); /// /// Method returning a collection of domain object for list or enum type members; /// /// Object being evaluated. /// Name of the member which is part of . /// A collection of domain object; Null if no override. ICollection GetDomain(object source, string member); /// /// Indicates to whether to perform the validation on the property or the method /// /// Object being evaluated. /// Name of the member which is part of . /// True or false if validation should be (or not be) performed; Null if no preference is given, but left over to the caller. bool? ShouldValidate(object source, string member); /// /// Gets the minimum value for a member. /// /// The source. /// The member. /// double? GetMinimum(object source, string member); /// /// Gets the maximum value for a member. /// /// The source. /// The member. /// double? GetMaximum(object source, string member); /// /// Gets the format string for a member. /// /// The type. /// The source. /// The member. /// string GetFormat(Type type, object source, string member); /// /// Gets the default value for a memner. /// /// The type. /// The member. /// object GetDefault(Type type, string member); // waar is dit het handigst te implementeren (qua gebruik van)? /// /// Gets the property order for UI display purposes. /// /// The type. /// The member. /// int[] GetPropertyOrder(Type type, string member); // is dit handig? Zo ja, dan ook een idee voor de andere attr? } }