Merge "Review Tizen.Context.AppHistory API cs files PS1: Edited files as per comments"
[platform/core/csapi/tizenfx.git] / src / Tizen.Maps / Tizen.Maps / PlaceCategory.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 using System;
18
19 namespace Tizen.Maps
20 {
21     /// <summary>
22     /// Place category information, used in place discovery and search requests.
23     /// </summary>
24     /// <since_tizen> 3 </since_tizen>
25     public class PlaceCategory : IDisposable
26     {
27         internal Interop.PlaceCategoryHandle handle;
28
29         /// <summary>
30         /// Constructs a search category object.
31         /// </summary>
32         /// <since_tizen> 3 </since_tizen>
33         /// <exception cref="System.InvalidOperationException">Thrown when native operation failed to allocate memory.</exception>
34         public PlaceCategory()
35         {
36             handle = new Interop.PlaceCategoryHandle();
37         }
38
39         internal PlaceCategory(Interop.PlaceCategoryHandle nativeHandle)
40         {
41             handle = nativeHandle;
42         }
43
44
45         /// <summary>
46         /// Gets or sets an ID for this category.
47         /// </summary>
48         /// <since_tizen> 3 </since_tizen>
49         public string Id
50         {
51             get { return handle.Id; }
52             set { handle.Id = value; }
53         }
54
55         /// <summary>
56         /// Gets or sets a name for this category.
57         /// </summary>
58         /// <since_tizen> 3 </since_tizen>
59         public string Name
60         {
61             get { return handle.Name; }
62             set { handle.Name = value; }
63         }
64
65         /// <summary>
66         /// Gets or sets a URL for this category.
67         /// </summary>
68         /// <since_tizen> 3 </since_tizen>
69         public string Url
70         {
71             get { return handle.Url; }
72             set { handle.Url = value; }
73         }
74
75         /// <summary>
76         /// Returns a string that represents this object.
77         /// </summary>
78         /// <since_tizen> 3 </since_tizen>
79         /// <returns>Returns a string which presents this object.</returns>
80         public override string ToString()
81         {
82             return $"{Name}";
83         }
84
85         #region IDisposable Support
86         private bool _disposedValue = false;
87
88         /// <summary>
89         /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
90         /// </summary>
91         /// <param name="disposing">If true, managed and unmanaged resources can be disposed, otherwise only unmanaged resources can be disposed.</param>
92         protected virtual void Dispose(bool disposing)
93         {
94             if (!_disposedValue)
95             {
96                 handle.Dispose();
97                 _disposedValue = true;
98             }
99         }
100
101         /// <summary>
102         /// Releases all the resources used by this object.
103         /// </summary>
104         /// <since_tizen> 3 </since_tizen>
105         public void Dispose()
106         {
107             Dispose(true);
108             GC.SuppressFinalize(this);
109         }
110         #endregion
111     }
112 }