logo

Program class, main entry application. More...

Public Types

enum  OS { WINDOWS, MACOS, LINUX, UNKNOWN }
 A more simplified enumeration of PlatformID enum, not targetting versions of a operating system. More...
 

Static Public Member Functions

static short[] GetVersion ()
 Gets the application version numbers, without the .net 'revision' number, as an array More...
 
static void LoadLink (string uri_text, bool allow_ask)
 If set ask the user if the want to load the link. More...
 
static void Main (string[] args)
 Main entry point programme. load settings, parser parameters, create notes list and trayicon. More...
 
static string GetDefaultNotesFolder ()
 Get the default notes folder for this programme. If the folder does not exists create it. More...
 
static string GetDefaultPluginFolder ()
 Get the default plugins folder for this programme. If the folder does not exists create it. More...
 
static string ChangeUrlIPVersion (string url)
 Change the url to force the use of IPv4 or IPv6 by using only a A or AAAA record. More...
 
static void SetCulture (string languagecode)
 Set the culture of this programme with a languagecode. Use english if languagecode is unknown. More...
 
static void RestartTrayicon ()
 Dispose the trayicon and create a new one. More...
 
static void DisposeTrayicon ()
 Dispose the trayicon More...
 
static string UpdateGetLatestVersion ()
 Do update check. More...
 
static int CompareVersions (short[] versionA, short[] versionB)
 Find out if the version numbers given as array is higher than the required version numbers given as an array. More...
 
static short[] ParserVersionString (string versionstring)
 Parser a string as a version number array with major, minor, release numbers More...
 
static string GetNewPluginFolder (bool createnotexist)
 Get the plugin folder for plugins update to be stored in temperary. More...
 

Properties

static OS CurrentOS [get]
 Get the current operating system running this program More...
 
static string AppDataFolder [get]
 Gets the application data folder. More...
 
static string AssemblyTitle [get]
 Gets the application title. More...
 
static string AssemblyVersionAsString [get]
 Gets the version of this programme as a formatted string. More...
 
static string AssemblyVersionQuality [get]
 Gets the application version quality. alpha(=bugs for sure), beta(=bugs are likely), rc(=more testing still needed) or nothing for final(=ready for production) "b" quick rerelease of current version to address a version number issue only. More...
 
static string InstallFolder [get]
 Gets the folder where NoteFly is installed. Folder where assebly is located. More...
 
static Notes Notes [get]
 Gets a reference to Notes class More...
 
static FormManager Formmanager [get]
 Gets a reference to FormManger class More...
 

Private Member Functions

static int uname (IntPtr buf)
 
static bool SetDllDirectory (string pathName)
 

Static Private Member Functions

static void LoadPlatformOs ()
 Figure out the operating system that is running this program. More...
 
static bool IsRunningOnMac ()
 Figure out if this is a MacOS operating system running this programme by using uname. More...
 
static void ParserArguments (string[] args, out bool visualstyle, out bool resetpositions, out bool newnote, out string newnotetitle, out string newnotecontent)
 Parser the programme arguments More...
 
static void ShowParametersHelp ()
 Show help message on supported programme parameters. More...
 
static void UpdateCompareVersion (object sender, System.ComponentModel.RunWorkerCompletedEventArgs e)
 Compare the latest version and this programme version, if this is a old release ask to update. More...
 
static void frmupdater_DownloadCompleetSuccesfull (string[] newfiles)
 Download compleet, run update. This only one setup file so the first element of the array with newfiles is launched. More...
 
static void ExecDownload (string file)
 Launch a new process, with parameters if set. More...
 
static void UnhandledExceptionHandler (object sender, UnhandledExceptionEventArgs args)
 Unhandled exceptions occur. More...
 
static void UnhanledThreadExceptionHandler (object sender, ThreadExceptionEventArgs treadargs)
 Unhandled thread exceptions occur. More...
 
static void ShowExceptionDlg (Exception e)
 Log exception and show exception dialog. More...
 
static int CheckInstancesRunning ()
 Check number of instance of this application. More...
 
static string GetTempFolder ()
 Get the operating system temp folder. More...
 
static void LoadURI (string uri_text)
 Actual loads the url. Also provide some cursor feedback. More...
 

Private Attributes

const string DEFAULTNOTESFOLDERNAME = "notes"
 The default folder name in which notes are stored in application data folder. More...
 
const string DEFAULTPLUGINSFOLDERNAME = "plugins"
 The default folder name in which plugins are stored in application data folder. More...
 

Static Private Attributes

static Notes notes
 Reference to notes class. More...
 
static FormManager formmanager
 Reference to the FormManager class. More...
 
static TrayIcon trayicon
 Reference to trayicon More...
 
static OS currentos
 The current operating system running this program More...
 
static string updateprogramrsasignature
  More...
 

Detailed Description

Member Enumeration Documentation

Enumerator
WINDOWS 
MACOS 
LINUX 
UNKNOWN 

Member Function Documentation

