public static AutoFillAuthCodeService GetInstance() { if (instance == null) { instance = new AutoFillAuthCodeService(); } return(instance); }
static void Main(string[] args) { // run the program only once if (PriorProcess() != null) { MessageBox.Show("Another instance of the app is already running."); return; } // Parse command line arguments var options = new Options(); Parser.Default.ParseArguments(args, options); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // create auto fill auth code service var service = AutoFillAuthCodeService.GetInstance(); service.Start(); Manifest man = Manifest.GetManifest(); if (man.FirstRun) { // Install VC++ Redist and wait new InstallRedistribForm().ShowDialog(); if (man.Entries.Count > 0) { // Already has accounts, just run MainForm mf = new MainForm(); mf.SetEncryptionKey(options.EncryptionKey); mf.StartSilent(options.Silent); Application.Run(mf); } else { // No accounts, run welcome form Application.Run(new WelcomeForm()); } } else { MainForm mf = new MainForm(); mf.SetEncryptionKey(options.EncryptionKey); mf.StartSilent(options.Silent); Application.Run(mf); } }