Fix issue for checking return value of Interop (#5491)
[platform/core/csapi/tizenfx.git] / src / Tizen.Applications.RemoteView / Tizen.Applications / RemoteView.cs
index 333cb38..72f95f1 100755 (executable)
@@ -23,11 +23,15 @@ namespace Tizen.Applications
     /// <summary>
     /// Represents the proxy class for the widget application.
     /// </summary>
+    /// <since_tizen> 3 </since_tizen>
+    [Obsolete("Deprecated since API10. Will be removed in API12.")]
     public class RemoteView
     {
         /// <summary>
         /// The event types to send.
         /// </summary>
+        /// <since_tizen> 3 </since_tizen>
+        [Obsolete("Deprecated since API10. Will be removed in API12.")]
         public enum Event
         {
             /// <summary>
@@ -45,12 +49,16 @@ namespace Tizen.Applications
         /// Layout object including preview image, overlay text, loading text, and remote screen image.
         /// </summary>
         /// <privilege>http://tizen.org/privilege/widget.viewer</privilege>
+        /// <since_tizen> 3 </since_tizen>
+        [Obsolete("Deprecated since API10. Will be removed in API12.")]
         public Layout Layout { get; internal set; }
 
         /// <summary>
         /// The widget ID.
         /// </summary>
         /// <privilege>http://tizen.org/privilege/widget.viewer</privilege>
+        /// <since_tizen> 3 </since_tizen>
+        [Obsolete("Deprecated since API10. Will be removed in API12.")]
         public string Id
         {
             get
@@ -65,6 +73,8 @@ namespace Tizen.Applications
         /// The update period.
         /// </summary>
         /// <privilege>http://tizen.org/privilege/widget.viewer</privilege>
+        /// <since_tizen> 3 </since_tizen>
+        [Obsolete("Deprecated since API10. Will be removed in API12.")]
         public double Period
         {
             get
@@ -80,6 +90,8 @@ namespace Tizen.Applications
         /// This string can be used for creating contents of the widget again after rebooting a device or it can be recovered from a crash (abnormal status).
         /// </remarks>
         /// <privilege>http://tizen.org/privilege/widget.viewer</privilege>
+        /// <since_tizen> 3 </since_tizen>
+        [Obsolete("Deprecated since API10. Will be removed in API12.")]
         public string Content
         {
             get
@@ -94,6 +106,8 @@ namespace Tizen.Applications
         /// Summarized string of the widget content for accessibility.
         /// </summary>
         /// <privilege>http://tizen.org/privilege/widget.viewer</privilege>
+        /// <since_tizen> 3 </since_tizen>
+        [Obsolete("Deprecated since API10. Will be removed in API12.")]
         public string Title
         {
             get
@@ -110,25 +124,34 @@ namespace Tizen.Applications
 
         internal static void CheckException(Interop.WidgetViewerEvas.ErrorCode err)
         {
-            switch (err)
+            if (err != Interop.WidgetViewerEvas.ErrorCode.None)
             {
-                case Interop.WidgetViewerEvas.ErrorCode.Fault:
-                    throw new InvalidOperationException("Fault at unmanaged code");
+                switch (err)
+                {
+                    case Interop.WidgetViewerEvas.ErrorCode.Fault:
+                        throw new InvalidOperationException("Fault at unmanaged code");
 
-                case Interop.WidgetViewerEvas.ErrorCode.PermissionDenied:
-                    throw new UnauthorizedAccessException();
+                    case Interop.WidgetViewerEvas.ErrorCode.PermissionDenied:
+                        throw new UnauthorizedAccessException();
 
-                case Interop.WidgetViewerEvas.ErrorCode.NotSupported:
-                    throw new NotSupportedException();
+                    case Interop.WidgetViewerEvas.ErrorCode.NotSupported:
+                        throw new NotSupportedException();
 
-                case Interop.WidgetViewerEvas.ErrorCode.InvalidParameter:
-                    throw new InvalidOperationException("Invalid parameter error at unmanaged code");
+                    case Interop.WidgetViewerEvas.ErrorCode.InvalidParameter:
+                        throw new InvalidOperationException("Invalid parameter error at unmanaged code");
 
-                case Interop.WidgetViewerEvas.ErrorCode.AlreadyExist:
-                    throw new InvalidOperationException("Already exist");
+                    case Interop.WidgetViewerEvas.ErrorCode.AlreadyExist:
+                        throw new InvalidOperationException("Already exist");
 
-                case Interop.WidgetViewerEvas.ErrorCode.MaxExceeded:
-                    throw new InvalidOperationException("Max exceeded");
+                    case Interop.WidgetViewerEvas.ErrorCode.MaxExceeded:
+                        throw new InvalidOperationException("Max exceeded");
+
+                    case Interop.WidgetViewerEvas.ErrorCode.Disabled:
+                        throw new InvalidOperationException("Disabled");
+
+                    default:
+                        throw new InvalidOperationException("Invalid Operation");
+                }
             }
         }
 
@@ -139,6 +162,8 @@ namespace Tizen.Applications
         /// <exception cref="InvalidOperationException">Thrown when this operation failed.</exception>
         /// <exception cref="UnauthorizedAccessException">Thrown when this operation is denied.</exception>
         /// <exception cref="NotSupportedException">Thrown when this operation is not supported for this device.</exception>
+        /// <since_tizen> 3 </since_tizen>
+        [Obsolete("Deprecated since API10. Will be removed in API12.")]
         public static void PauseAll()
         {
             CheckException(Interop.WidgetViewerEvas.NotifyPausedStatusOfViewer());
@@ -151,6 +176,8 @@ namespace Tizen.Applications
         /// <exception cref="InvalidOperationException">Thrown when this operation failed.</exception>
         /// <exception cref="UnauthorizedAccessException">Thrown when this operation is denied.</exception>
         /// <exception cref="NotSupportedException">Thrown when this operation is not supported for this device.</exception>
+        /// <since_tizen> 3 </since_tizen>
+        [Obsolete("Deprecated since API10. Will be removed in API12.")]
         public static void ResumeAll()
         {
             CheckException(Interop.WidgetViewerEvas.NotifyResumedStatusOfViewer());
@@ -163,6 +190,8 @@ namespace Tizen.Applications
         /// <exception cref="InvalidOperationException">Thrown when this operation failed.</exception>
         /// <exception cref="UnauthorizedAccessException">Thrown when this operation is denied.</exception>
         /// <exception cref="NotSupportedException">Thrown when this operation is not supported for this device.</exception>
+        /// <since_tizen> 3 </since_tizen>
+        [Obsolete("Deprecated since API10. Will be removed in API12.")]
         public void Pause()
         {
             CheckException(Interop.WidgetViewerEvas.PauseWidget(Layout));
@@ -175,6 +204,8 @@ namespace Tizen.Applications
         /// <exception cref="InvalidOperationException">Thrown when this operation failed.</exception>
         /// <exception cref="UnauthorizedAccessException">Thrown when this operation is denied.</exception>
         /// <exception cref="NotSupportedException">Thrown when this operation is not supported for this device.</exception>
+        /// <since_tizen> 3 </since_tizen>
+        [Obsolete("Deprecated since API10. Will be removed in API12.")]
         public void Resume()
         {
             CheckException(Interop.WidgetViewerEvas.ResumeWidget(Layout));
@@ -186,6 +217,8 @@ namespace Tizen.Applications
         /// <privilege>http://tizen.org/privilege/widget.viewer</privilege>
         /// <exception cref="UnauthorizedAccessException">Thrown when this operation is denied.</exception>
         /// <exception cref="NotSupportedException">Thrown when this operation is not supported for this device.</exception>
+        /// <since_tizen> 3 </since_tizen>
+        [Obsolete("Deprecated since API10. Will be removed in API12.")]
         public void SendEvent(Event ev)
         {
             switch (ev)