1 // Copyright 2016 by Samsung Electronics, Inc.,
3 // This software is the confidential and proprietary information
4 // of Samsung Electronics, Inc. ("Confidential Information"). You
5 // shall not disclose such Confidential Information and shall use
6 // it only in accordance with the terms of the license agreement
7 // you entered into with Samsung.
9 namespace Tizen.Applications.CoreBackend
12 /// Class that represents the type of event for backends. This class can be converted from string type.
14 public class EventType
17 /// Pre-defined event type. "PreCreated"
19 public static readonly EventType PreCreated = "PreCreated";
22 /// Pre-defined event type. "Created"
24 public static readonly EventType Created = "Created";
27 /// Pre-defined event type. "Terminated"
29 public static readonly EventType Terminated = "Terminated";
32 /// Pre-defined event type. "AppControlReceived"
34 public static readonly EventType AppControlReceived = "AppControlReceived";
37 /// Pre-defined event type. "Resumed"
39 public static readonly EventType Resumed = "Resumed";
42 /// Pre-defined event type. "Paused"
44 public static readonly EventType Paused = "Paused";
47 /// Pre-defined event type. "LowMemory"
49 public static readonly EventType LowMemory = "LowMemory";
52 /// Pre-defined event type. "LowBattery"
54 public static readonly EventType LowBattery = "LowBattery";
57 /// Pre-defined event type. "LocaleChanged"
59 public static readonly EventType LocaleChanged = "LocaleChanged";
62 /// Pre-defined event type. "RegionFormatChanged"
64 public static readonly EventType RegionFormatChanged = "RegionFormatChanged";
66 private string _typeName;
69 /// Initializes the EventType class.
71 /// <param name="name">The name of event type.</param>
72 public EventType(string name)
78 /// Returns the name of event type.
80 public override string ToString()
86 /// Returns the hash code for event type string.
88 public override int GetHashCode()
90 return _typeName.GetHashCode();
94 /// Determines whether this instance and a specified object.
96 public override bool Equals(object obj)
98 return _typeName.Equals(obj);
102 /// Determines whether this instance and a specified object.
104 public bool Equals(EventType obj)
110 return _typeName.Equals(obj._typeName);
114 /// Converts a string to EventType instance.
116 public static implicit operator EventType(string value)
118 return new EventType(value);