/// <summary> /// Initialize sticker provider. /// </summary> /// <since_tizen> 10 </since_tizen> /// <feature>http://tizen.org/feature/ui_service.sticker</feature> /// <exception cref="NotSupportedException">The required feature is not supported.</exception> /// <exception cref="InvalidOperationException"> /// This can occur due to the following reasons: /// 1) This exception can be due to out of memory. /// 2) This exception can be due to operation failed. /// </exception> public static void Initialize() { if (!Initialized) { IntPtr handle; ErrorCode error = StickerProviderCreate(out handle); if (error != ErrorCode.None) { Log.Error(LogTag, "Create Failed with error " + error); throw ExceptionFactory.CreateException(error); } _handle = handle; Initialized = true; } else { Log.Debug(LogTag, "Already initialized"); } }
/// <summary> /// Deinitialize the sticker consumer. /// </summary> /// <since_tizen> 10 </since_tizen> /// <feature>http://tizen.org/feature/ui_service.sticker</feature> /// <exception cref="NotSupportedException">The required feature is not supported.</exception> /// <exception cref="InvalidOperationException">This exception can be due to operation failed.</exception> /// <pre> /// StickerConsumer must be initialized. /// </pre> public static void Deinitialize() { if (_handle != IntPtr.Zero) { ErrorCode error = StickerConsumerDestroy(_handle); if (error != ErrorCode.None) { Log.Error(LogTag, "Destroy Failed with error " + error); if (error == ErrorCode.InvalidParameter) { throw ExceptionFactory.CreateException(ErrorCode.OperationFailed); } else { throw ExceptionFactory.CreateException(error); } } _handle = IntPtr.Zero; } Initialized = false; }