Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/ServiceClients/Job.cs @ 16147

Last change on this file since 16147 was 16057, checked in by jkarder, 6 years ago

#2839:

File size: 2.6 KB
RevLine 
[6976]1#region License Information
2/* HeuristicLab
[16057]3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
[6976]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;
[15412]23using System.Collections.Generic;
[6976]24using System.ComponentModel;
25using HeuristicLab.Common;
26
27namespace HeuristicLab.Clients.Hive {
28  public partial class Job : IDeepCloneable, IContent {
[15412]29    public List<Guid> ResourceIds { get; set; }
[6976]30
31    #region Constructors and Cloning
32    public Job() {
[15401]33      ProjectId = Guid.Empty;
[9107]34      DateCreated = DateTime.Now;
35      Permission = Permission.Full;
[6976]36    }
37
38    protected Job(Job original, Cloner cloner) {
39      cloner.RegisterClonedObject(original, this);
40      this.OwnerUserId = original.OwnerUserId;
41      this.DateCreated = original.DateCreated;
[15401]42      this.ProjectId = original.ProjectId;
[6976]43      this.Name = original.Name;
44      this.Description = original.Description;
45      this.Id = original.Id;
46      this.Permission = original.Permission;
[15412]47      this.ResourceIds = original.ResourceIds;
[6976]48    }
49    public override IDeepCloneable Clone(Cloner cloner) {
50      return new Job(this, cloner);
51    }
52    #endregion
53
54    #region Events
55    public event EventHandler StateLogListChanged;
56    private void OnStateLogListChanged() {
57      var handler = StateLogListChanged;
58      if (handler != null) handler(this, EventArgs.Empty);
59    }
60    #endregion
61
62    protected override void OnPropertyChanged(PropertyChangedEventArgs e) {
63      base.OnPropertyChanged(e);
64      if (e.PropertyName == "Name") {
65        OnToStringChanged();
66      }
67    }
68
69    protected override void RaisePropertyChanged(string propertyName) {
70      if (!(propertyName == "ExecutionTime")
71        && !(propertyName == "JobCount")
72        && !(propertyName == "CalculatingCount")
73        && !(propertyName == "FinishedCount")) {
74        base.RaisePropertyChanged(propertyName);
75      }
76    }
77
78    public override string ToString() {
79      return Name;
80    }
81  }
82}
Note: See TracBrowser for help on using the repository browser.