/// <summary> /// Sets the type of the periodic ambient tick. /// OnAmbientTick will be called for the following settings. /// If the SetAmbientTickType is not called, the OnAmbientTick will be called every minute. /// </summary> /// <param name="ambientTickType">The type of the ambient tick.</param> /// <feature>http://tizen.org/feature/watch_app</feature> /// <exception cref="InvalidOperationException">Thrown when failed to set the ambient tick type.</exception> /// <exception cref="NotSupportedException">Thrown when the method is not supported.</exception> /// <example> /// <code> /// class MyApp : WatchApplication /// { /// ... /// public void TestMethod() /// { /// try /// { /// SetAmbientTickType(AmbientTickType.EveryMinute); /// } /// catch /// { /// } /// } /// } /// </code> /// </example> /// <since_tizen> 4 </since_tizen> protected void SetAmbientTickType(AmbientTickType ambientTickType) { Interop.Watch.ErrorCode err = Interop.Watch.SetAmbientTickType(ambientTickType); if (err != Interop.Watch.ErrorCode.None) { 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); } } }
internal static extern ErrorCode SetAmbientTickType(AmbientTickType type);
internal static extern ErrorCode GetAmbientTickType(out AmbientTickType type);