C# Class Bloom.Program

Show file Open project: BloomBooks/BloomDesktop

Public Properties

Property Type Description
ApplicationExiting bool
StartUpWithFirstOrNewVersionBehavior bool

Private Properties

Property Type Description
AttachConsole bool
CareForSplashScreenAtIdleTime void
CheckForCorruptUserConfig void
CheckLinuxFileAssociations void
CheckRegistration void
ChooseAnotherProject void
CloseSplashScreen void
GrabTokenForThisProject bool
HandleDownload void
HandleErrorOpeningProjectWindow void
HandlePrepareCommandLine int
HandleProjectWindowActivated void
HandleProjectWindowClosed void
IsBloomBookOrder bool
IsInstallerLaunch bool
Main int
OnXulRunnerShutdown void
OpenCollection bool
OpenProjectWindow bool
ReopenProject void
Run void
SetUpErrorHandling void
StartDebugServer void
StartUpShellBasedOnMostRecentUsedIfPossible void
Startup void
registerChromeDir void
toNsFile nsILocalFile

Public Methods

Method Description
GetRunningBloomProcessCount ( ) : int

Getting the count of running Bloom instances takes extra steps on Linux.

OldVersionCheck ( ) : void
ReleaseMutexForThisProject ( ) : void
RestartBloom ( ) : void
SetUpLocalization ( ApplicationContainer applicationContainerSource = null ) : void

Private Methods

Method Description
AttachConsole ( int pid ) : bool
CareForSplashScreenAtIdleTime ( object sender, EventArgs e ) : void
CheckForCorruptUserConfig ( ) : void
CheckLinuxFileAssociations ( ) : void

Creates mime types and file associations on developer machine

CheckRegistration ( ) : void
ChooseAnotherProject ( object sender, EventArgs e ) : void
CloseSplashScreen ( ) : void
GrabTokenForThisProject ( string pathToProject ) : bool
HandleDownload ( string order ) : void

This routine handles the old-style download requests which come as an order URL from BloomLibrary. Enhance: it's unfortunate that we have two command-line methods of downloading a book. However, they have rather different requirements: - this one displays a progress UI, the other doesn't. - this one must extract the URL from a bloom: url (which the library must produce with urlencoding), for the other, it's more convenient to pass an unencoded url - worse, this version typically goes on to fully launch Bloom; the other always shuts the program down when done. Thus, this version is much more tightly connected to the normal startup code. Note that we can't easily change the exact command line that this version deals with, because Bloom library generates that command line, and if we change what it generates, everyone running an older Bloom will be in trouble. Most of the core implementation of the download process is common.

HandleErrorOpeningProjectWindow ( Exception error, string projectPath ) : void
HandlePrepareCommandLine ( HydrateParameters opts ) : int
HandleProjectWindowActivated ( object sender, EventArgs e ) : void
HandleProjectWindowClosed ( object sender, EventArgs e ) : void
IsBloomBookOrder ( string args ) : bool
IsInstallerLaunch ( string args ) : bool
Main ( string args1 ) : int
OnXulRunnerShutdown ( object sender, EventArgs e ) : void
OpenCollection ( string path ) : bool
OpenProjectWindow ( string projectPath ) : bool
ReopenProject ( object sender, EventArgs e ) : void
Run ( ) : void
SetUpErrorHandling ( ) : void
StartDebugServer ( ) : void

This code (and the two methods above) were taken from https://bitbucket.org/duanyao/moz-devtools-patch with thanks to Duane Yao. It starts up a server that allows FireFox to be used to inspect and debug the content of geckofx windows. See the ReadMe in remoteDebugging for instructions. Note that this should NOT be done in production. There are security issues.

StartUpShellBasedOnMostRecentUsedIfPossible ( ) : void
Startup ( object sender, EventArgs e ) : void
registerChromeDir ( string dir ) : void
toNsFile ( string file ) : nsILocalFile

Method Details

GetRunningBloomProcessCount() public static method

Getting the count of running Bloom instances takes extra steps on Linux.
public static GetRunningBloomProcessCount ( ) : int
return int

OldVersionCheck() public static method

public static OldVersionCheck ( ) : void
return void

ReleaseMutexForThisProject() public static method

public static ReleaseMutexForThisProject ( ) : void
return void

RestartBloom() public static method

public static RestartBloom ( ) : void
return void

SetUpLocalization() public static method

public static SetUpLocalization ( ApplicationContainer applicationContainerSource = null ) : void
applicationContainerSource ApplicationContainer
return void

Property Details

ApplicationExiting public static property

public static bool ApplicationExiting
return bool

StartUpWithFirstOrNewVersionBehavior public static property

public static bool StartUpWithFirstOrNewVersionBehavior
return bool