@@ -9,8 +9,10 @@ public abstract class CodeBehindModel
99 public bool IgnoreView = false ;
1010 public bool ? IgnoreLayout = null ;
1111 public string ? WebSocketId = null ;
12+ public string ? SSEId = null ;
13+ public bool ? UseSSE = null ;
1214 public HtmlData . NameValueCollection ViewData = new HtmlData . NameValueCollection ( ) ;
13- public ValueCollectionLock Section = new ValueCollectionLock ( ) ;
15+ public ValueCollectionLock Segment = new ValueCollectionLock ( ) ;
1416 public string DownloadFilePath { get ; private set ; } = "" ;
1517 /// <summary>
1618 /// This Attribute Does Not Have A Value In The Constructor Method Of The Class, And Is Set Only After An Instance Of The Class Is Created.
@@ -133,5 +135,41 @@ public async void BroadcastForClientIdAsync(HttpContext context, string Message,
133135 {
134136 await CodeBehindMiddlewareExtensions . WebSocketsBroadcastAsync ( context , Message , "" , "" , ClientId , IgnoreThis ) ;
135137 }
138+
139+ public void SetSSEId ( string Id )
140+ {
141+ SSEId = Id ;
142+ }
143+
144+ public void EnableSSE ( )
145+ {
146+ UseSSE = true ;
147+ }
148+
149+ // SSE Broadcast
150+ public void BroadcastSSE ( HttpContext context , string Message , bool IgnoreThis = false )
151+ {
152+ CodeBehindMiddlewareExtensions . SSEsBroadcast ( context , Message , "" , "" , "" , IgnoreThis ) ;
153+ }
154+
155+ public void BroadcastSSE ( HttpContext context , string Message , string RoleName , string Id , string ClientId , bool IgnoreThis = false )
156+ {
157+ CodeBehindMiddlewareExtensions . SSEsBroadcast ( context , Message , RoleName , Id , ClientId , IgnoreThis ) ;
158+ }
159+
160+ public void BroadcastSSEForRole ( HttpContext context , string Message , string RoleName , bool IgnoreThis = false )
161+ {
162+ CodeBehindMiddlewareExtensions . SSEsBroadcast ( context , Message , RoleName , "" , "" , IgnoreThis ) ;
163+ }
164+
165+ public void BroadcastSSEForSSEId ( HttpContext context , string Message , string Id , bool IgnoreThis = false )
166+ {
167+ CodeBehindMiddlewareExtensions . SSEsBroadcast ( context , Message , "" , Id , "" , IgnoreThis ) ;
168+ }
169+
170+ public void BroadcastSSEForClientId ( HttpContext context , string Message , string ClientId , bool IgnoreThis = false )
171+ {
172+ CodeBehindMiddlewareExtensions . SSEsBroadcast ( context , Message , "" , "" , ClientId , IgnoreThis ) ;
173+ }
136174 }
137175}
0 commit comments