2using System.Threading.Tasks;
10 internal class ScheduledEvent
12 private readonly DateTime when;
13 private readonly Action<object> eventMethod;
14 private readonly
object state;
22 public ScheduledEvent(DateTime When, Action<object> EventMethod,
object State)
25 this.eventMethod = EventMethod;
35 public ScheduledEvent(DateTime When, Func<object, Task> EventMethod,
object State)
38 this.eventMethod = this.AsyncCallback;
39 this.state =
new object[] { EventMethod, State };
42 private async
void AsyncCallback(
object State)
46 object[] P = (
object[])State;
47 Func<object, Task> Callback = (Func<object, Task>)P[0];
50 if (!(Callback is
null))
51 await Callback(State);
62 public DateTime When => this.when;
67 public Action<object> EventMethod => this.eventMethod;
72 public object State => this.state;
79 if (!(this.eventMethod is
null))
83 this.eventMethod(this.state);
Static class managing the application event log. Applications and services log events on this static ...
static void Exception(Exception Exception, string Object, string Actor, string EventId, EventLevel Level, string Facility, string Module, params KeyValuePair< string, object >[] Tags)
Logs an exception. Event type will be determined by the severity of the exception.