2222
2323namespace Hangfire . Dashboard
2424{
25+ /// <summary>
26+ /// Provides the routing mechanisms for the Dashboard UI. This class is used to register custom
27+ /// request dispatchers, allowing developers to write extensions for the Dashboard UI, such as
28+ /// custom pages, API endpoints or adding custom JavaScript or CSS files.
29+ /// </summary>
30+ /// <remarks>
31+ /// The <see cref="DashboardRoutes"/> class contains a collection of routes that the Dashboard UI uses to dispatch requests to handlers.
32+ /// Developers can use this class to add custom scripts, stylesheets, and register custom routes for extending the dashboard functionality.
33+ ///
34+ /// To add a custom route, use the <see cref="DashboardRoutes.Routes"/> property which is an instance of <see cref="RouteCollection"/>.
35+ /// </remarks>
36+ /// <seealso cref="RouteCollection"/>
37+ /// <seealso cref="IDashboardDispatcher"/>
2538 public static class DashboardRoutes
2639 {
2740 private static readonly List < Tuple < Assembly , string > > JavaScripts = new List < Tuple < Assembly , string > > ( ) ;
@@ -179,8 +192,22 @@ static DashboardRoutes()
179192 #endregion
180193 }
181194
195+ /// <summary>
196+ /// Gets the collection of routes for the Dashboard UI. Use this property to register
197+ /// custom request dispatchers.
198+ /// </summary>
182199 public static RouteCollection Routes { get ; }
183200
201+ /// <summary>
202+ /// Adds a stylesheet resource embedded into the given assembly to be included in the dashboard.
203+ /// </summary>
204+ /// <remarks>
205+ /// The specified resource should be an embedded resource file within the referenced assembly.
206+ /// You can discover embedded resource names by calling the <c>assembly.GetManifestResourceNames()</c> method.
207+ /// </remarks>
208+ /// <param name="assembly">The assembly containing the embedded stylesheet resource.</param>
209+ /// <param name="resource">The name of the stylesheet embedded resource.</param>
210+ /// <exception cref="ArgumentNullException">Thrown if <paramref name="assembly"/> or <paramref name="resource"/> is <c>null</c>.</exception>
184211 public static void AddStylesheet ( [ NotNull ] Assembly assembly , [ NotNull ] string resource )
185212 {
186213 if ( assembly == null ) throw new ArgumentNullException ( nameof ( assembly ) ) ;
@@ -193,6 +220,17 @@ public static void AddStylesheet([NotNull] Assembly assembly, [NotNull] string r
193220 }
194221 }
195222
223+ /// <summary>
224+ /// Adds a resource embedded into the given assembly that will only be included in the dashboard
225+ /// when the <see cref="DashboardOptions.DarkModeEnabled"/> is set to <c>true</c>.
226+ /// </summary>
227+ /// <remarks>
228+ /// The specified resource should be an embedded resource file within the referenced assembly.
229+ /// You can discover embedded resource names by calling the <c>assembly.GetManifestResourceNames()</c> method.
230+ /// </remarks>
231+ /// <param name="assembly">The assembly containing the dark-mode stylesheet embedded resource.</param>
232+ /// <param name="resource">The name of the dark-mode stylesheet embedded resource.</param>
233+ /// <exception cref="ArgumentNullException">Thrown if <paramref name="assembly"/> or <paramref name="resource"/> is <c>null</c>.</exception>
196234 public static void AddStylesheetDarkMode ( [ NotNull ] Assembly assembly , [ NotNull ] string resource )
197235 {
198236 if ( assembly == null ) throw new ArgumentNullException ( nameof ( assembly ) ) ;
@@ -205,6 +243,16 @@ public static void AddStylesheetDarkMode([NotNull] Assembly assembly, [NotNull]
205243 }
206244 }
207245
246+ /// <summary>
247+ /// Adds a JavaScript resource embedded into the given assembly to be included in the dashboard.
248+ /// </summary>
249+ /// <remarks>
250+ /// The specified resource should be an embedded resource file within the referenced assembly.
251+ /// You can discover embedded resource names by calling the <c>assembly.GetManifestResourceNames()</c> method.
252+ /// </remarks>
253+ /// <param name="assembly">The assembly containing the JavaScript embedded resource.</param>
254+ /// <param name="resource">The name of the JavaScript embedded resource.</param>
255+ /// <exception cref="ArgumentNullException">Thrown if <paramref name="assembly"/> or <paramref name="resource"/> is <c>null</c>.</exception>
208256 public static void AddJavaScript ( [ NotNull ] Assembly assembly , [ NotNull ] string resource )
209257 {
210258 if ( assembly == null ) throw new ArgumentNullException ( nameof ( assembly ) ) ;
0 commit comments