Esempio n. 1
0
        public WallpaperMain()
        {
            icon = new NotifyIcon
            {
                Text = "WallQuotePaper",
                Icon = Properties.Resources.TrayIcon,
                Visible = true
            };
            icon.ContextMenuStrip = MakeMenu();

            Application.ApplicationExit += Application_ApplicationExit;
            SystemEvents.DisplaySettingsChanged += SystemEvents_DisplaySettingsChanged;
            SystemEvents.PowerModeChanged += OnPowerChange;

            data = new WallpaperData();
            random = new Random();
            maker = new WallpaperMaker(this, data);

            minuteTimer = new Timer();
            minuteTimer.Tick += minuteTimerTick;
            minuteTimer.Interval = 1000 * 60;
            minuteTimer.Enabled = true;

            refreshTimer = new Timer();
            refreshTimer.Tick += refreshTimerTick;
            refreshTimer.Interval = 1000 * 60 * 15;
            refreshTimer.Enabled = true;

            UpdateIcon();
            NextWallpaper();
        }
Esempio n. 2
0
 private void SystemEvents_DisplaySettingsChanged(object sender, EventArgs e)
 {
     maker = new WallpaperMaker(this, data);
 }