+
+ /// <summary>
+ /// Gets widget max count
+ /// </summary>
+ /// <since_tizen> 8 </since_tizen>
+ /// <privilege>http://tizen.org/privilege/widget.viewer</privilege>
+ /// <feature>http://tizen.org/feature/shell.appwidget</feature>
+ /// <exception cref="NotSupportedException">Thrown when the required features are not supported.</exception>
+ /// <exception cref="UnauthorizedAccessException">Thrown when an application does not have the required privileges to access this method.</exception>
+ /// <exception cref="InvalidOperationException">Thrown in case of failed conditions.</exception>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int MaxCount
+ {
+ get
+ {
+ int ret = Interop.WidgetService.GetWidgetMaxCount(Id);
+
+ switch ((Interop.WidgetService.ErrorCode)ret)
+ {
+ case Interop.WidgetService.ErrorCode.NotSupported:
+ throw new NotSupportedException();
+
+ case Interop.WidgetService.ErrorCode.PermissionDenied:
+ throw new UnauthorizedAccessException();
+
+ case Interop.WidgetService.ErrorCode.InvalidParameter:
+ throw new InvalidOperationException("Invalid parameter");
+
+ case Interop.WidgetService.ErrorCode.IoError:
+ throw new InvalidOperationException("Failed to access DB");
+
+ case Interop.WidgetService.ErrorCode.Fault:
+ throw new InvalidOperationException("Failed to get information from DB");
+
+ case Interop.WidgetService.ErrorCode.NotExist:
+ throw new InvalidOperationException("The data does not exist");
+ }
+
+ return ret;
+ }
+ }