/* * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; namespace Tizen.Maps { /// /// Place filter information, used in place discovery and search requests. /// /// 3 public class PlaceFilter : IDisposable { internal Interop.PlaceFilterHandle handle; /// /// Constructs a new place filter. /// /// 3 /// Thrown when native operation failed to allocate memory. public PlaceFilter() { handle = new Interop.PlaceFilterHandle(); } /// /// Destroy the PlaceFilter object. /// ~PlaceFilter() { Dispose(false); } /// /// Gets or sets a free-formed address string for this place filter. /// /// 3 /// Depending on maps provider which the application has selected, /// it may treat , and /// as the same kind of strings to search places. public string Address { get { return handle.PlaceAddress; } set { handle.PlaceAddress = value; } } /// /// Gets or sets an instance of object for this place filter. /// /// 3 public PlaceCategory Category { get { return new PlaceCategory(handle.Category); } set { handle.Category = value.handle; } } /// /// Gets or sets a keyword for this place filter. /// /// 3 /// Depending on maps provider which the application has selected, /// it may treat , and /// as the same kind of strings to search places. public string Keyword { get { return handle.Keyword; } set { handle.Keyword = value; } } /// /// Gets or sets a name for this place filter. /// /// 3 /// Depending on maps provider which the application has selected, /// it may treat , and /// as the same kind of strings to search places. public string Name { get { return handle.PlaceName; } set { handle.PlaceName = value; } } #region IDisposable Support private bool _disposedValue = false; /// /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// /// If true, managed and unmanaged resources can be disposed, otherwise only unmanaged resources can be disposed. /// 3 protected virtual void Dispose(bool disposing) { if (!_disposedValue) { handle?.Dispose(); _disposedValue = true; } } /// /// Releases all the resources used by this object. /// /// 3 public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } #endregion } }