Events, EventViewer, Common prjs, UI.EventLogs, UI.Calendar, EventTriggers, GetCalendarEvents() in WT/I.

This commit is contained in:
Milan Hanajik
2020-04-21 10:46:42 +02:00
parent 66631855bb
commit b1d692230e
161 changed files with 13377 additions and 933 deletions
+25 -13
View File
@@ -3,8 +3,10 @@
///
using System;
using System.Collections.Generic;
using Config.Entities;
using log4net;
using NHibernate;
using Config.Entities;
using Events.Entities;
namespace TBF.UiBridge
{
@@ -151,18 +153,6 @@ namespace TBF.UiBridge
public static event EventHandler<ProcedureCompletedEventArgs> ProcedureCompletedHandler;
/// <summary>
/// Called from the state machine when there is and information to be logged.
/// </summary>
public static void OnLog(object sender, string message)
{
if (LogHandler == null) return;
try { LogHandler(sender, new LogEventArgs(message)); }
catch (Exception e) { log.Error("LogHandler(...) failed", e); }
}
public static event EventHandler<LogEventArgs> LogHandler;
/// <summary>
/// Called from the state machine when 'Activity' information changes.
/// </summary>
@@ -266,5 +256,27 @@ namespace TBF.UiBridge
catch (Exception e) { log.Error("SaveSettingsHandler(...) failed", e); }
}
public static event EventHandler<SaveSettingsEventArgs> SaveSettingsHandler;
public static void TriggerEvent(ISession session, string source, EventClass clss, Severity severity, string message, string moreInfo, SubscriberGroup groups)
{
Events.Entities.Event evnt = new Event(null, source, clss, severity, message, moreInfo, null);
Events.DB.SaveEvent(session, evnt, groups);
if (EventHandler != null)
{
try { EventHandler(null, new EventEventArgs(evnt)); }
catch (Exception e) { log.Error("EventHandler(...) failed", e); }
}
}
public static void TriggerEvent(ISession session, Events.Entities.Event evnt)
{
Events.DB.SaveEvent(session, evnt, evnt.SubscriberGroups);
if (EventHandler != null)
{
try { EventHandler(null, new EventEventArgs(evnt)); }
catch (Exception e) { log.Error("EventHandler(...) failed", e); }
}
}
public static event EventHandler<EventEventArgs> EventHandler;
}
}