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.
C#Copypublic class RemotePort : IDisposable
- Inheritance
-
System.ObjectRemotePort
- Implements
-
System.IDisposable
Constructors
Declaration
C#Copypublic RemotePort(string appId, string portName, bool trusted)
Parameters
Type | Name | Description |
---|---|---|
System.String | appId | The Id of the remote application |
System.String | portName | The name of the remote message port |
System.Boolean | trusted | If true is the trusted message port of application, otherwise false |
Examples
CopyRemotePort remotePort = new RemotePort("org.tizen.example.messageport", "SenderPort", false);
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when appId is null or empty, when portName is null or empty |
API Level: 4
Properties
Declaration
C#Copypublic string AppId { get; }
Property Value
Type | Description |
---|---|
System.String | Return appid of RemotePort |
API Level: 4
Declaration
C#Copypublic string PortName { get; }
Property Value
Type | Description |
---|---|
System.String | Return name of RemotePort |
API Level: 4
Declaration
C#Copypublic bool Trusted { get; }
Property Value
Type | Description |
---|---|
System.Boolean | Return true if RemotePort is trusted |
API Level: 4
Methods
Declaration
C#Copypublic void Dispose()
API Level: 4
Dispose(Boolean)
Releases the unmanaged resources used by the RemotePort class specifying whether to perform a normal dispose operation.
Declaration
C#Copyprotected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | true for a normal dispose operation; false to finalize the handle. |
API Level: 4
Declaration
C#Copyprotected void Finalize()
API Level: 4
Declaration
C#Copypublic bool IsRunning()
Returns
Type | Description |
---|---|
System.Boolean | Return true if Remote Port is running |
Examples
CopyRemote remotePort = new RemotePort("org.tizen.example", "SenderPort", true); bool isRunning = remotePort.isRunning();
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown when there is an I/O error |
OutOfMemoryException | Thrown when out of memory. |
API Level: 4
Events
Declaration
C#Copypublic event EventHandler<RemotePortStateChangedEventArgs> RemotePortStateChanged
Event Type
Type | Description |
---|---|
System.EventHandler<RemotePortStateChangedEventArgs> |
Examples
CopyRemote 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 |
---|---|
System.InvalidOperationException | Thrown when there is an I/O error |
OutOfMemoryException | Thrown when out of memory. |