2 * Copyright (c) 2016 - 2017 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.
19 namespace Tizen.Applications
22 /// The class containing common properties of the Badge.
24 /// <since_tizen> 3 </since_tizen>
27 private int count = 0;
30 /// Initializes a new instance of the Badge class.
32 /// <since_tizen> 3 </since_tizen>
33 /// <param name="appId">Application ID</param>
34 /// <param name="count">Count value</param>
35 /// <param name="visible">True if it should be displayed</param>
36 /// <exception cref="ArgumentException">Thrown when failed because of invalid argument</exception>
37 public Badge(string appId, int count = 1, bool visible = true)
39 if (IsNegativeNumber(count))
41 throw BadgeErrorFactory.GetException(BadgeError.InvalidParameter, "The count must be positive number");
49 /// Property for the count value of the badge.
51 /// <since_tizen> 3 </since_tizen>
52 /// <exception cref="ArgumentException">Thrown when set negative number</exception>
61 if (IsNegativeNumber(value))
63 throw BadgeErrorFactory.GetException(BadgeError.InvalidParameter, "The count must be positive number");
71 /// Property for the application ID of the badge.
73 /// <since_tizen> 3 </since_tizen>
74 public string AppId { get; set; }
77 /// Property for display visibility. True if the badge display visible, otherwise false..
79 /// <since_tizen> 4 </since_tizen>
80 public bool Visible{ get; set; }
82 private bool IsNegativeNumber(int number)