Exemplo n.º 1
0
        /// <summary>
        /// The public constructor.
        /// </summary>
        /// <since_tizen> 3 </since_tizen>
        /// <exception cref="InvalidOperationException">This exception can be due to an invalid state.</exception>
        /// <exception cref="OutOfMemoryException">This exception can be due to out Of memory.</exception>
        /// <exception cref="UnauthorizedAccessException">This exception can be due to permission denied.</exception>
        /// <exception cref="NotSupportedException">This exception can be due to not supported.</exception>
        public VoiceCommand()
        {
            SafeCommandHandle handle;
            ErrorCode         error = VcCmdCreate(out handle);

            if (error != ErrorCode.None)
            {
                Log.Error(LogTag, "Create Failed with error " + error);
                throw ExceptionFactory.CreateException(error);
            }
            _handle = handle;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Release any unmanaged resources used by this object.
        /// </summary>
        /// <param name="disposing">
        /// If true, disposes any disposable objects. If false, does not dispose disposable objects.
        /// </param>
        /// <since_tizen> 6 </since_tizen>
        protected virtual void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                _handle?.Dispose();
                _handle = null;
            }

            _disposed = true;
        }
Exemplo n.º 3
0
        internal VoiceCommandsGroup(SafeCommandListHandle handle)
        {
            _handle = handle;

            VcCmdListCb _callback = (IntPtr vcCommand, IntPtr userData) =>
            {
                SafeCommandHandle cmdHandle = new SafeCommandHandle(vcCommand);
                _commands.Add(new VoiceCommand(cmdHandle));
                return(true);
            };
            ErrorCode error = VcCmdListForeachCommands(_handle, _callback, IntPtr.Zero);

            if (error != ErrorCode.None)
            {
                Log.Error(LogTag, "GetAllCommands Failed with error " + error);
                throw ExceptionFactory.CreateException(error);
            }
            _commands.CollectionChanged += OnCollectionChanged;
        }
Exemplo n.º 4
0
        internal VoiceCommandList(SafeCommandListHandle handle)
        {
            _handle = handle;
            _index  = 0;

            _list     = new List <VoiceCommand>();
            _callback = (IntPtr vcCommand, IntPtr userData) =>
            {
                SafeCommandHandle cmdHandle = new SafeCommandHandle(vcCommand);
                cmdHandle._ownership = false;
                _list.Add(new VoiceCommand(cmdHandle));
                return(true);
            };
            ErrorCode error = VcCmdListForeachCommands(_handle, _callback, IntPtr.Zero);

            if (error != ErrorCode.None)
            {
                Log.Error(LogTag, "GetAllCommands Failed with error " + error);
                throw ExceptionFactory.CreateException(error);
            }
        }
Exemplo n.º 5
0
 internal static extern Interop.VoiceControlWidget.ErrorCode VcCmdGetFormat(SafeCommandHandle vcCommand, out CommandFormat format);
Exemplo n.º 6
0
 internal static extern Interop.VoiceControlWidget.ErrorCode VcCmdGetType(SafeCommandHandle vcCommand, out int type);
Exemplo n.º 7
0
 internal static extern Interop.VoiceControlWidget.ErrorCode VcCmdGetUnfixedCommand(SafeCommandHandle vcCommand, out string command);
Exemplo n.º 8
0
 internal static extern Interop.VoiceControlWidget.ErrorCode VcCmdSetCommand(SafeCommandHandle vcCommand, string command);
Exemplo n.º 9
0
 internal static extern Interop.VoiceControlWidget.ErrorCode VcCmdCreate(out SafeCommandHandle vcCommand);
Exemplo n.º 10
0
 internal static extern Interop.VoiceControlWidget.ErrorCode VcCmdListGetCurrent(SafeCommandListHandle cmdList, out SafeCommandHandle vcCommand);
Exemplo n.º 11
0
 internal static extern Interop.VoiceControlWidget.ErrorCode VcCmdListRemove(SafeCommandListHandle cmdList, SafeCommandHandle vcCommand);
Exemplo n.º 12
0
 internal VoiceCommand(SafeCommandHandle handle)
 {
     _handle = handle;
 }
Exemplo n.º 13
0
 internal static extern Interop.VoiceControl.ErrorCode VcCmdSetFormat(SafeCommandHandle vcCommand, CommandFormat format);
Exemplo n.º 14
0
 internal static extern Interop.VoiceControl.ErrorCode VcCmdSetType(SafeCommandHandle vcCommand, CommandType type);
Exemplo n.º 15
0
 internal static extern Interop.VoiceControl.ErrorCode VcCmdListAdd(SafeCommandListHandle cmdList, SafeCommandHandle vcCommand);
Exemplo n.º 16
0
 internal static extern Interop.VoiceControlManager.ErrorCode VcCmdGetCommand(SafeCommandHandle vcCommand, out string command);