DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Classes | Static Public Member Functions | List of all members
Deveel.Data.Diagnostics.ContextExtensions Class Reference

Classes

class  DelegateRouter
 

Static Public Member Functions

static void RegisterEvent (this IContext context, IEvent @event)
 
static void AttachRouter (this IContext context, IEventRouter router)
 
static void Route< TEvent > (this IContext context, Action< TEvent > router)
 
static void Route< TEvent > (this IContext context, Action< TEvent > router, Func< TEvent, bool > condition)
 

Detailed Description

Definition at line 20 of file ContextExtensions.cs.

Member Function Documentation

static void Deveel.Data.Diagnostics.ContextExtensions.AttachRouter ( this IContext  context,
IEventRouter  router 
)
inlinestatic

Definition at line 33 of file ContextExtensions.cs.

33  {
34  var currentContext = context;
35  while (currentContext != null) {
36  if (currentContext is IEventScope) {
37  currentContext.RegisterInstance(router);
38  break;
39  }
40 
41  currentContext = currentContext.Parent;
42  }
43  }
static void Deveel.Data.Diagnostics.ContextExtensions.RegisterEvent ( this IContext  context,
IEvent event 
)
inlinestatic

Definition at line 21 of file ContextExtensions.cs.

21  {
22  var currentContext = context;
23  while (currentContext != null) {
24  if (currentContext is IEventScope) {
25  var scope = (IEventScope) currentContext;
26  scope.EventRegistry.RegisterEvent(@event);
27  }
28 
29  currentContext = currentContext.Parent;
30  }
31  }
static void Deveel.Data.Diagnostics.ContextExtensions.Route< TEvent > ( this IContext  context,
Action< TEvent >  router 
)
inlinestatic
Type Constraints
TEvent :class 
TEvent :IEvent 

Definition at line 45 of file ContextExtensions.cs.

46  : class, IEvent {
47  context.Route(router, null);
48  }
static void Deveel.Data.Diagnostics.ContextExtensions.Route< TEvent > ( this IContext  context,
Action< TEvent >  router,
Func< TEvent, bool >  condition 
)
inlinestatic
Type Constraints
TEvent :class 
TEvent :IEvent 

Definition at line 50 of file ContextExtensions.cs.

51  : class, IEvent {
52  context.AttachRouter(new DelegateRouter<TEvent>(router, condition));
53  }

The documentation for this class was generated from the following file: