Last change
on this file since 4133 was
4133,
checked in by cneumuel, 14 years ago
|
- Made HiveExperiment storable, so that a running HiveExperiment can be disconnected, stored and later resumed. (#1115)
- Added Log to each JobItem (#1115)
|
File size:
1.2 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Runtime.Serialization;
|
---|
6 | using HeuristicLab.Common;
|
---|
7 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
8 |
|
---|
9 | namespace HeuristicLab.Hive.Contracts.BusinessObjects {
|
---|
10 | [StorableClass]
|
---|
11 | [Serializable]
|
---|
12 | [DataContract]
|
---|
13 | public class HivePluginFile : IDeepCloneable {
|
---|
14 | [Storable]
|
---|
15 | [DataMember]
|
---|
16 | public byte[] BinaryFile { get; set; }
|
---|
17 | [Storable]
|
---|
18 | [DataMember]
|
---|
19 | public String Name { get; set; }
|
---|
20 |
|
---|
21 | public HivePluginFile(byte[] binaryFile, String name) {
|
---|
22 | BinaryFile = binaryFile;
|
---|
23 | Name = name;
|
---|
24 | }
|
---|
25 |
|
---|
26 | public virtual IDeepCloneable Clone(Cloner cloner) {
|
---|
27 | HivePluginFile clone = (HivePluginFile)Activator.CreateInstance(this.GetType(), true);
|
---|
28 | cloner.RegisterClonedObject(this, clone);
|
---|
29 | clone.Name = this.Name;
|
---|
30 | if (this.BinaryFile != null) {
|
---|
31 | clone.BinaryFile = new byte[this.BinaryFile.Length];
|
---|
32 | Array.Copy(this.BinaryFile, clone.BinaryFile, this.BinaryFile.Length);
|
---|
33 | }
|
---|
34 | return clone;
|
---|
35 | }
|
---|
36 |
|
---|
37 | public object Clone() {
|
---|
38 | return Clone(new Cloner());
|
---|
39 | }
|
---|
40 | }
|
---|
41 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.