add netcore and refactoring
This commit is contained in:
@@ -14,12 +14,10 @@ Contributors:
|
||||
Paolo Patierno - initial API and implementation and/or initial documentation
|
||||
*/
|
||||
|
||||
namespace uPLibrary.Networking.M2Mqtt.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Generic internal event for dispatching
|
||||
/// </summary>
|
||||
public abstract class InternalEvent
|
||||
{
|
||||
}
|
||||
namespace uPLibrary.Networking.M2Mqtt.Internal {
|
||||
/// <summary>
|
||||
/// Generic internal event for dispatching
|
||||
/// </summary>
|
||||
public abstract class InternalEvent {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,36 +16,26 @@ Contributors:
|
||||
|
||||
using uPLibrary.Networking.M2Mqtt.Messages;
|
||||
|
||||
namespace uPLibrary.Networking.M2Mqtt.Internal
|
||||
{
|
||||
namespace uPLibrary.Networking.M2Mqtt.Internal {
|
||||
/// <summary>
|
||||
/// Internal event with a message
|
||||
/// </summary>
|
||||
public class MsgInternalEvent : InternalEvent {
|
||||
#region Properties ...
|
||||
|
||||
/// <summary>
|
||||
/// Internal event with a message
|
||||
/// Related message
|
||||
/// </summary>
|
||||
public class MsgInternalEvent : InternalEvent
|
||||
{
|
||||
#region Properties ...
|
||||
|
||||
/// <summary>
|
||||
/// Related message
|
||||
/// </summary>
|
||||
public MqttMsgBase Message
|
||||
{
|
||||
get { return this.msg; }
|
||||
set { this.msg = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// related message
|
||||
protected MqttMsgBase msg;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="msg">Related message</param>
|
||||
public MsgInternalEvent(MqttMsgBase msg)
|
||||
{
|
||||
this.msg = msg;
|
||||
}
|
||||
}
|
||||
public MqttMsgBase Message { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
// related message
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="msg">Related message</param>
|
||||
public MsgInternalEvent(MqttMsgBase msg) => this.Message = msg;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,40 +14,31 @@ Contributors:
|
||||
Paolo Patierno - initial API and implementation and/or initial documentation
|
||||
*/
|
||||
|
||||
using System;
|
||||
using uPLibrary.Networking.M2Mqtt.Messages;
|
||||
|
||||
namespace uPLibrary.Networking.M2Mqtt.Internal
|
||||
{
|
||||
namespace uPLibrary.Networking.M2Mqtt.Internal {
|
||||
/// <summary>
|
||||
/// Internal event for a published message
|
||||
/// </summary>
|
||||
public class MsgPublishedInternalEvent : MsgInternalEvent {
|
||||
#region Properties...
|
||||
|
||||
/// <summary>
|
||||
/// Internal event for a published message
|
||||
/// Message published (or failed due to retries)
|
||||
/// </summary>
|
||||
public class MsgPublishedInternalEvent : MsgInternalEvent
|
||||
{
|
||||
#region Properties...
|
||||
|
||||
/// <summary>
|
||||
/// Message published (or failed due to retries)
|
||||
/// </summary>
|
||||
public bool IsPublished
|
||||
{
|
||||
get { return this.isPublished; }
|
||||
internal set { this.isPublished = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// published flag
|
||||
bool isPublished;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="msg">Message published</param>
|
||||
/// <param name="isPublished">Publish flag</param>
|
||||
public MsgPublishedInternalEvent(MqttMsgBase msg, bool isPublished)
|
||||
: base(msg)
|
||||
{
|
||||
this.isPublished = isPublished;
|
||||
}
|
||||
}
|
||||
public Boolean IsPublished { get; internal set; }
|
||||
|
||||
#endregion
|
||||
|
||||
// published flag
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="msg">Message published</param>
|
||||
/// <param name="isPublished">Publish flag</param>
|
||||
public MsgPublishedInternalEvent(MqttMsgBase msg, Boolean isPublished)
|
||||
: base(msg) => this.IsPublished = isPublished;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user