#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.Linq; using System.Text; using System.Runtime.Serialization; using HeuristicLab.DataAccess; using HeuristicLab.PluginInfrastructure; using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; namespace HeuristicLab.Hive.Contracts.BusinessObjects { [StorableClass] [DataContract] [Serializable] public class HivePluginInfoDto : PersistableObject { [Storable] [DataMember] public String Name { get; set; } [DataMember] public Version Version { get; set; } // helper-variable to be able to persist version [Storable] private string storableVersion; [Storable] [DataMember] public Boolean Update { get; set; } public HivePluginInfoDto() { } public HivePluginInfoDto(bool deserializing) : base(deserializing) { } [StorableHook(HookType.BeforeSerialization)] private void BeforeSerialization() { this.storableVersion = Version.ToString(); } [StorableHook(HookType.AfterDeserialization)] private void AfterDeserialization() { this.Version = new Version(storableVersion); } public override Common.IDeepCloneable Clone(Common.Cloner cloner) { HivePluginInfoDto clone = (HivePluginInfoDto) base.Clone(cloner); clone.Name = this.Name; clone.Version = (Version)this.Version.Clone(); clone.Update = this.Update; return clone; } } }