Free cookie consent management tool by TermsFeed Policy Generator

source: branches/Async/HeuristicLab.Clients.Hive/3.3/ServiceClients/Job.cs @ 15281

Last change on this file since 15281 was 15281, checked in by abeham, 7 years ago

#2258: merged r14001:15280 from trunk into branch

File size: 2.5 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2016 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 Job : IDeepCloneable, IContent {
28
29    #region Constructors and Cloning
30    public Job() {
31      ResourceNames = "HEAL";
32      DateCreated = DateTime.Now;
33      Permission = Permission.Full;
34    }
35
36    protected Job(Job original, Cloner cloner) {
37      cloner.RegisterClonedObject(original, this);
38      this.OwnerUserId = original.OwnerUserId;
39      this.DateCreated = original.DateCreated;
40      this.ResourceNames = original.ResourceNames;
41      this.Name = original.Name;
42      this.Description = original.Description;
43      this.Id = original.Id;
44      this.Permission = original.Permission;
45    }
46    public override IDeepCloneable Clone(Cloner cloner) {
47      return new Job(this, cloner);
48    }
49    #endregion
50
51    #region Events
52    public event EventHandler StateLogListChanged;
53    private void OnStateLogListChanged() {
54      var handler = StateLogListChanged;
55      if (handler != null) handler(this, EventArgs.Empty);
56    }
57    #endregion
58
59    protected override void OnPropertyChanged(PropertyChangedEventArgs e) {
60      base.OnPropertyChanged(e);
61      if (e.PropertyName == "Name") {
62        OnToStringChanged();
63      }
64    }
65
66    protected override void RaisePropertyChanged(string propertyName) {
67      if (!(propertyName == "ExecutionTime")
68        && !(propertyName == "JobCount")
69        && !(propertyName == "CalculatingCount")
70        && !(propertyName == "FinishedCount")) {
71        base.RaisePropertyChanged(propertyName);
72      }
73    }
74
75    public override string ToString() {
76      return Name;
77    }
78  }
79}
Note: See TracBrowser for help on using the repository browser.