Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ServiceFailureActions.cs
1using System;
2using System.Collections.Generic;
3using System.Text;
5
7{
12 public class ServiceFailureActions : IEquatable<ServiceFailureActions>
13 {
14 public TimeSpan ResetPeriod { get; }
15 public string RebootMessage { get; }
16 public string RestartCommand { get; }
17 public IReadOnlyCollection<ScAction> Actions { get; }
18
22 public ServiceFailureActions(TimeSpan resetPeriod, string rebootMessage, string restartCommand, IReadOnlyCollection<ScAction> actions)
23 {
24 ResetPeriod = resetPeriod;
25 RebootMessage = rebootMessage;
26 RestartCommand = restartCommand;
27 Actions = actions;
28 }
29
30 public override bool Equals(object obj)
31 {
32 if (obj is null)
33 return false;
34
35 return obj is ServiceFailureActions && Equals((ServiceFailureActions)obj);
36 }
37
38
39 public override int GetHashCode()
40 {
41 int h1 = this.ResetPeriod.GetHashCode();
42 int h2 = this.RebootMessage.GetHashCode();
43
44 h1 = ((h1 << 5) + h1) ^ h2;
45
46 h2 = this.RestartCommand.GetHashCode();
47 h1 = ((h1 << 5) + h1) ^ h2;
48
49 foreach (ScAction Action in this.Actions)
50 {
51 h2 = Action.GetHashCode();
52 h1 = ((h1 << 5) + h1) ^ h2;
53 }
54
55 return h1;
56 }
57
58 public bool Equals(ServiceFailureActions other)
59 {
60 if (other is null)
61 {
62 return false;
63 }
64 return this.GetHashCode() == other.GetHashCode();
65 }
66 }
67}
A managed class that holds data referring to a T:DasMulli.Win32.ServiceUtils.ServiceFailureActionsInf...
ServiceFailureActions(TimeSpan resetPeriod, string rebootMessage, string restartCommand, IReadOnlyCollection< ScAction > actions)
Initializes a new instance of the ServiceFailureActions class.