diff --git a/MP.MONO.Data/MessagePipe.cs b/MP.MONO.Data/MessagePipe.cs
index d859fb0..09a404d 100644
--- a/MP.MONO.Data/MessagePipe.cs
+++ b/MP.MONO.Data/MessagePipe.cs
@@ -1,24 +1,16 @@
-using Microsoft.Extensions.Configuration;
-using StackExchange.Redis;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using StackExchange.Redis;
namespace MP.MONO.Data
{
public class MessagePipe
{
+ #region Private Fields
private IConnectionMultiplexer redis;
- ///
- /// Canale associato al gestore pipeline messaggi
- ///
- private string _channel { get; set; } = "";
+ #endregion Private Fields
- public event EventHandler EA_NewMessage = delegate { };
+ #region Public Constructors
public MessagePipe(IConnectionMultiplexer redisConn, string channelName)
{
@@ -28,6 +20,25 @@ namespace MP.MONO.Data
setupSubscriber();
}
+ #endregion Public Constructors
+
+ #region Public Events
+
+ public event EventHandler EA_NewMessage = delegate { };
+
+ #endregion Public Events
+
+ #region Private Properties
+
+ ///
+ /// Canale associato al gestore pipeline messaggi
+ ///
+ private string _channel { get; set; } = "";
+
+ #endregion Private Properties
+
+ #region Private Methods
+
private void setupSubscriber()
{
ISubscriber sub = redis.GetSubscriber();
@@ -47,6 +58,10 @@ namespace MP.MONO.Data
//Console.ReadKey();
}
+ #endregion Private Methods
+
+ #region Public Methods
+
///
/// Invio messaggio sul canale
///
@@ -60,15 +75,25 @@ namespace MP.MONO.Data
sub.Publish(_channel, newMess);
return answ;
}
+
+ #endregion Public Methods
}
public class PubSubEventArgs : EventArgs
{
- public string newMessage { get; set; } = "";
+ #region Public Constructors
public PubSubEventArgs(string messaggio)
{
this.newMessage = messaggio;
}
+
+ #endregion Public Constructors
+
+ #region Public Properties
+
+ public string newMessage { get; set; } = "";
+
+ #endregion Public Properties
}
-}
+}
\ No newline at end of file