Setting since_tizen 3/4 on Tizen.NET API
[platform/core/csapi/tizenfx.git] / src / Tizen.System.Usb / Usb / UsbDeviceStrings.cs
1 /*
2  * Copyright (c) 2016 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
19 namespace Tizen.System.Usb
20 {
21     /// <summary>
22     /// String information for USB device.
23     /// </summary>
24     /// <since_tizen> 4 </since_tizen>
25     public class UsbDeviceStrings
26     {
27         private readonly UsbDevice _device;
28         private string _language;
29
30         internal UsbDeviceStrings(UsbDevice device, string language)
31         {
32             _device = device;
33             _language = language;
34         }
35
36         /// <summary>
37         /// Gets string describing device manufacturer.
38         /// </summary>
39         /// <exception cref="InvalidOperationException">Throws exception if device is disconnected or not opened for operation.</exception>
40         /// <exception cref="UnauthorizedAccessException">Throws exception if user has insufficient permission on device.</exception>
41         /// <since_tizen> 4 </since_tizen>
42         public string Manufacturer
43         {
44             get
45             {
46                 _device.ThrowIfDisposed();
47                 return Interop.DescriptorString(_device._handle.GetManufacturerStr, _language);
48             }
49         }
50
51         /// <summary>
52         /// Gets product string of device
53         /// </summary>
54         /// <exception cref="InvalidOperationException">Throws exception if device is not opened for operation.</exception>
55         /// <exception cref="UnauthorizedAccessException">Throws exception if user has insufficient permission on device.</exception>
56         /// <since_tizen> 4 </since_tizen>
57         public string Product
58         {
59             get
60             {
61                 _device.ThrowIfDisposed();
62                 return Interop.DescriptorString(_device._handle.GetProductStr, _language);
63             }
64         }
65
66         /// <summary>
67         /// Gets serial number of a device.
68         /// </summary>
69         /// <exception cref="InvalidOperationException">Throws exception if device is not opened for operation.</exception>
70         /// <exception cref="UnauthorizedAccessException">Throws exception if user has insufficient permission on device.</exception>
71         /// <since_tizen> 4 </since_tizen>
72         public string Serial
73         {
74             get
75             {
76                 _device.ThrowIfDisposed();
77                 return Interop.DescriptorString(_device._handle.GetSerialNumberStr, _language);
78             }
79         }
80     }
81 }