/// <summary> /// Initializes the (Mechanical4) app. /// </summary> /// <param name="eventQueue">The <see cref="EventQueueBase"/> to wrap.</param> protected static new void Initialize(EventQueueBase eventQueue) { AppBase.Initialize(eventQueue); InitializeUnhandledExceptionCatching(); InitializeSystemEvents(); }
/// <summary> /// Initializes the (Mechanical4) app. /// </summary> /// <param name="eventQueue">The <see cref="EventQueueBase"/> to wrap.</param> protected static void Initialize(EventQueueBase eventQueue) { var wrapper = new MainEventQueue(eventQueue); // tests the argument implicitly isInitialized.SetIfEquals(newValue: true, comparand: false, out bool oldValue); if (oldValue) { throw new InvalidOperationException("The (Mechanical4) app may only be initialized once!"); } mainEventQueue = wrapper; InitializeUnhandledExceptionCatching(); }
internal MainEventQueue(EventQueueBase eventQueue) { if (eventQueue.NullReference()) { throw Exc.Null(nameof(eventQueue)); } if (eventQueue.IsShutDown) { throw new ArgumentException("Event queue specified may not be shut down!"); } this.regularEventQueue = eventQueue; this.regularEventQueue.Subscribers.Add <ShuttingDownEvent>(this, weakRef: false); this.currentAppState = new ThreadSafeEnum <AppState>(AppState.Shutdown); }
/// <summary> /// Initializes the (Mechanical4) app. /// </summary> /// <param name="eventQueue">The <see cref="EventQueueBase"/> to wrap, or <c>null</c> for a new <see cref="TaskEventQueue"/>.</param> public static new void Initialize(EventQueueBase eventQueue = null) { WindowsAppBase.Initialize(eventQueue ?? new TaskEventQueue()); }
internal static new void Initialize(EventQueueBase eventQueue) { AppBase.Initialize(eventQueue); }