• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Dapplo.Addons
    • IAction
    • IApplicationBootstrapper
    • IAsyncShutdownAction
    • IAsyncStartupAction
    • IBootstrapper
    • IDependencyProvider
    • IMefServiceLocator
    • IModule
    • IServiceExporter
    • IServiceRepository
    • IShutdownAction
    • IShutdownMetadata
    • IShutdownModule
    • IStartupAction
    • IStartupMetadata
    • IStartupModule
    • ModuleAttribute
    • ShutdownActionAttribute
    • StartupActionAttribute
    • StartupException
  • Dapplo.Addons.Bootstrapper
    • ApplicationBootstrapper
    • CompositionBootstrapper
    • ResourceMutex
    • StartupShutdownBootstrapper
  • Dapplo.Addons.Bootstrapper.Internal
    • CompressionTypes
    • StreamExtensions
  • Dapplo.Addons.Bootstrapper.Resolving
    • AssemblyResolver
    • EmbeddedResources
    • FileLocations
    • FileTools

Class ApplicationBootstrapper

This bootstrapper is made especially to host dapplo "apps". You can protect your application from starting multiple instances by specifying a Mutex-ID

Inheritance
System.Object
CompositionBootstrapper
StartupShutdownBootstrapper
ApplicationBootstrapper
Inherited Members
StartupShutdownBootstrapper.AutoShutdown
StartupShutdownBootstrapper.AutoStartup
StartupShutdownBootstrapper.ShutdownAsync(CancellationToken)
StartupShutdownBootstrapper.StartupAsync(CancellationToken)
StartupShutdownBootstrapper.StopAsync(CancellationToken)
CompositionBootstrapper.AggregateCatalog
CompositionBootstrapper.CompositionOptionFlags
CompositionBootstrapper.Container
CompositionBootstrapper.ExportProviders
CompositionBootstrapper.IsAggregateCatalogConfigured
CompositionBootstrapper.GetService(Type)
CompositionBootstrapper.Configure()
CompositionBootstrapper.Unconfigure()
CompositionBootstrapper.KnownAssemblies
CompositionBootstrapper.KnownFiles
CompositionBootstrapper.AddScanDirectory(String)
CompositionBootstrapper.AddScanDirectories(IEnumerable<String>)
CompositionBootstrapper.Add(Assembly)
CompositionBootstrapper.Add(AssemblyCatalog)
CompositionBootstrapper.FindAndLoadAssembly(String, IEnumerable<String>)
CompositionBootstrapper.FindAndLoadAssemblies(String, Boolean, IEnumerable<String>)
CompositionBootstrapper.FindAndLoadAssembliesFromDirectory(String, String, Boolean, IEnumerable<String>)
CompositionBootstrapper.FindAndLoadAssembliesFromDirectory(String, Regex, Boolean)
CompositionBootstrapper.FindAndLoadAssemblies(IEnumerable<String>, Regex, Boolean)
CompositionBootstrapper.Add(Type)
CompositionBootstrapper.Add(ExportProvider)
CompositionBootstrapper.ProvideDependencies(Object)
CompositionBootstrapper.GetExport<T>(String)
CompositionBootstrapper.GetExport<T, TMetaData>(String)
CompositionBootstrapper.GetExport(Type, String)
CompositionBootstrapper.GetExports<T>(String)
CompositionBootstrapper.GetExports(Type, String)
CompositionBootstrapper.GetExports<T, TMetaData>(String)
CompositionBootstrapper.GetInstance(Type)
CompositionBootstrapper.GetInstance(Type, String)
CompositionBootstrapper.GetAllInstances(Type)
CompositionBootstrapper.GetInstance<TService>()
CompositionBootstrapper.GetInstance<TService>(String)
CompositionBootstrapper.GetAllInstances<TService>()
CompositionBootstrapper.Export<T>(T, IDictionary<String, Object>)
CompositionBootstrapper.Export(Type, Object, IDictionary<String, Object>)
CompositionBootstrapper.Export<T>(String, T, IDictionary<String, Object>)
CompositionBootstrapper.Export(Type, String, Object, IDictionary<String, Object>)
CompositionBootstrapper.Release(ComposablePart)
CompositionBootstrapper.IsInitialized
CompositionBootstrapper.Dispose()
CompositionBootstrapper.RegisterForDisposal(IDisposable)
Namespace:Dapplo.Addons.Bootstrapper
Assembly:Dapplo.Addons.Bootstrapper.dll
Syntax
public class ApplicationBootstrapper : StartupShutdownBootstrapper, IApplicationBootstrapper, IBootstrapper, IServiceLocator, IMefServiceLocator, IServiceExporter, IServiceRepository, IDependencyProvider, IDisposable

Constructors

| Improve this Doc View Source

ApplicationBootstrapper(String, String, Boolean)

Create the application bootstrapper, for the specified application name The mutex is created and locked in the contructor, and some of your application logic might depend on this.

Declaration
public ApplicationBootstrapper(string applicationName, string mutexId = null, bool global = false)
Parameters
Type Name Description
System.String applicationName

Name of your application

System.String mutexId

string with an ID for your mutex, preferably a Guid. If the mutex can't be locked, the bootstapper will not be able to "bootstrap".

System.Boolean global

Is the mutex a global or local block (false means only in this Windows session)

Properties

| Improve this Doc View Source

ApplicationName

Returns the application name for this bootstrapper

Declaration
public string ApplicationName { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

IsMutexLocked

Returns if the Mutex is locked, in other words if this ApplicationBootstrapper can continue This also returns true if no mutex is used

Declaration
public bool IsMutexLocked { get; }
Property Value
Type Description
System.Boolean

Methods

| Improve this Doc View Source

Dispose(Boolean)

Implementation of the dispose pattern

Declaration
protected override void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

bool

Overrides
CompositionBootstrapper.Dispose(Boolean)
| Improve this Doc View Source

InitializeAsync(CancellationToken)

Initialize the application bootstrapper, this makes sure the configuration and languages can be loaded

Declaration
public override Task<bool> InitializeAsync(CancellationToken cancellationToken = null)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<System.Boolean>

bool with value of IsInitialized

Overrides
CompositionBootstrapper.InitializeAsync(CancellationToken)
| Improve this Doc View Source

RunAsync(CancellationToken)

Override the run to prevent starting when the mutex isn't locked

Declaration
public override Task<bool> RunAsync(CancellationToken cancellationToken = null)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<System.Boolean>
Overrides
StartupShutdownBootstrapper.RunAsync(CancellationToken)
  • Improve this Doc
  • View Source
Back to top Copyright © 2017 Dapplo