Class ConnectionManager
Definition
- Namespace:
- Tizen.Network.Connection
- Assembly:
- Tizen.Network.Connection.dll
- API Level:
- 3
This is the ConnectionManager class. It provides functions to manage data connections.
C#Copypublic static class ConnectionManager
- Inheritance
-
System.ObjectConnectionManager
Properties
Declaration
C#Copypublic static ConnectionState BluetoothState { get; }
Property Value
Type | Description |
---|---|
ConnectionState | Bluetooth connection state. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
UnauthorizedAccessException | Thrown when a permission is denied. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.tethering.bluetooth
Declaration
C#Copypublic static CellularState CellularState { get; }
Property Value
Type | Description |
---|---|
CellularState | Cellular network state. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
API Level: 3
Feature: http://tizen.org/feature/network.telephony
Declaration
C#Copypublic static ConnectionItem CurrentConnection { get; }
Property Value
Type | Description |
---|---|
ConnectionItem | Instance of ConnectionItem. |
API Level: 3
Declaration
C#Copypublic static EthernetCableState EthernetCableState { get; }
Property Value
Type | Description |
---|---|
EthernetCableState | Ethernet cable state. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
UnauthorizedAccessException | Thrown when a permission is denied. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.ethernet
Declaration
C#Copypublic static ConnectionState EthernetState { get; }
Property Value
Type | Description |
---|---|
ConnectionState | Ethernet connection state. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
UnauthorizedAccessException | Thrown when a permission is denied. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.ethernet
Declaration
C#Copypublic static ConnectionState WiFiState { get; }
Property Value
Type | Description |
---|---|
ConnectionState | WiFi connection state. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
UnauthorizedAccessException | Thrown when a permission is denied. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.wifi
Methods
AddRoute(AddressFamily, String, IPAddress, IPAddress)
Adds a route to the routing table.
Declaration
C#Copypublic static void AddRoute(AddressFamily family, string interfaceName, IPAddress hostAddress, IPAddress gateway)
Parameters
Type | Name | Description |
---|---|---|
AddressFamily | family | The address family. |
System.String | interfaceName | The name of the network interface. |
System.Net.IPAddress | hostAddress | The IP address of the host. |
System.Net.IPAddress | gateway | The gateway address. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
UnauthorizedAccessException | Thrown when a permission is denied. |
System.ArgumentException | Thrown when a value is an invalid parameter. |
System.ArgumentNullException | Thrown when an interfaceName or a hostAddress or a gateway is null. |
OutOfMemoryException | Thrown when memory is not enough to continue execution. |
System.InvalidOperationException | Thrown when a connection instance is invalid or when a method fails due to an invalid operation. |
API Level: 3
Declaration
C#Copypublic static CellularProfile CreateCellularProfile(ConnectionProfileType type, string keyword)
Parameters
Type | Name | Description |
---|---|---|
ConnectionProfileType | type | The type of profile. Cellular profile type is supported. |
System.String | keyword | The keyword included in profile name. |
Returns
Type | Description |
---|---|
CellularProfile | CellularProfile object. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
UnauthorizedAccessException | Thrown when a permission is denied. |
System.ArgumentException | Thrown when a value is an invalid parameter. |
System.ArgumentNullException | Thrown when a keyword value is null. |
System.InvalidOperationException | Thrown when a method fails due to invalid operation. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.telephonyhttp://tizen.org/feature/network.wifi
GetAllIPv6Addresses(ConnectionType)
Gets all the IPv6 addresses of the current connection.
Declaration
C#Copypublic static IEnumerable<IPAddress> GetAllIPv6Addresses(ConnectionType type)
Parameters
Type | Name | Description |
---|---|---|
ConnectionType | type | The type of current network connection. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Net.IPAddress> | A list of IPv6 addresses of the connection. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
UnauthorizedAccessException | Thrown when a permission is denied. |
System.ArgumentException | Thrown when a value is an invalid parameter. |
OutOfMemoryException | Thrown when memory is not enough to continue execution. |
System.InvalidOperationException | Thrown when a connection instance is invalid or when a method fails due to an invalid operation. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.ethernethttp://tizen.org/feature/network.telephonyhttp://tizen.org/feature/network.tethering.bluetoothhttp://tizen.org/feature/network.wifi
Declaration
C#Copypublic static IPAddress GetIPAddress(AddressFamily family)
Parameters
Type | Name | Description |
---|---|---|
AddressFamily | family | The address family. |
Returns
Type | Description |
---|---|
System.Net.IPAddress | IP address of the connection (global address in case of IPv6). |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
UnauthorizedAccessException | Thrown when a permission is denied. |
System.ArgumentException | Thrown when a value is an invalid parameter. |
OutOfMemoryException | Thrown when memory is not enough to continue execution. |
System.InvalidOperationException | Thrown when a connection instance is invalid or when a method fails due to an invalid operation. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.ethernethttp://tizen.org/feature/network.telephonyhttp://tizen.org/feature/network.tethering.bluetoothhttp://tizen.org/feature/network.wifi
Declaration
C#Copypublic static string GetMacAddress(ConnectionType type)
Parameters
Type | Name | Description |
---|---|---|
ConnectionType | type | The type of current network connection. |
Returns
Type | Description |
---|---|
System.String | MAC address of the Wi-Fi or ethernet. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
UnauthorizedAccessException | Thrown when a permission is denied. |
System.ArgumentException | Thrown when value is an invalid parameter. |
OutOfMemoryException | Thrown when memory is not enough to continue execution. |
System.InvalidOperationException | Thrown when a connection instance is invalid or when a method fails due to an invalid operation. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.ethernethttp://tizen.org/feature/network.telephonyhttp://tizen.org/feature/network.tethering.bluetoothhttp://tizen.org/feature/network.wifi
Declaration
C#Copypublic static string GetProxy(AddressFamily family)
Parameters
Type | Name | Description |
---|---|---|
AddressFamily | family | The address family. |
Returns
Type | Description |
---|---|
System.String | Proxy address of the connection. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
UnauthorizedAccessException | Thrown when a permission is denied. |
System.ArgumentException | Thrown when a value is an invalid parameter. |
OutOfMemoryException | Thrown when memory is not enough to continue execution. |
System.InvalidOperationException | Thrown when a connection instance is invalid or when a method fails due to an invalid operation. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.ethernethttp://tizen.org/feature/network.telephonyhttp://tizen.org/feature/network.tethering.bluetoothhttp://tizen.org/feature/network.wifi
Declaration
C#Copypublic static long GetStatistics(ConnectionType connectionType, StatisticsType statisticsType)
Parameters
Type | Name | Description |
---|---|---|
ConnectionType | connectionType | The type of connection (only WiFi and Cellular are supported). |
StatisticsType | statisticsType | The type of statistics. |
Returns
Type | Description |
---|---|
System.Int64 | The statistics information associated with statisticsType. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
UnauthorizedAccessException | Thrown when a permission is denied. |
System.ArgumentException | Thrown when value is an invalid parameter. |
OutOfMemoryException | Thrown when memory is not enough to continue execution. |
System.InvalidOperationException | Thrown when a connection instance is invalid or when a method fails due to invalid operation. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.ethernethttp://tizen.org/feature/network.telephonyhttp://tizen.org/feature/network.tethering.bluetoothhttp://tizen.org/feature/network.wifi
RemoveRoute(AddressFamily, String, IPAddress, IPAddress)
Removes a route from the routing table.
Declaration
C#Copypublic static void RemoveRoute(AddressFamily family, string interfaceName, IPAddress hostAddress, IPAddress gateway)
Parameters
Type | Name | Description |
---|---|---|
AddressFamily | family | The address family. |
System.String | interfaceName | The name of network interface. |
System.Net.IPAddress | hostAddress | The IP address of the host. |
System.Net.IPAddress | gateway | The gateway address. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
UnauthorizedAccessException | Thrown when a permission is denied. |
System.ArgumentException | Thrown when a value is an invalid parameter. |
System.ArgumentNullException | Thrown when an interfaceName or a hostAddress or a gateway is null. |
OutOfMemoryException | Thrown when memory is not enough to continue execution. |
System.InvalidOperationException | Thrown when a connection instance is invalid or when a method fails due to an invalid operation. |
API Level: 3
Declaration
C#Copypublic static void ResetStatistics(ConnectionType connectionType, StatisticsType statisticsType)
Parameters
Type | Name | Description |
---|---|---|
ConnectionType | connectionType | The type of connection (only WiFi and Cellular are supported). |
StatisticsType | statisticsType | The type of statistics. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
UnauthorizedAccessException | Thrown when a permission is denied. |
System.ArgumentException | Thrown when a value is an invalid parameter. |
OutOfMemoryException | Thrown when memory is not enough to continue execution. |
System.InvalidOperationException | Thrown when a connection instance is invalid or when a method fails due to an invalid operation. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.gethttp://tizen.org/privilege/network.set
Feature: http://tizen.org/feature/network.ethernethttp://tizen.org/feature/network.telephonyhttp://tizen.org/feature/network.tethering.bluetoothhttp://tizen.org/feature/network.wifi
Events
ConnectionTypeChanged
An event is called when the type of the current connection is changed.
Declaration
C#Copypublic static event EventHandler<ConnectionTypeEventArgs> ConnectionTypeChanged
Event Type
Type | Description |
---|---|
System.EventHandler<ConnectionTypeEventArgs> |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
UnauthorizedAccessException | Thrown when a permission is denied. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.ethernethttp://tizen.org/feature/network.telephonyhttp://tizen.org/feature/network.tethering.bluetoothhttp://tizen.org/feature/network.wifi
Declaration
C#Copypublic static event EventHandler<EthernetCableStateEventArgs> EthernetCableStateChanged
Event Type
Type | Description |
---|---|
System.EventHandler<EthernetCableStateEventArgs> |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
UnauthorizedAccessException | Thrown when a permission is denied. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.ethernet
Declaration
C#Copypublic static event EventHandler<AddressEventArgs> IPAddressChanged
Event Type
Type | Description |
---|---|
System.EventHandler<AddressEventArgs> |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
UnauthorizedAccessException | Thrown when a permission is denied. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/network.get
Feature: http://tizen.org/feature/network.ethernethttp://tizen.org/feature/network.telephonyhttp://tizen.org/feature/network.tethering.bluetoothhttp://tizen.org/feature/network.wifi
Declaration
C#Copypublic static event EventHandler<AddressEventArgs> ProxyAddressChanged
Event Type
Type | Description |
---|---|
System.EventHandler<AddressEventArgs> |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
UnauthorizedAccessException | Thrown when a permission is denied. |