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 public class Place : IDisposable
27 internal Interop.PlaceHandle handle;
29 internal Place(Interop.PlaceHandle nativeHandle)
31 handle = nativeHandle;
35 /// Gets ID string for the place.
46 /// Gets name string for the place.
57 /// Gets view URI for the place.
68 /// Gets distance for the place from the center.
74 return handle.Distance;
79 /// Gets geographical location for the place.
81 public Geocoordinates Coordinates
85 return new Geocoordinates(handle.Coordinates);
90 /// Gets address for the place.
92 public PlaceAddress Address
96 return new PlaceAddress(handle.Address);
101 /// Gets rating for the place.
103 public PlaceRating Rating
107 return new PlaceRating(handle.Rating);
112 /// Gets supplier link for the place.
114 public PlaceLink Supplier
118 return new PlaceLink(handle.Supplier);
123 /// Gets related link for the place.
125 public PlaceLink Related
129 return new PlaceLink(handle.Related);
134 /// Gets all properties attached to this place.
136 public IDictionary<string, string> Properties
140 var properties = new Dictionary<string, string>();
141 handle.ForeachProperty((key, value) => properties[key] = value);
147 /// Gets all categories attached to this place.
149 public IEnumerable<PlaceCategory> Categories
153 var categories = new List<PlaceCategory>();
154 handle.ForeachCategory((categoryHandle) => categories.Add(new PlaceCategory(categoryHandle)));
160 /// Gets all attributes attached to this place.
162 public IEnumerable<PlaceAttribute> Attributes
166 var attributes = new List<PlaceAttribute>();
167 handle.ForeachAttribute((attributeHandle) => attributes.Add(new PlaceAttribute(attributeHandle)));
173 /// Gets all contacts attached to this place.
175 public IEnumerable<PlaceContact> Contacts
179 var contacts = new List<PlaceContact>();
180 handle.ForeachContact((contactHandle) => contacts.Add(new PlaceContact(contactHandle)));
186 /// Gets all editorials attached to this place.
188 public IEnumerable<PlaceEditorial> Editorials
192 var editorials = new List<PlaceEditorial>();
193 handle.ForeachEditorial((editorialHandle) => editorials.Add(new PlaceEditorial(editorialHandle)));
199 /// Gets all images attached to this place.
201 public IEnumerable<PlaceImage> Images
205 var images = new List<PlaceImage>();
206 handle.ForeachImage((imageHandle) => images.Add(new PlaceImage(imageHandle)));
212 /// Gets all reviews attached to this place.
214 public IEnumerable<PlaceReview> Reviews
218 var reviews = new List<PlaceReview>();
219 handle.ForeachReview((reviewHandle) => reviews.Add(new PlaceReview(reviewHandle)));
224 #region IDisposable Support
225 private bool _disposedValue = false;
227 protected virtual void Dispose(bool disposing)
232 _disposedValue = true;
237 /// Releases all resources used by this object.
239 public void Dispose()
242 GC.SuppressFinalize(this);