using System;
using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Threading.Tasks;
-using Tizen.Internals;
namespace Tizen.Applications.Messages
{
private static readonly object s_lock = new object();
private static readonly HashSet<string> s_portMap = new HashSet<string>();
+ // The name of the local message port
+ private readonly string _portName = null;
+
+ // If true the message port is a trusted port, otherwise false it is not
+ private readonly bool _trusted = false;
+
+ // The local message port ID
+ private int _portId = 0;
+
+ // If true the message port is listening, otherwise false it is not
+ private bool _listening = false;
+
+ private Interop.MessagePort.message_port_message_cb _messageCallBack;
+
/// <summary>
/// Initializes the instance of the MessagePort class.
/// </summary>
}
}
- /// <summary>
- /// The local message port ID
- /// </summary>
- private int _portId = 0;
-
- /// <summary>
- /// The name of the local message port
- /// </summary>
- private readonly string _portName = null;
-
- /// <summary>
- /// If true the message port is a trusted port, otherwise false it is not
- /// </summary>
- private readonly bool _trusted = false;
-
- /// <summary>
- /// If true the message port is listening, otherwise false it is not
- /// </summary>
- private bool _listening = false;
-
- private Interop.MessagePort.message_port_message_cb _messageCallBack;
-
/// <summary>
/// Register the local message port.
/// </summary>
Trusted = trusted
};
}
- RaiseMessageReceivedEvent(MessageReceived, args);
+ MessageReceived?.Invoke(this, args);
};
_portId = _trusted ?
}
}
- private void RaiseMessageReceivedEvent(EventHandler<MessageReceivedEventArgs> evt, MessageReceivedEventArgs args)
- {
- if (evt != null)
- {
- evt(this, args);
- }
- }
-
/// <summary>
/// Releases the unmanaged resourced used by the MessagePort class specifying whether to perform a normal dispose operation.
/// </summary>
}
catch (Exception e)
{
- Tizen.Log.Warn(GetType().Namespace, "Exception in Dispose :" + e.Message);
+ Log.Warn(GetType().Namespace, "Exception in Dispose :" + e.Message);
}
}
}
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using Tizen.Internals.Errors;
namespace Tizen.Applications.Messages
MaxExceeded = -0x01130000 | 0x03,
ResourceUnavailable = -0x01130000 | 0x04
}
+
internal static class MessagePortErrorFactory
{
internal static void ThrowException(int errorCode, string errorMessage = null, string paramName = null)
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace Tizen.Applications.Messages
{
/// <summary>
/// Contains AppId, Port Name, Trusted
/// </summary>
- public RemoteValues Remote
- {
- get;
- internal set;
- }
+ public RemoteValues Remote { get; internal set; }
/// <summary>
/// The message passed from the remote application
/// </summary>
- public Bundle Message
- {
- get;
- internal set;
- }
+ public Bundle Message { get; internal set; }
}
}
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
namespace Tizen.Applications.Messages
{
/// <summary>
/// <summary>
/// The ID of the remote application that sent this message
/// </summary>
- public string AppId
- {
- get; set;
- }
+ public string AppId { get; set; }
+
/// <summary>
/// The name of the remote message port
/// </summary>
- public string PortName
- {
- get;
- set;
- }
+ public string PortName { get; set; }
+
/// <summary>
/// If true the remote port is a trusted port, otherwise if false it is not
/// </summary>
- public bool Trusted
- {
- get;
- set;
- }
+ public bool Trusted { get; set; }
}
}