// Copyright (C) Stichting Deltares 2019. All rights reserved.
//
// This file is part of Riskeer.
//
// Riskeer 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;
using System.Drawing;
using Core.Common.Controls.Views;
namespace Core.Common.Gui.Plugin
{
///
/// Information for creating a view for a particular data object.
///
public class ViewInfo
{
///
/// Initializes a new instance of the class.
///
public ViewInfo()
{
CreateInstance = o => (IView) Activator.CreateInstance(ViewType);
}
///
/// Gets or sets the data type associated with this view info.
///
public Type DataType { get; set; }
///
/// Gets or sets the type of data used for the view.
///
public Type ViewDataType { get; set; }
///
/// Gets or sets the type of the view.
///
public Type ViewType { get; set; }
///
/// Gets or sets the description of the view.
///
public string Description { get; set; }
///
/// Gets or sets the method used to determine the name for the view. Function arguments:
///
/// The view to get a name for.
/// The data corresponding to this view info.
/// out - The name of the view.
///
///
public Func GetViewName { get; set; }
///
/// Gets or sets the icon of the view.
///
public Image Image { get; set; }
///
/// Gets or sets the optional method for checking if this view info object can be
/// used for a given data object. Function arguments:
///
/// Data for the view.
/// out - true is this view info can be used for the data, or false otherwise.
///
///
public Func