コード例 #1
0
ファイル: Form1.cs プロジェクト: JozefCipa/bing_wallpaper
        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); 
                
            }

        }
コード例 #2
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);
                }
            }
        }