28 lines
847 B
C#
28 lines
847 B
C#
namespace OMNIPruefung
|
|
{
|
|
using System;
|
|
using System.IO;
|
|
using System.Windows;
|
|
using System.Windows.Threading;
|
|
|
|
public partial class App : Application
|
|
{
|
|
public static readonly string ExePath = typeof(App).Assembly.Location;
|
|
public static readonly string Path = new FileInfo(ExePath).DirectoryName;
|
|
|
|
public static event Action Disposed;
|
|
|
|
public static void Invoke(Action action)
|
|
=> Current.Dispatcher.Invoke(action, DispatcherPriority.ApplicationIdle);
|
|
|
|
public static void BeginInvoke(Action action)
|
|
=> Current.Dispatcher.BeginInvoke(action, DispatcherPriority.ApplicationIdle);
|
|
|
|
public static void NotifyDisposed()
|
|
=> Disposed?.Invoke();
|
|
|
|
protected override void OnExit(ExitEventArgs _)
|
|
=> NotifyDisposed();
|
|
}
|
|
}
|