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
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 /// Gets ID string for the place.
38 /// <since_tizen>3</since_tizen>
48 /// Gets name string for the place.
50 /// <since_tizen>3</since_tizen>
60 /// Gets view URI for the place.
62 /// <since_tizen>3</since_tizen>
72 /// Gets distance for the place from the center.
74 /// <since_tizen>3</since_tizen>
79 return handle.Distance;
84 /// Gets geographical location for the place.
86 /// <since_tizen>3</since_tizen>
87 public Geocoordinates Coordinates
91 return new Geocoordinates(handle.Coordinates);
96 /// Gets address for the place.
98 /// <since_tizen>3</since_tizen>
99 public PlaceAddress Address
103 return new PlaceAddress(handle.Address);
108 /// Gets rating for the place.
110 /// <since_tizen>3</since_tizen>
111 public PlaceRating Rating
115 return new PlaceRating(handle.Rating);
120 /// Gets supplier link for the place.
122 /// <since_tizen>3</since_tizen>
123 public PlaceLink Supplier
127 return new PlaceLink(handle.Supplier);
132 /// Gets related link for the place.
134 /// <since_tizen>3</since_tizen>
135 public PlaceLink Related
139 return new PlaceLink(handle.Related);
144 /// Gets all properties attached to this place.
146 /// <since_tizen>3</since_tizen>
147 public IDictionary<string, string> Properties
151 var properties = new Dictionary<string, string>();
152 handle.ForeachProperty((key, value) => properties[key] = value);
158 /// Gets all categories attached to this place.
160 /// <since_tizen>3</since_tizen>
161 public IEnumerable<PlaceCategory> Categories
165 var categories = new List<PlaceCategory>();
166 handle.ForeachCategory((categoryHandle) => categories.Add(new PlaceCategory(categoryHandle)));
172 /// Gets all attributes attached to this place.
174 /// <since_tizen>3</since_tizen>
175 public IEnumerable<PlaceAttribute> Attributes
179 var attributes = new List<PlaceAttribute>();
180 handle.ForeachAttribute((attributeHandle) => attributes.Add(new PlaceAttribute(attributeHandle)));
186 /// Gets all contacts attached to this place.
188 /// <since_tizen>3</since_tizen>
189 public IEnumerable<PlaceContact> Contacts
193 var contacts = new List<PlaceContact>();
194 handle.ForeachContact((contactHandle) => contacts.Add(new PlaceContact(contactHandle)));
200 /// Gets all editorials attached to this place.
202 /// <since_tizen>3</since_tizen>
203 public IEnumerable<PlaceEditorial> Editorials
207 var editorials = new List<PlaceEditorial>();
208 handle.ForeachEditorial((editorialHandle) => editorials.Add(new PlaceEditorial(editorialHandle)));
214 /// Gets all images attached to this place.
216 /// <since_tizen>3</since_tizen>
217 public IEnumerable<PlaceImage> Images
221 var images = new List<PlaceImage>();
222 handle.ForeachImage((imageHandle) => images.Add(new PlaceImage(imageHandle)));
228 /// Gets all reviews attached to this place.
230 /// <since_tizen>3</since_tizen>
231 public IEnumerable<PlaceReview> Reviews
235 var reviews = new List<PlaceReview>();
236 handle.ForeachReview((reviewHandle) => reviews.Add(new PlaceReview(reviewHandle)));
241 #region IDisposable Support
242 private bool _disposedValue = false;
244 protected virtual void Dispose(bool disposing)
249 _disposedValue = true;
254 /// Releases all resources used by this object.
256 /// <since_tizen>3</since_tizen>
257 public void Dispose()
260 GC.SuppressFinalize(this);