#region License Information
/* HeuristicLab
* Copyright (C) 2002-2014 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.Collections.Generic;
using System.Drawing;
using System.Linq;
using HeuristicLab.Common;
using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
namespace HeuristicLab.Core.Networks {
[Item("NetworkItem", "Abstract base class for items of a network.")]
[StorableClass]
public abstract class NetworkItem : NamedItem, INetworkItem {
public static new Image StaticItemImage {
get { return HeuristicLab.Common.Resources.VSImageLibrary.Class; }
}
private INetworkItem parent;
public INetworkItem Parent {
get { return parent; }
protected set {
if (value != parent) {
parent = value;
}
}
}
public virtual IEnumerable Children {
get { return Enumerable.Empty(); }
}
[Storable]
public IVisualProperties VisualProperties { get; set; }
[StorableConstructor]
protected NetworkItem(bool deserializing) : base(deserializing) { }
protected NetworkItem(NetworkItem original, Cloner cloner) : base(original, cloner) {
VisualProperties = cloner.Clone(original.VisualProperties);
}
protected NetworkItem() : base("NetworkItem") { }
protected NetworkItem(string name) : base(name) { }
protected NetworkItem(string name, string description) : base(name, description) { }
}
}