Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Clients.Hive/3.3/ServiceClients/Job.cs @ 11085

Last change on this file since 11085 was 9456, checked in by swagner, 12 years ago

Updated copyright year and added some missing license headers (#1889)

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