示例#1
0
        /// <summary>
        /// Gets the frequency of the time tick.
        /// </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 the time tick frequency.</exception>
        /// <exception cref="NotSupportedException">Thrown when the method is not supported.</exception>
        /// <example>
        /// <code>
        /// class MyApp : WatchApplication
        /// {
        ///     ...
        ///     public void TestMethod()
        ///     {
        ///         int tick;
        ///         TimeTickResolution tType;
        ///         try
        ///         {
        ///             GetTimeTickFrequency(out tick, out tType);
        ///         }
        ///         catch
        ///         {
        ///         }
        ///     }
        /// }
        /// </code>
        /// </example>
        /// <since_tizen> 4 </since_tizen>
        protected void GetTimeTickFrequency(out int ticks, out TimeTickResolution type)
        {
            Interop.Watch.ErrorCode err = Interop.Watch.GetTimeTickFrequency(out ticks, out type);

            if (err != Interop.Watch.ErrorCode.None)
            {
                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);
                }
            }
        }
示例#2
0
 internal static extern ErrorCode GetTimeTickFrequency(out int ticks, out TimeTickResolution type);
示例#3
0
 internal static extern ErrorCode SetTimeTickFrequency(int ticks, TimeTickResolution type);