Class RemotePort
Definition
- Namespace:
- Tizen.Applications.Messages
- Assembly:
- Tizen.Applications.MessagePort.dll
- API Level:
- 4
The RemotePort Class provides functions to get if the remote port is running and to get whether the remote port is registered or unregistered.
public class RemotePort : IDisposable
- Inheritance
-
RemotePort
- Implements
Constructors
View SourceRemotePort(String, String, Boolean)
Constructor of the RemotePort class.
Declaration
public RemotePort(string appId, string portName, bool trusted)
Parameters
Type | Name | Description |
---|---|---|
String | appId | The Id of the remote application |
String | portName | The name of the remote message port |
Boolean | trusted | If true is the trusted message port of application, otherwise false |
Examples
RemotePort remotePort = new RemotePort("org.tizen.example.messageport", "SenderPort", false);
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when appId is null or empty, when portName is null or empty |
API Level: 4
Properties
View SourceAppId
The AppId of the remote port
Declaration
public string AppId { get; }
Property Value
Type | Description |
---|---|
String | Return appid of RemotePort |
API Level: 4
View SourcePortName
The name of the remote message port
Declaration
public string PortName { get; }
Property Value
Type | Description |
---|---|
String | Return name of RemotePort |
API Level: 4
View SourceTrusted
If true the remote port is a trusted port, otherwise if false it is not
Declaration
public bool Trusted { get; }
Property Value
Type | Description |
---|---|
Boolean | Return true if RemotePort is trusted |
API Level: 4
Methods
View SourceDispose()
Releases all resources used by the RemotePort class.
Declaration
public void Dispose()
API Level: 4
View SourceDispose(Boolean)
Releases the unmanaged resources used by the RemotePort class specifying whether to perform a normal dispose operation.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing | true for a normal dispose operation; false to finalize the handle. |
API Level: 4
View SourceFinalize()
Destructor of the RemotePort class.
Declaration
protected void Finalize()
API Level: 4
View SourceIsRunning()
Check if the remote message port is running.
Declaration
public bool IsRunning()
Returns
Type | Description |
---|---|
Boolean | Return true if Remote Port is running |
Examples
Remote remotePort = new RemotePort("org.tizen.example", "SenderPort", true);
bool isRunning = remotePort.isRunning();
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when there is an I/O error |
OutOfMemoryException | Thrown when out of memory. |
API Level: 4
Events
View SourceRemotePortStateChanged
Called when the remote port is registered or unregistered.
Declaration
public event EventHandler<RemotePortStateChangedEventArgs> RemotePortStateChanged
Event Type
Type | Description |
---|---|
EventHandler<RemotePortStateChangedEventArgs> |
Examples
Remote remotePort = new RemotePort("org.tizen.example", "SenderPort", true);
remotePort.RemotePortStateChanged += RemotePortStateChangedCallback;
static void RemotePortStateChangedCallback(object sender, RemotePortStateChangedEventArgs e)
{
switch (e.Status)
{
case State.Registered :
Console.WriteLine("Remote Port Registered ");
break;
case State.Unregistered :
Console.WriteLine("Remote Port Unregistered ");
break;
default :
break;
}
}
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when there is an I/O error |
OutOfMemoryException | Thrown when out of memory. |