Esempio n. 1
0
        public void UpdateDetection()
        {
            var newOrientation = DWAS2Interop.GetDesktopOrientation(config.reverse);

            if (newOrientation != lastOrientation)
            {
                lastOrientation = newOrientation;

                UpdateNotifyIcon();
                UpdateWallpaper();
                UpdateLockscreen();

                OrientationChangedEvent(new OrientationChangedEventArgs(newOrientation));
            }
        }
Esempio n. 2
0
        public MainWindow()
        {
            InitializeComponent();

            // init logger
            string logpath = System.AppDomain.CurrentDomain.BaseDirectory + @"\DWAS2.log";

            GeneralLogger.Initialize(logpath);

            // read and process configuration
            config.ReadConfig();
            ProcessConfig();

            // check hiding
            if (File.Exists(config.wpLandscape) && File.Exists(config.wpPortrait) && File.Exists(config.lcLandscape) && File.Exists(config.lcPortrait))
            {
                this.shouldHideAtStartup = true;
            }

            // read language
            languages = DWAS2LanguageManager.LoadLanguages();
            lang      = DWAS2LanguageManager.SelectLanguage(languages, config.language);
            if (lang.Language.CompareTo(config.language) != 0)
            {
                config.language = lang.Language;
                config.SaveConfig();
            }
            // LANGUAGE IS PROCESSED IN WINDOW_LOADED EVENT HANDLER

            // read orientation
            lastOrientation = DWAS2Interop.GetDesktopOrientation(config.reverse);

            // notify icon
            InitNotifyIcon();

            // initial set
            UpdateDetection();

            // start timer
            InitTimer();
        }