InitSteamTimer() public method

Initialize timer to regularly check Steam client status
public InitSteamTimer ( ) : void
return void
コード例 #1
0
        private void LaunchCardIdle(object sender, StartupEventArgs e)
        {
            //Thread.CurrentThread.CurrentUICulture = new CultureInfo("en");
            //Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("ru-Ru");

            // http://stackoverflow.com/questions/1472498/wpf-global-exception-handler
            // http://stackoverflow.com/a/1472562/1506454
            DispatcherUnhandledException += LogUnhandledDispatcherException;
            AppDomain.CurrentDomain.UnhandledException += LogUnhandledDomainException;
            TaskScheduler.UnobservedTaskException      += LogTaskSchedulerUnobservedTaskException;

            Logger.Info(String.Format("{0} {1}bit", Environment.OSVersion, Environment.Is64BitOperatingSystem ? 64 : 32));

            string localDatafolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
            string appFolder       = Path.Combine(localDatafolder, Path.GetFileNameWithoutExtension(AppSystemName));

            if (Directory.Exists(appFolder) == false)
            {
                Directory.CreateDirectory(appFolder);
            }

            var storage = new SettingsStorage();

            storage.FileName = Path.Combine(appFolder, "Settings.txt");
            storage.Init();

            CookieClient.Storage = storage;

            _account                 = new AccountModel();
            _account.Storage         = storage;
            _account.ShowcaseStorage = new FileStorage("ShowcaseDb.txt");

            Palette = PaletteItemsCollection.Create();
            if (storage.AppBrushes != null)
            {
                Palette.Deserialize(storage.AppBrushes.OfType <string>());
            }
            Palette.SetNotifier(() =>
            {
                storage.AppBrushes.Clear();
                storage.AppBrushes.AddRange(Palette.Serialize().ToArray());
                storage.Save();
            });

            var w = new BadgesWindow {
                DataContext = _account
            };

            w.Show();

            _account.InitSteamTimer();
            _account.CheckLatestRelease();
            _account.LoadCardIdleProfile();
            _account.LoadAccount();
        }
コード例 #2
0
        private void LaunchCardIdle(object sender, StartupEventArgs e)
        {
            //Thread.CurrentThread.CurrentUICulture = new CultureInfo("en");
            //Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("ru-Ru");

            // http://stackoverflow.com/questions/1472498/wpf-global-exception-handler
            // http://stackoverflow.com/a/1472562/1506454
            DispatcherUnhandledException += LogUnhandledDispatcherException;
            AppDomain.CurrentDomain.UnhandledException += LogUnhandledDomainException;
            TaskScheduler.UnobservedTaskException += LogTaskSchedulerUnobservedTaskException;

            Logger.Info(String.Format("{0} {1}bit", Environment.OSVersion, Environment.Is64BitOperatingSystem ? 64 : 32));

            LoadVisuals();

            _account = new AccountModel();
            var w = new BadgesWindow { DataContext = _account};
            w.Show();

            _account.InitSteamTimer();
            _account.LoadAccount();
        }