示例#1
0
        private void saveBtn_Click(object sender, EventArgs e)
        {
            _settings.Save();
            RegistryKey rk = Registry.CurrentUser.OpenSubKey
                                 ("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);

            if (_settings.Startup)
            {
                rk?.SetValue(AppName, Application.ExecutablePath);
            }
            else
            {
                rk?.DeleteValue(AppName, false);
            }

            Wallpaper.SetSlideShow(_settings, Wallpaper.GetResolution());
        }
示例#2
0
        static void Main()
        {
            //string path = Directory.GetCurrentDirectory();
            //DateTime dt = DateTime.Now;
            //File.AppendAllText("C:\\Users\\Jim\\jbcstart.txt", "[" + dt + "] Started from : " + path + Environment.NewLine);
            string appPath = new Uri(Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase) ??
                                     throw new InvalidOperationException()).LocalPath;

            Directory.SetCurrentDirectory(appPath);
            AppDomain currentDomain = AppDomain.CurrentDomain;

            currentDomain.UnhandledException    += MyHandler;
            SystemEvents.DisplaySettingsChanged += Wallpaper.SystemEvents_DisplaySettingsChanged;
            Wallpaper.SystemEvents_DisplaySettingsChanged(null, EventArgs.Empty);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form());
        }
示例#3
0
 private void refreshScreens_Click(object sender, EventArgs e)
 {
     Wallpaper.SystemEvents_DisplaySettingsChanged(this, new EventArgs());
 }
示例#4
0
 private void nextWallPaper_Click(object sender, EventArgs e)
 {
     Wallpaper.NextWallpaper();
 }