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.
17 namespace Tizen.Applications
20 /// The class containing common properties of the Badge.
24 private int count = 0;
27 /// Initializes a new instance of the Badge class.
29 /// <since_tizen> 3 </since_tizen>
30 /// <param name="appId">Application ID</param>
31 /// <param name="count">Count value</param>
32 /// <param name="visible">True if it should be displayed</param>
33 /// <exception cref="ArgumentException">Thrown when failed because of invalid argument</exception>
34 public Badge(string appId, int count = 1, bool visible = true)
36 if (IsNegativeNumber(count))
38 throw BadgeErrorFactory.GetException(BadgeError.InvalidParameter, "The count must be positive number");
46 /// Property for the count value of the badge.
48 /// <since_tizen> 3 </since_tizen>
49 /// <exception cref="ArgumentException">Thrown when set negative number</exception>
58 if (IsNegativeNumber(value))
60 throw BadgeErrorFactory.GetException(BadgeError.InvalidParameter, "The count must be positive number");
68 /// Property for the application ID of the badge.
70 /// <since_tizen> 3 </since_tizen>
71 public string AppId { get; set; }
74 /// Property for display visibility. True if the badge display visible, otherwise false..
76 /// <since_tizen> 3 </since_tizen>
77 public bool Visible{ get; set; }
79 private bool IsNegativeNumber(int number)