#region License Information /* HeuristicLab * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab 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. * * HeuristicLab 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 HeuristicLab. If not, see . */ #endregion using System; using System.Collections.Generic; using System.Text; using System.Xml; using HeuristicLab.Core; using HeuristicLab.Data; using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; namespace HeuristicLab.Logging { /// /// Represents a log object where to store a specific value that should be logged. /// public class Log : ItemBase, IVisualizationItem { [Storable] private ItemList myItems; /// /// Gets or sets the items of the current instance. /// public ItemList Items { get { return myItems; } set { myItems = value; } } /// /// Initializes a new instance of . /// public Log() { } /// /// Initializes a new instance of with the given items. /// /// The list of items with which to initialize the current instance. public Log(ItemList items) { myItems = items; } /// /// Clones the current instance (deep clone). /// /// Deep clone through method of helper class /// . /// Dictionary of all already clone objects. (Needed to avoid cycles.) /// The cloned object as . public override IItem Clone(ICloner cloner) { Log clone = (Log)base.Clone(cloner); clone.myItems = (ItemList)cloner.Clone(Items); return clone; } /// /// Occurs when the items have been changed. /// public event EventHandler ItemsChanged; /// /// Fires a new ItemsChanged event. /// protected virtual void OnItemsChanged() { if (ItemsChanged != null) ItemsChanged(this, new EventArgs()); } } }