public void UpdateDetection() { var newOrientation = DWAS2Interop.GetDesktopOrientation(config.reverse); if (newOrientation != lastOrientation) { lastOrientation = newOrientation; UpdateNotifyIcon(); UpdateWallpaper(); UpdateLockscreen(); OrientationChangedEvent(new OrientationChangedEventArgs(newOrientation)); } }
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(); }