public Form1(bool LaunchedOnStartup) { InitializeComponent(); StartOnBoot = new SystemStartup("BingWallpaper"); Wallpaper = new Wallpaper(); image = new ImageManager(); //Set paths PathToImagesFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures); ProgramPath = GetProgramPath(); //set Checkbox state getAutomatic.Checked = StartOnBoot.IsOnStartup(); Console.WriteLine(LaunchedOnStartup); if(LaunchedOnStartup) { getWallpaper_Click(null, null); if (Wallpaper.isSetCurrentWallpaper(image.GetSavedImage())) Environment.Exit(0); } }
public Form1(bool LaunchedOnStartup) { InitializeComponent(); StartOnBoot = new SystemStartup("BingWallpaper"); Wallpaper = new Wallpaper(); image = new ImageManager(); //Set paths PathToImagesFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures); ProgramPath = GetProgramPath(); //set Checkbox state getAutomatic.Checked = StartOnBoot.IsOnStartup(); Console.WriteLine(LaunchedOnStartup); if (LaunchedOnStartup) { getWallpaper_Click(null, null); if (Wallpaper.isSetCurrentWallpaper(image.GetSavedImage())) { Environment.Exit(0); } } }