예제 #1
0
 private void ApplicationStartup(object sender, StartupEventArgs e)
 {
     try
     {
         System.IO.Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\ACScreenSaver");
     }
     catch (Exception ex)
     {
         Logger.LogError(ex.Message);
     }
     // Preview mode--display in little window in Screen Saver dialog
     // (Not invoked with Preview button, which runs Screen Saver in
     // normal /s mode).
     if (e.Args[0].ToLower().StartsWith("/p"))
     {
         Logger.LogDebug("Mode preview");
         //PreviewWindow previewWindow = new PreviewWindow();
         //previewWindow.Show();
     }
     // Normal screensaver mode.  Either screen saver kicked in normally,
     // or was launched from Preview button
     else if (e.Args[0].ToLower().StartsWith("/s"))
     {
         Logger.LogDebug("Mode screen saver");
         ScreenSaverManager screenSaverManager = new ScreenSaverManager();
         screenSaverManager.DisplayScreenSaverWindow();
     }
     // Config mode, launched from Settings button in screen saver dialog
     else if (e.Args[0].ToLower().StartsWith("/c"))
     {
         Logger.LogDebug("Mode configuration");
         ConfigurationWindow configurationWindow = new ConfigurationWindow();
         configurationWindow.Show();
     }
     // If not running in one of the sanctioned modes, shut down the app
     // immediately (because we don't have a GUI).
     else
     {
         Logger.LogError("Aucun argument spécifié");
     }
 }
예제 #2
0
        public ScreenSaverWindow(ScreenSaverManager screenSaverManager)
        {
            InitializeComponent();

            _screenSaverManager = screenSaverManager;

            _imageTimer = new Timer();
            SetImageTimerDuration(_screenSaverManager.Configuration.ImageDisplayDuration);
            _imageTimer.Elapsed += _timer_Elapsed;

            _timerDurationDisplayTimer          = new Timer();
            _timerDurationDisplayTimer.Elapsed += _timerDurationDisplayTimer_Elapsed;

            _informationsDisplayTimer          = new Timer();
            _informationsDisplayTimer.Elapsed += _informationsDisplayTimer_Elapsed;

            Zoom_Border.Background       = Brushes.Black;
            Informations_Grid.Visibility = Visibility.Hidden;
            Timer_TextBlock.Visibility   = Visibility.Hidden;
            Year_Grid.Visibility         = Visibility.Hidden;
            Year_TextBlock.Foreground    = new SolidColorBrush(_screenSaverManager.Configuration.YearColor);

            _stopwatch.Start();
        }
예제 #3
0
        public InformationsWindow(ScreenSaverManager screenSaverManager)
        {
            InitializeComponent();

            _screenSaverManager = screenSaverManager;
        }