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.
18 using System.Collections.Generic;
23 /// Place information, used in place discovery and search requests.
25 /// <since_tizen> 3 </since_tizen>
26 public class Place : IDisposable
28 internal Interop.PlaceHandle handle;
30 internal Place(Interop.PlaceHandle nativeHandle)
32 handle = nativeHandle;
36 /// Destroy the Place object.
44 /// Gets an ID string for the place.
46 /// <since_tizen> 3 </since_tizen>
56 /// Gets name string for the place.
58 /// <since_tizen> 3 </since_tizen>
68 /// Gets a view URI for the place.
70 /// <since_tizen> 3 </since_tizen>
80 /// Gets a distance for the place from the center.
82 /// <since_tizen> 3 </since_tizen>
87 return handle.Distance;
92 /// Gets a geographical location for the place.
94 /// <since_tizen> 3 </since_tizen>
95 public Geocoordinates Coordinates
99 return new Geocoordinates(handle.Coordinates);
104 /// Gets an address for the place.
106 /// <since_tizen> 3 </since_tizen>
107 public PlaceAddress Address
111 return new PlaceAddress(handle.Address);
116 /// Gets a rating for the place.
118 /// <since_tizen> 3 </since_tizen>
119 public PlaceRating Rating
123 return new PlaceRating(handle.Rating);
128 /// Gets a supplier link for the place.
130 /// <since_tizen> 3 </since_tizen>
131 public PlaceLink Supplier
135 return new PlaceLink(handle.Supplier);
140 /// Gets a related link for the place.
142 /// <since_tizen> 3 </since_tizen>
143 public PlaceLink Related
147 return new PlaceLink(handle.Related);
152 /// Gets all the properties attached to this place.
154 /// <since_tizen> 3 </since_tizen>
155 public IDictionary<string, string> Properties
159 var properties = new Dictionary<string, string>();
160 handle.ForeachProperty((key, value) => properties[key] = value);
166 /// Gets all the categories attached to this place.
168 /// <since_tizen> 3 </since_tizen>
169 public IEnumerable<PlaceCategory> Categories
173 var categories = new List<PlaceCategory>();
174 handle.ForeachCategory((categoryHandle) => categories.Add(new PlaceCategory(categoryHandle)));
180 /// Gets all the attributes attached to this place.
182 /// <since_tizen> 3 </since_tizen>
183 public IEnumerable<PlaceAttribute> Attributes
187 var attributes = new List<PlaceAttribute>();
188 handle.ForeachAttribute((attributeHandle) => attributes.Add(new PlaceAttribute(attributeHandle)));
194 /// Gets all the contacts attached to this place.
196 /// <since_tizen> 3 </since_tizen>
197 public IEnumerable<PlaceContact> Contacts
201 var contacts = new List<PlaceContact>();
202 handle.ForeachContact((contactHandle) => contacts.Add(new PlaceContact(contactHandle)));
208 /// Gets all the editorials attached to this place.
210 /// <since_tizen> 3 </since_tizen>
211 public IEnumerable<PlaceEditorial> Editorials
215 var editorials = new List<PlaceEditorial>();
216 handle.ForeachEditorial((editorialHandle) => editorials.Add(new PlaceEditorial(editorialHandle)));
222 /// Gets all the images attached to this place.
224 /// <since_tizen> 3 </since_tizen>
225 public IEnumerable<PlaceImage> Images
229 var images = new List<PlaceImage>();
230 handle.ForeachImage((imageHandle) => images.Add(new PlaceImage(imageHandle)));
236 /// Gets all the reviews attached to this place.
238 /// <since_tizen> 3 </since_tizen>
239 public IEnumerable<PlaceReview> Reviews
243 var reviews = new List<PlaceReview>();
244 handle.ForeachReview((reviewHandle) => reviews.Add(new PlaceReview(reviewHandle)));
249 #region IDisposable Support
250 private bool _disposedValue = false;
253 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
255 /// <param name="disposing">If true, managed and unmanaged resources can be disposed, otherwise only unmanaged resources can be disposed.</param>
256 protected virtual void Dispose(bool disposing)
261 _disposedValue = true;
266 /// Releases all the resources used by this object.
268 /// <since_tizen> 3 </since_tizen>
269 public void Dispose()
272 GC.SuppressFinalize(this);