using Microsoft.Practices.Prism.Events; using Microsoft.Practices.Prism.PubSubEvents; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace GummingCommon { public class NotifyEventParameter { public CallbackType NotifyType { get; set; } public object NotifyContent { get; set; } } public class NotifyChangedEvent : CompositePresentationEvent { } public class CaptureEventParameter { public CaptureType NotifyType { get; set; } public object NotifyContent { get; set; } } public class CaptureChangedEvent : CompositePresentationEvent { } public class AppEventAggregator { private static EventAggregator appEventAggregator = null; private static readonly object syncLock = new object(); private AppEventAggregator() { } public static EventAggregator GetEventAggregator() { lock (syncLock) { if (appEventAggregator == null) { appEventAggregator = new EventAggregator(); } return appEventAggregator; } } public static void SendMessage(CallbackType calltype, object content) { AppEventAggregator.GetEventAggregator().GetEvent().Publish(new NotifyEventParameter() { NotifyType = calltype, NotifyContent = content }); } } public class KeyEventParameter { public KeyType KeyType { get; set; } public FromType FromType { get; set; } public object KeyContent { get; set; } } public class KeyChangedEvent : CompositePresentationEvent { } public class FormulaChangedEvent : CompositePresentationEvent { } public class EtherCATChangedEvent : CompositePresentationEvent { } public class RobotChangedEvent : CompositePresentationEvent { } }