Release 4.0.0-preview1-00249
[platform/core/csapi/tizenfx.git] / src / Tizen.Applications.WatchApplication / Tizen.Applications / WatchApplication.cs
index f739b47..b02f1a4 100755 (executable)
@@ -49,7 +49,7 @@ namespace Tizen.Applications
         /// <summary>
         /// Instance for the window
         /// </summary>
-        protected Widget Window;
+        protected Window Window;
 
         /// <summary>
         /// Occurs whenever the application is resumed.
@@ -103,6 +103,7 @@ namespace Tizen.Applications
 
             Interop.Watch.GetWin(out win);
             Window = new WatchWindow(win);
+            Window.Show();
         }
 
         /// <summary>
@@ -158,8 +159,10 @@ namespace Tizen.Applications
         /// Gets the current time
         /// </summary>
         /// <returns>WatchTime</returns>
+        /// <feature>http://tizen.org/feature/watch_app</feature>
         /// <exception cref="InvalidOperationException">Thrown when failed to get current time because of invalid parameter.</exception>
         /// <exception cref="OutOfMemoryException">Thrown when failed to get current time because memory is not enough.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the method is not supported.</exception>
         /// <example>
         /// <code>
         /// class MyApp : WatchApplication
@@ -190,6 +193,8 @@ namespace Tizen.Applications
                     throw new InvalidOperationException("Failed to get current time. err : " + err);
                 else if (err == Interop.Watch.ErrorCode.OutOfMemory)
                     throw new OutOfMemoryException("Failed to get current time. err : " + err);
+                else if (err == Interop.Watch.ErrorCode.NotSupported)
+                    throw new NotSupportedException("Failed to get current time. err : " + err);
             }
             return new WatchTime(handle);
         }
@@ -198,7 +203,9 @@ namespace Tizen.Applications
         /// Gets the type of periodic ambient tick.
         /// </summary>
         /// <returns>AmbientTickType</returns>
+        /// <feature>http://tizen.org/feature/watch_app</feature>
         /// <exception cref="InvalidOperationException">Thrown when failed to get ambient tick type.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the method is not supported.</exception>
         /// <example>
         /// <code>
         /// class MyApp : WatchApplication
@@ -226,7 +233,10 @@ namespace Tizen.Applications
 
             if(err != Interop.Watch.ErrorCode.None)
             {
-                throw new InvalidOperationException("Failed to get ambient tick type. err : " + err);
+                if (err == Interop.Watch.ErrorCode.NotSupported)
+                    throw new NotSupportedException("Failed to get ambient tick type. err : " + err);
+                else
+                    throw new InvalidOperationException("Failed to get ambient tick type. err : " + err);
             }
 
             return ambientTickType;
@@ -238,7 +248,9 @@ namespace Tizen.Applications
         /// If SetAmbientTickType is not called, OnAmbientTick will be called every minute.
         /// </summary>
         /// <param name="ambientTickType">the type of ambient tick</param>
+        /// <feature>http://tizen.org/feature/watch_app</feature>
         /// <exception cref="InvalidOperationException">Thrown when failed to set ambient tick type.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the method is not supported.</exception>
         /// <example>
         /// <code>
         /// class MyApp : WatchApplication
@@ -263,7 +275,10 @@ namespace Tizen.Applications
 
             if(err != Interop.Watch.ErrorCode.None)
             {
-                throw new InvalidOperationException("Failed to set ambient tick type. err : " + err);
+                if (err == Interop.Watch.ErrorCode.NotSupported)
+                    throw new NotSupportedException("Failed to set ambient tick type. err : " + err);
+                else
+                    throw new InvalidOperationException("Failed to set ambient tick type. err : " + err);
             }
         }
 
@@ -274,7 +289,9 @@ namespace Tizen.Applications
         /// </summary>
         /// <param name="ticks">Ticks the number of ticks per given resolution type</param>
         /// <param name="type">Type of the resolution type</param>
+        /// <feature>http://tizen.org/feature/watch_app</feature>
         /// <exception cref="InvalidOperationException">Thrown when failed to set time tick frequency.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the method is not supported.</exception>
         /// <example>
         /// <code>
         /// class MyApp : WatchApplication
@@ -299,7 +316,10 @@ namespace Tizen.Applications
 
             if (err != Interop.Watch.ErrorCode.None)
             {
-                throw new InvalidOperationException("Failed to set time tick frequency. err : " + err);
+                if (err == Interop.Watch.ErrorCode.NotSupported)
+                    throw new NotSupportedException("Failed to set time tick frequency. err : " + err);
+                else
+                    throw new InvalidOperationException("Failed to set time tick frequency. err : " + err);
             }
         }
 
@@ -308,7 +328,9 @@ namespace Tizen.Applications
         /// </summary>
         /// <param name="ticks">Ticks the number of ticks per given resolution type</param>
         /// <param name="type">Type of the resolution type</param>
+        /// <feature>http://tizen.org/feature/watch_app</feature>
         /// <exception cref="InvalidOperationException">Thrown when failed to get time tick frequency.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the method is not supported.</exception>
         /// <example>
         /// <code>
         /// class MyApp : WatchApplication
@@ -335,7 +357,10 @@ namespace Tizen.Applications
 
             if (err != Interop.Watch.ErrorCode.None)
             {
-                throw new InvalidOperationException("Failed to get time tick frequency. err : " + err);
+                if (err == Interop.Watch.ErrorCode.NotSupported)
+                    throw new NotSupportedException("Failed to get time tick frequency. err : " + err);
+                else
+                    throw new InvalidOperationException("Failed to get time tick frequency. err : " + err);
             }
         }
     }