Fix handle leak issue
[platform/core/csapi/uix-voice-control.git] / Tizen.Uix.VoiceControl / Tizen.Uix.VoiceControl / VoiceCommandList.cs
index bb1da4f..c8bae3c 100755 (executable)
@@ -33,16 +33,23 @@ namespace Tizen.Uix.VoiceControl
         /// <summary>
         /// Public Constructor
         /// </summary>
-        /// <exception cref="InvalidOperationException">
-        /// This Exception can be due to the following reaons
-        /// 1. Invalid parameter
-        /// 2. Permission Denied
-        /// 3. Not supported
-        /// 4. Out of memory
-        /// </exception>
+        /// <privilege>
+        /// http://tizen.org/privilege/recorder
+        /// </privilege>
+        /// <privlevel>
+        /// public
+        /// </privlevel>
+        /// <feature>
+        /// http://tizen.org/feature/speech.control
+        /// http://tizen.org/feature/microphone
+        /// </feature>
+        /// <exception cref="OutOfMemoryException"> This Exception can be due to Out of memory. </exception>
+        /// <exception cref="ArgumentException"> This Exception can be due to Invalid Parameter. </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 VoiceCommandList()
         {
-            SafeCommandListHandle handle = new SafeCommandListHandle();
+            SafeCommandListHandle handle;
             ErrorCode error = VcCmdListCreate(out handle);
             if (error != ErrorCode.None)
             {
@@ -61,7 +68,16 @@ namespace Tizen.Uix.VoiceControl
         /// Gets command count of list.
         /// -1 is returned in case of internal failure.
         /// </summary>
-        public int GetCount
+        /// <value>
+        /// Command counts of the list.
+        /// </value>
+        /// <privilege>
+        /// http://tizen.org/privilege/recorder
+        /// </privilege>
+        /// <privlevel>
+        /// public
+        /// </privlevel>
+        public int Count
         {
             get
             {
@@ -81,7 +97,16 @@ namespace Tizen.Uix.VoiceControl
         /// Get current command from command list by index.
         /// null will be returned in case of Empty List
         /// </summary>
-        public VoiceCommand GetCurrent
+        /// <value>
+        /// Current command from the command list.
+        /// </value>
+        /// <privilege>
+        /// http://tizen.org/privilege/recorder
+        /// </privilege>
+        /// <privlevel>
+        /// public
+        /// </privlevel>
+        public VoiceCommand Current
         {
             get
             {
@@ -100,14 +125,20 @@ namespace Tizen.Uix.VoiceControl
         /// <summary>
         /// Adds command to command list.
         /// </summary>
+        /// <privilege>
+        /// http://tizen.org/privilege/recorder
+        /// </privilege>
+        /// <privlevel>
+        /// public
+        /// </privlevel>
+        /// <feature>
+        /// http://tizen.org/feature/speech.control
+        /// http://tizen.org/feature/microphone
+        /// </feature>
         /// <param name="command">The command</param>
-        /// <exception cref="InvalidOperationException">
-        /// This Exception can be due to the following reaons
-        /// 1. Invalid parameter
-        /// 2. Permission Denied
-        /// 3. Not supported
-        /// </exception>
-        /// <exception cref="NullReferenceException">This will occur if the provide parameter is null</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>
+        /// <exception cref="NullReferenceException"> This will occur if the provide parameter is null. </exception>
         public void Add(VoiceCommand command)
         {
             ErrorCode error = VcCmdListAdd(_handle, command._handle);
@@ -121,14 +152,20 @@ namespace Tizen.Uix.VoiceControl
         /// <summary>
         /// Removes command from command list.
         /// </summary>
+        /// <privilege>
+        /// http://tizen.org/privilege/recorder
+        /// </privilege>
+        /// <privlevel>
+        /// public
+        /// </privlevel>
+        /// <feature>
+        /// http://tizen.org/feature/speech.control
+        /// http://tizen.org/feature/microphone
+        /// </feature>
         /// <param name="command">The command</param>
-        /// <exception cref="InvalidOperationException">
-        /// This Exception can be due to the following reaons
-        /// 1. Invalid parameter
-        /// 2. Permission Denied
-        /// 3. Not supported
-        /// </exception>
-        /// <exception cref="NullReferenceException">This will occur if the provide parameter is null</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>
+        /// <exception cref="NullReferenceException"> This will occur if the provide parameter is null. </exception>
         public void Remove(VoiceCommand command)
         {
             ErrorCode error = VcCmdListRemove(_handle, command._handle);
@@ -142,11 +179,18 @@ namespace Tizen.Uix.VoiceControl
         /// <summary>
         /// Retrieves all commands of command list.
         /// </summary>
-        /// <exception cref="InvalidOperationException">
-        /// This Exception can be due to the following reaons
-        /// 1. Permission Denied
-        /// 2. Not supported
-        /// </exception>
+        /// <privilege>
+        /// http://tizen.org/privilege/recorder
+        /// </privilege>
+        /// <privlevel>
+        /// public
+        /// </privlevel>
+        /// <feature>
+        /// http://tizen.org/feature/speech.control
+        /// http://tizen.org/feature/microphone
+        /// </feature>
+        /// <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 IEnumerable<VoiceCommand> GetAllCommands()
         {
             _list = new List<VoiceCommand>();
@@ -170,12 +214,19 @@ namespace Tizen.Uix.VoiceControl
         /// <summary>
         /// Moves index to first command.
         /// </summary>
-        /// <exception cref="InvalidOperationException">
-        /// This Exception can be due to the following reaons
-        /// 1. List Empty
-        /// 2. Permission Denied
-        /// 3. Not supported
-        /// </exception>
+        /// <privilege>
+        /// http://tizen.org/privilege/recorder
+        /// </privilege>
+        /// <privlevel>
+        /// public
+        /// </privlevel>
+        /// <feature>
+        /// http://tizen.org/feature/speech.control
+        /// http://tizen.org/feature/microphone
+        /// </feature>
+        /// <exception cref="InvalidOperationException"> This Exception can be due to List Empty. </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 void First()
         {
             ErrorCode error = VcCmdListFirst(_handle);
@@ -189,12 +240,19 @@ namespace Tizen.Uix.VoiceControl
         /// <summary>
         /// Moves index to last command.
         /// </summary>
-        /// <exception cref="InvalidOperationException">
-        /// This Exception can be due to the following reaons
-        /// 1. List Empty
-        /// 2. Permission Denied
-        /// 3. Not supported
-        /// </exception>
+        /// <privilege>
+        /// http://tizen.org/privilege/recorder
+        /// </privilege>
+        /// <privlevel>
+        /// public
+        /// </privlevel>
+        /// <feature>
+        /// http://tizen.org/feature/speech.control
+        /// http://tizen.org/feature/microphone
+        /// </feature>
+        /// <exception cref="InvalidOperationException"> This Exception can be due to List Empty. </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 void Last()
         {
             ErrorCode error = VcCmdListLast(_handle);
@@ -208,13 +266,23 @@ namespace Tizen.Uix.VoiceControl
         /// <summary>
         /// Moves index to next command.
         /// </summary>
+        /// <privilege>
+        /// http://tizen.org/privilege/recorder
+        /// </privilege>
+        /// <privlevel>
+        /// public
+        /// </privlevel>
+        /// <feature>
+        /// http://tizen.org/feature/speech.control
+        /// http://tizen.org/feature/microphone
+        /// </feature>
         /// <exception cref="InvalidOperationException">
         /// This Exception can be due to the following reaons
         /// 1. List Empty
         /// 2. List reached end
-        /// 3. Permission Denied
-        /// 4. Not supported
         /// </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 void Next()
         {
             ErrorCode error = VcCmdListNext(_handle);
@@ -228,13 +296,23 @@ namespace Tizen.Uix.VoiceControl
         /// <summary>
         /// Moves index to previous command.
         /// </summary>
+        /// <privilege>
+        /// http://tizen.org/privilege/recorder
+        /// </privilege>
+        /// <privlevel>
+        /// public
+        /// </privlevel>
+        /// <feature>
+        /// http://tizen.org/feature/speech.control
+        /// http://tizen.org/feature/microphone
+        /// </feature>
         /// <exception cref="InvalidOperationException">
         /// This Exception can be due to the following reaons
         /// 1. List Empty
         /// 2. List reached end
-        /// 3. Permission Denied
-        /// 4. Not supported
         /// </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 void Previous()
         {
             ErrorCode error = VcCmdListPrev(_handle);