2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 namespace Tizen.Applications.CoreBackend
19 /// Class that represents the type of event for backends. This class can be converted from string type.
21 public class EventType
24 /// Pre-defined event type. "PreCreated"
26 public static readonly EventType PreCreated = "PreCreated";
29 /// Pre-defined event type. "Created"
31 public static readonly EventType Created = "Created";
34 /// Pre-defined event type. "Terminated"
36 public static readonly EventType Terminated = "Terminated";
39 /// Pre-defined event type. "AppControlReceived"
41 public static readonly EventType AppControlReceived = "AppControlReceived";
44 /// Pre-defined event type. "Resumed"
46 public static readonly EventType Resumed = "Resumed";
49 /// Pre-defined event type. "Paused"
51 public static readonly EventType Paused = "Paused";
54 /// Pre-defined event type. "LowMemory"
56 public static readonly EventType LowMemory = "LowMemory";
59 /// Pre-defined event type. "LowBattery"
61 public static readonly EventType LowBattery = "LowBattery";
64 /// Pre-defined event type. "LocaleChanged"
66 public static readonly EventType LocaleChanged = "LocaleChanged";
69 /// Pre-defined event type. "RegionFormatChanged"
71 public static readonly EventType RegionFormatChanged = "RegionFormatChanged";
74 /// Pre-defined event type. "DeviceOrientationChanged"
76 public static readonly EventType DeviceOrientationChanged = "DeviceOrientationChanged";
78 private string _typeName;
81 /// Initializes the EventType class.
83 /// <param name="name">The name of event type.</param>
84 public EventType(string name)
90 /// Returns the name of event type.
92 public override string ToString()
98 /// Returns the hash code for event type string.
100 public override int GetHashCode()
102 if (_typeName == null) return 0;
103 return _typeName.GetHashCode();
107 /// Determines whether this instance and a specified object.
109 public override bool Equals(object obj)
111 EventType other = obj as EventType;
112 return other != null && other._typeName == this._typeName;
116 /// Converts a string to EventType instance.
118 public static implicit operator EventType(string value)
120 return new EventType(value);