2 * Copyright (c) 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.Notifications
22 /// This class contains common properties and methods of notifications.
25 /// A notification is a message that is displayed on the notification area.
26 /// It is created to notify information to the user through the application.
27 /// This class helps you to provide method and property for creating notification object.
29 public sealed partial class Notification
32 /// Class for displaying progress notification.
33 /// You must initialize progress category, current, and max value when you create an object.
35 /// <since_tizen> 3 </since_tizen>
36 public sealed class ProgressType : MakerBase
38 private double progressCurrent;
39 private double progressMax;
42 /// Initializes a new instance of the <see cref="ProgressType"/> class.
43 /// You must initialize category, current, and max value of the progress.
45 /// <param name="category">The category of progress that appeared on notification.</param>
46 /// <param name="current">The current value of the progress.</param>
47 /// <param name="max">The max value of the progress.</param>
48 /// <exception cref="ArgumentException">Thrown when an argument is invalid.</exception>
49 /// <since_tizen> 3 </since_tizen>
50 public ProgressType(ProgressCategory category, double current, double max)
52 if (IsNegativeNumber(current))
54 throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "The current must be a positive integer.");
57 if (IsNegativeNumber(max))
59 throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "The max must be a positive integer.");
63 ProgressCurrent = current;
68 /// Gets or sets category of ProgressType.
70 /// <seealso cref="Tizen.Applications.Notifications.ProgressCategory"></seealso>
71 /// <since_tizen> 3 </since_tizen>
72 public ProgressCategory Category { get; set; }
75 /// Gets or sets current value of ProgressType.
77 /// <exception cref="ArgumentException">Thrown when argument is invalid.</exception>
78 /// <since_tizen> 3 </since_tizen>
79 public double ProgressCurrent
83 return progressCurrent;
88 if (IsNegativeNumber(value))
90 throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "The value must be a positive integer.");
93 progressCurrent = value;
98 /// Gets or sets max value of ProgressType.
100 /// <exception cref="ArgumentException">Thrown when argument is invalid.</exception>
101 /// <since_tizen> 3 </since_tizen>
102 public double ProgressMax
111 if (IsNegativeNumber(value))
113 throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "The value must be a positive integer.");
120 internal override void Make(Notification notification)
122 ProgressBinder.BindObject(notification);
125 private bool IsNegativeNumber(double number)