예제 #1
0
        public LoginWindowViewModel(UserControl view)
        {
            this.view = view as LoginView;

            UseSession = Settings.UserSettings.ContainsKey("UseSessionID") ? bool.Parse(Settings.UserSettings["UseSessionID"]) : false;

            Email = Settings.UserSettings["AccountLogin"];
            this.formChanged = string.IsNullOrEmpty(Settings.UserSettings["AccountPassword"]);

            if (!this.formChanged)
                this.view.txtPassword.Password = string.Empty.PadLeft(8); //For the visuals

            this.view.txtPassword.PasswordChanged += new System.Windows.RoutedEventHandler(txtPassword_PasswordChanged);

            statusController = new StatusController(this.view.StatusBox);

            ApplicationState.Model.Authenticating += model_Authenticating;
            ApplicationState.Model.Throttled += model_Throttled;
            ApplicationState.InitializeFont(Properties.Resources.fontin_regular_webfont);
            ApplicationState.InitializeFont(Properties.Resources.fontin_smallcaps_webfont);

            statusController.DisplayMessage(ApplicationState.Version + " Initialized.\r");

            VersionChecker.CheckForUpdates();
        }
예제 #2
0
        public LoginWindowViewModel(UserControl view)
        {
            this.view = view as LoginView;

            UseSession = Settings.UserSettings.ContainsKey("UseSessionID") ? bool.Parse(Settings.UserSettings["UseSessionID"]) : false;

            Email            = Settings.UserSettings["AccountLogin"];
            this.formChanged = string.IsNullOrEmpty(Settings.UserSettings["AccountPassword"]);

            if (!this.formChanged)
            {
                this.view.txtPassword.Password = string.Empty.PadLeft(8); //For the visuals
            }
            this.view.txtPassword.PasswordChanged += new System.Windows.RoutedEventHandler(txtPassword_PasswordChanged);

            statusController = new StatusController(this.view.StatusBox);

            ApplicationState.Model.Authenticating += model_Authenticating;
            ApplicationState.Model.Throttled      += model_Throttled;
            ApplicationState.InitializeFont(Properties.Resources.fontin_regular_webfont);
            ApplicationState.InitializeFont(Properties.Resources.fontin_smallcaps_webfont);

            statusController.DisplayMessage(ApplicationState.Version + " Initialized.\r");

            VersionChecker.CheckForUpdates();
        }
예제 #3
0
        public LoginWindowViewModel(UserControl view)
        {
            _view = view as LoginView;

            ForceRefresh = Settings.UserSettings.ContainsKey("ForceRefresh") ?
                           bool.Parse(Settings.UserSettings["ForceRefresh"]) : true;

            Email = Settings.UserSettings["AccountLogin"];

            if (!string.IsNullOrEmpty(Settings.UserSettings["AccountPassword"]))
            {
                _view.txtPassword.Password = string.Empty.PadLeft(8); //For the visuals
            }
            _view.txtPassword.PasswordChanged += new RoutedEventHandler(TxtPassword_PasswordChanged);
            PropertyChanged += LoginWindow_PropertyChanged;

            _characterInjector = new CharacterTabInjector();

            _statusController = new StatusController(_view.StatusBox);

            ApplicationState.Model.Authenticating += Model_Authenticating;
            ApplicationState.Model.Throttled      += Model_Throttled;
            ApplicationState.InitializeFont(Properties.Resources.fontin_regular_webfont);
            ApplicationState.InitializeFont(Properties.Resources.fontin_smallcaps_webfont);

            _statusController.DisplayMessage(ApplicationState.Version + " Initialized.\r");

            VersionChecker.CheckForUpdates();

            //Todo: Feed this in from a setting so that console players will have their preference remembered
            SelectedRealm = AvailableRealms.First();
        }
예제 #4
0
        public LoginWindowViewModel(UserControl view)
        {
            this.view = view as LoginView;

            UseSession = Settings.UserSettings.ContainsKey("UseSessionID") ?
                         bool.Parse(Settings.UserSettings["UseSessionID"]) : false;
            ForceRefresh = Settings.UserSettings.ContainsKey("ForceRefresh") ?
                           bool.Parse(Settings.UserSettings["ForceRefresh"]) : true;

            Email = Settings.UserSettings["AccountLogin"];

            if (!string.IsNullOrEmpty(Settings.UserSettings["AccountPassword"]))
            {
                this.view.txtPassword.Password = string.Empty.PadLeft(8); //For the visuals
            }
            this.view.txtPassword.PasswordChanged += new RoutedEventHandler(txtPassword_PasswordChanged);
            PropertyChanged += loginWindow_PropertyChanged;

            characterInjector = new CharacterTabInjector();

            statusController = new StatusController(this.view.StatusBox);

            ApplicationState.Model.Authenticating += model_Authenticating;
            ApplicationState.Model.Throttled      += model_Throttled;
            ApplicationState.InitializeFont(Properties.Resources.fontin_regular_webfont);
            ApplicationState.InitializeFont(Properties.Resources.fontin_smallcaps_webfont);

            statusController.DisplayMessage($"WTF is {ApplicationState.Version} Initialized. RIP TotalBiscuit.\r");

            VersionChecker.CheckForUpdates();
        }
