source: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveExperiment.cs @ 6479

Last change on this file since 6479 was 6479, checked in by cneumuel, 8 years ago

#1233

  • finished experiment sharing
  • added role for executing privileged jobs
  • refreshing experiments in experimentManager does not delete already downloaded jobs
  • moved some properties from HiveExperiment into RefreshableHiveExperiment
File size: 2.8 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.ComponentModel;
24using HeuristicLab.Common;
25
26namespace HeuristicLab.Clients.Hive {
27  public partial class HiveExperiment : IDeepCloneable, IContent {
28
29    private bool isPrivileged;
30    public bool IsPrivileged {
31      get { return isPrivileged; }
32      set { isPrivileged = value; }
33    }
34
35    #region Constructors and Cloning
36    public HiveExperiment() {
37      this.ResourceNames = "HEAL";
38      this.DateCreated = DateTime.Now;
39      this.Permission = Permission.Full;
40    }
41
42    protected HiveExperiment(HiveExperiment original, Cloner cloner) {
43      cloner.RegisterClonedObject(original, this);
44      this.OwnerUserId = original.OwnerUserId;
45      this.DateCreated = original.DateCreated;
46      this.ResourceNames = original.ResourceNames;
47      this.LastAccessed = original.LastAccessed;
48      this.Name = original.Name;
49      this.Description = original.Description;
50      this.Id = original.Id;
51      this.IsPrivileged = original.IsPrivileged;
52      this.Permission = original.Permission;
53    }
54    public override IDeepCloneable Clone(Cloner cloner) {
55      return new HiveExperiment(this, cloner);
56    }
57    #endregion
58
59    #region Events
60    public event EventHandler StateLogListChanged;
61    private void OnStateLogListChanged() {
62      var handler = StateLogListChanged;
63      if (handler != null) handler(this, EventArgs.Empty);
64    }
65    #endregion
66
67    protected override void OnPropertyChanged(PropertyChangedEventArgs e) {
68      base.OnPropertyChanged(e);
69      if (e.PropertyName == "Name") {
70        OnToStringChanged();
71      }
72    }
73
74    protected override void RaisePropertyChanged(string propertyName) {
75      if (!(propertyName == "ExecutionTime")
76        && !(propertyName == "JobCount")
77        && !(propertyName == "CalculatingCount")
78        && !(propertyName == "FinishedCount")) {
79        base.RaisePropertyChanged(propertyName);
80      }
81    }
82
83    public override string ToString() {
84      return Name;
85    }
86  }
87}
Note: See TracBrowser for help on using the repository browser.