public static FirLibApplicationLoader AddConfigurationFileService( this FirLibApplicationLoader loader, string appName) { loader.Services.Register( typeof(IConfigurationFileAccessors), new ConfigurationFileAccessors(appName)); return(loader); }
public static FirLibApplicationLoader AddSingleApplicationInstanceService_UsingMutex( this FirLibApplicationLoader loader, string mutexName) { loader.Services.Register( typeof(ISingleApplicationInstanceService), new MutexBasedSingleApplicationInstanceService(mutexName)); return(loader); }
public static FirLibApplicationLoader AddSingleApplicationInstanceService_Using_WM_COPYDATA( this FirLibApplicationLoader loader, string controlName) { loader.Services.Register( typeof(ISingleApplicationInstanceService), new WmCopyDataSingleApplicationInstanceService(controlName)); return(loader); }
public static FirLibApplicationLoader AttachToWpfEnvironment(this FirLibApplicationLoader loader) { var uiMessenger = new FirLibMessenger(); loader.AddLoadAction(() => { Application.Current.DispatcherUnhandledException += CurrentOnDispatcherUnhandledException; uiMessenger.CustomSynchronizationContextEqualityChecker = CheckForEqualSynchronizationContexts; uiMessenger.ConnectToGlobalMessaging( FirLibMessengerThreadingBehavior.EnsureMainSyncContextOnSyncCalls, FirLibConstants.MESSENGER_NAME_GUI, SynchronizationContext.Current); }); loader.AddUnloadAction(() => { Application.Current.DispatcherUnhandledException -= CurrentOnDispatcherUnhandledException; uiMessenger.DisconnectFromGlobalMessaging(); }); return(loader); }