예제 #5
0
        public void RefreshAllTabs()
        {
            statusController = new StatusController(StatusBox, 140);

            CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
            CancellationToken cancellationToken = cancellationTokenSource.Token;

            Task task = Task.Factory.StartNew(() =>
            {
                try
                {
                    ApplicationState.Model.StashLoading += model_StashLoading;
                    ApplicationState.Model.Throttled += model_Throttled;
                    ApplicationState.Stash[ApplicationState.CurrentLeague].RefreshAll(ApplicationState.Model, ApplicationState.CurrentLeague, ApplicationState.AccountName);
                    ApplicationState.Model.StashLoading -= model_StashLoading;
                    ApplicationState.Model.Throttled -= model_Throttled;
                    throw new Exception("test");
                }
                catch (Exception ex)
                {
                    Logger.Log("Exception refreshing all tabs: " + ex.ToString());
                    MessageBox.Show("Error encountered during refreshing all tabs, error details logged to DebugInfo.log", "Error refreshing all tabs", MessageBoxButton.OK, MessageBoxImage.Error);
                }
                finally
                {
                    ScreenController.Instance.ReloadStash();
                }
            });
        }
예제 #6
0
        public LoginWindowViewModel(UserControl view)
        {
            this.view = view as LoginView;

            UseSession = Settings.UserSettings.ContainsKey("UseSessionID") ? bool.Parse(Settings.UserSettings["UseSessionID"]) : false;

            Email            = Settings.UserSettings["AccountLogin"];
            this.formChanged = string.IsNullOrEmpty(Settings.UserSettings["AccountPassword"]);

            if (!this.formChanged)
            {
                this.view.txtPassword.Password = string.Empty.PadLeft(8); //For the visuals
            }
            this.view.txtPassword.PasswordChanged += new System.Windows.RoutedEventHandler(txtPassword_PasswordChanged);



            statusController = new StatusController(this.view.StatusBox);
            statusController.DisplayMessage(ApplicationState.Version + " - checking for updates...\r");
            int        latestversion;
            WebRequest LatestVesionRequest;

            LatestVesionRequest = WebRequest.Create("http://raw.github.com/Anubioz/procurement/master/VERSION");

            Stream objStream;

            objStream = LatestVesionRequest.GetResponse().GetResponseStream();

            StreamReader objReader = new StreamReader(objStream);

            string LatestVersionString = "";
            int    i = 0;
            bool   updateAvailable = false;

            while (LatestVersionString != null)
            {
                i++;
                LatestVersionString = objReader.ReadLine();

                if (LatestVersionString != null)
                {
                    latestversion = Convert.ToInt32(LatestVersionString);
                    if (latestversion > 13002)
                    {
                        updateAvailable = true;
                    }
                }
            }

            if (updateAvailable)
            {
                statusController.DisplayMessage("Updated version is available!\r");

                WebRequest ChangeLogRequest;
                ChangeLogRequest = WebRequest.Create("http://raw.github.com/Anubioz/procurement/master/LATEST");

                objStream = ChangeLogRequest.GetResponse().GetResponseStream();
                objReader = new StreamReader(objStream);
                string ChangeLogString = "";
                i = 0;

                while (ChangeLogString != null)
                {
                    i++;
                    ChangeLogString = objReader.ReadLine();

                    if (ChangeLogString != null)
                    {
                        statusController.DisplayMessage(ChangeLogString);
                    }
                }
            }
            else
            {
                statusController.DisplayMessage("Your version is up to date!\r");

                WebRequest ChangeLogRequest;
                ChangeLogRequest = WebRequest.Create("http://raw.github.com/Anubioz/procurement/master/UPTODATE");

                objStream = ChangeLogRequest.GetResponse().GetResponseStream();
                objReader = new StreamReader(objStream);
                string ChangeLogString = "";
                i = 0;

                while (ChangeLogString != null)
                {
                    i++;
                    ChangeLogString = objReader.ReadLine();

                    if (ChangeLogString != null)
                    {
                        statusController.DisplayMessage(ChangeLogString);
                    }
                }
            }
            ApplicationState.Model.Authenticating += new POEModel.AuthenticateEventHandler(model_Authenticating);
            ApplicationState.Model.StashLoading   += new POEModel.StashLoadEventHandler(model_StashLoading);
            ApplicationState.Model.ImageLoading   += new POEModel.ImageLoadEventHandler(model_ImageLoading);
            ApplicationState.Model.Throttled      += new ThottledEventHandler(model_Throttled);
            ApplicationState.InitializeFont(Properties.Resources.fontin_regular_webfont);
            ApplicationState.InitializeFont(Properties.Resources.fontin_smallcaps_webfont);
        }