Release 8.0.0.15812
[platform/core/csapi/tizenfx.git] / src / Tizen.Multimedia.Remoting / MediaController / CommandCompletedEventArgs.cs
1 /*
2  * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 using System;
18 using Tizen.Applications;
19
20 namespace Tizen.Multimedia.Remoting
21 {
22     /// <summary>
23     /// Provides data for the <see cref="MediaController.CommandCompleted"/> or
24     /// <see cref="MediaControlServer.CommandCompleted"/>event.
25     /// </summary>
26     /// <since_tizen> 5 </since_tizen>
27     internal class CommandCompletedEventArgs : EventArgs
28     {
29         /// <summary>
30         /// Initializes a new instance of the <see cref="CommandCompletedEventArgs"/> class.
31         /// </summary>
32         /// <param name="requestId">The request id for each command.</param>
33         /// <param name="result">The result of commands.</param>
34         /// <exception cref="ArgumentException"><paramref name="result"/> is not vailid.</exception>
35         /// <exception cref="ArgumentNullException"><paramref name="requestId"/> is null.</exception>
36         /// <since_tizen> 5 </since_tizen>
37         internal CommandCompletedEventArgs(string requestId, int result)
38         {
39             RequestId = requestId ?? throw new ArgumentNullException(nameof(requestId));
40             Result = result;
41         }
42
43         /// <summary>
44         /// Initializes a new instance of the <see cref="CommandCompletedEventArgs"/> class with extra data.
45         /// </summary>
46         /// <param name="requestId">The request id for each command.</param>
47         /// <param name="result">The result of commands.</param>
48         /// <param name="bundle">The extra data.</param>
49         /// <since_tizen> 5 </since_tizen>
50         internal CommandCompletedEventArgs(string requestId, int result, Bundle bundle)
51             : this(requestId, result)
52         {
53             Bundle = bundle;
54         }
55
56         /// <summary>
57         /// Gets the request Id.
58         /// </summary>
59         /// <since_tizen> 5 </since_tizen>
60         internal string RequestId { get; }
61
62         /// <summary>
63         /// Gets the result code for matched commands.
64         /// </summary>
65         /// <since_tizen> 5 </since_tizen>
66         internal int Result { get; }
67
68         /// <summary>
69         /// Gets the extra data.
70         /// </summary>
71         /// <since_tizen> 5 </since_tizen>
72         internal Bundle Bundle { get; }
73     }
74 }