Exemplo n.º 1
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;
        }