/*
* 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 review information, used in place discovery and search requests.
///
/// 3
public class PlaceReview
{
private DateTime _date;
private string _title;
private double _rating;
private string _description;
private string _language;
private PlaceMedia _media;
private PlaceLink _userLink;
internal PlaceReview(Interop.PlaceReviewHandle handle)
{
string date = handle.Date;
if (DateTime.TryParse(date, out _date) == false)
{
Interop.ErrorCode.InvalidParameter.WarnIfFailed($"Wrong date format: {date}");
}
_title = handle.Title;
_rating = handle.Rating;
_description = handle.Description;
_language = handle.Language;
_media = new PlaceMedia(handle.Media);
_userLink = new PlaceLink(handle.User);
}
///
/// Gets an instance of object representing the time of this review.
///
/// 3
public DateTime Date { get { return _date; } }
///
/// Gets a string representing the title of this review.
///
/// 3
public string Title { get { return _title; } }
///
/// Gets a value representing the rating of this review.
///
/// 3
public double Rating { get { return _rating; } }
///
/// Gets a string representing the description of this review.
///
/// 3
public string Description { get { return _description; } }
///
/// Gets a string representing the language of this review.
///
/// 3
public string Language { get { return _language; } }
///
/// Gets an instance of object representing the review media of this review.
///
/// 3
public PlaceMedia ReviewMedia { get { return _media; } }
///
/// Gets an instance of object representing the user link of this review.
///
/// 3
public PlaceLink UserLink { get { return _userLink; } }
}
}