static string NoteFly.Program.ChangeUrlIPVersion ( string  url)
static
Parameters
urlThe orginal url used for updating
Returns
The new url used for updating, use ipv4. alias for ipv4 only and use ipv6. alias for ipv6 only.
static int NoteFly.Program.CheckInstancesRunning ( )
staticprivate
Returns
The number of instance running
static int NoteFly.Program.CompareVersions ( short[]  versionA,
short[]  versionB 
)
static
Parameters
versionAA version as array with major, minor and release numbers
versionBA version as array with major, minor and release numbers
Returns
Returns -3 if versionB is not valid. -2 if versionA is not valid. -1 if versionA is lower than versionB, 0 if versionA is equal with versionB, 1 if versionA is higher than versionB.
static void NoteFly.Program.DisposeTrayicon ( )
static
static void NoteFly.Program.ExecDownload ( string  file)
staticprivate
Parameters
fileThe file to launch
static void NoteFly.Program.frmupdater_DownloadCompleetSuccesfull ( string[]  newfiles)
staticprivate
Parameters
newfilesArray with returned new files
static string NoteFly.Program.GetDefaultNotesFolder ( )
static
Returns
The default notes save path as string.
static string NoteFly.Program.GetDefaultPluginFolder ( )
static
Returns
The default plugin folder.
static string NoteFly.Program.GetNewPluginFolder ( bool  createnotexist)
static
Returns
static string NoteFly.Program.GetTempFolder ( )
staticprivate
Returns
static short [] NoteFly.Program.GetVersion ( )
static

The .NET 'build' number is actally called a release number because it needs to be manually increased. And the .NET 'revision' number is actaully the build number, because this number is changed every build/compile of the program. (I know this is confuzzing blame the .NET creators.)

Returns
A string containing the version number of this application in the form of major.minor.release/'dotNET build' number.
static bool NoteFly.Program.IsRunningOnMac ( )
staticprivate
Returns
static void NoteFly.Program.LoadLink ( string  uri_text,
bool  allow_ask 
)
static
Parameters
uri_textThe uniform resource location.
allow_askAllow to ask user if it wants to visit a url.
static void NoteFly.Program.LoadPlatformOs ( )
staticprivate
static void NoteFly.Program.LoadURI ( string  uri_text)
staticprivate
Parameters
uri_textThe uri to load
static void NoteFly.Program.Main ( string[]  args)
static
Parameters
argsThe programme parameters
static void NoteFly.Program.ParserArguments ( string[]  args,
out bool  visualstyle,
out bool  resetpositions,
out bool  newnote,
out string  newnotetitle,
out string  newnotecontent 
)
staticprivate
Parameters
argsAn array of arguments the check
visualstyleUse XP visual styles on windows.
resetpositionsShould all visual notes position get reset.
static short [] NoteFly.Program.ParserVersionString ( string  versionstring)
static
Parameters
versionstringAn string with a version.
Returns
Array with version numbers shorts. First element is major version number, second element is minor version number, third element is release version number.
static void NoteFly.Program.RestartTrayicon ( )
static
static void NoteFly.Program.SetCulture ( string  languagecode)
static
Parameters
languagecodeThe languagecode
static bool NoteFly.Program.SetDllDirectory ( string  pathName)
private
static void NoteFly.Program.ShowExceptionDlg ( Exception  e)
staticprivate
Parameters
eException object
static void NoteFly.Program.ShowParametersHelp ( )
staticprivate
static int NoteFly.Program.uname ( IntPtr  buf)
private
static void NoteFly.Program.UnhandledExceptionHandler ( object  sender,
UnhandledExceptionEventArgs  args 
)
staticprivate
Parameters
senderSender object
argsUnhandledExceptionEvent arguments
static void NoteFly.Program.UnhanledThreadExceptionHandler ( object  sender,
ThreadExceptionEventArgs  treadargs 
)
staticprivate
Parameters
senderSender object
treadargsThreadExceptionEvent arguments
static void NoteFly.Program.UpdateCompareVersion ( object  sender,
System.ComponentModel.RunWorkerCompletedEventArgs  e 
)
staticprivate
Parameters
senderSender object
eRunWorkerCompleted event arguments
static string NoteFly.Program.UpdateGetLatestVersion ( )
static
Returns
Datetime aof latest update check as string

Member Data Documentation

OS NoteFly.Program.currentos
staticprivate
const string NoteFly.Program.DEFAULTNOTESFOLDERNAME = "notes"
private
const string NoteFly.Program.DEFAULTPLUGINSFOLDERNAME = "plugins"
private
FormManager NoteFly.Program.formmanager
staticprivate
Notes NoteFly.Program.notes
staticprivate
TrayIcon NoteFly.Program.trayicon
staticprivate
string NoteFly.Program.updateprogramrsasignature
staticprivate

Property Documentation

string NoteFly.Program.AppDataFolder
staticget
string NoteFly.Program.AssemblyTitle
staticget
string NoteFly.Program.AssemblyVersionAsString
staticget
string NoteFly.Program.AssemblyVersionQuality
staticget
OS NoteFly.Program.CurrentOS
staticget
FormManager NoteFly.Program.Formmanager
staticget
string NoteFly.Program.InstallFolder
staticget
Notes NoteFly.Program.Notes
staticget