Example #1
0
        public SessionService(
            IAddonService addonService,
            IWarcraftService warcraftService,
            IWowUpService wowUpService)
        {
            _addonService = addonService;
            _wowUpService = wowUpService;

            var installedClientTypes = warcraftService.GetWowClientTypes();
            var lastSelectedType     = _wowUpService.GetLastSelectedClientType();
            var initialClientType    = installedClientTypes.Any() ? installedClientTypes.First() : WowClientType.None;

            // If the user has no stored type, or the type is no longer found just set it.
            if (lastSelectedType == WowClientType.None || !installedClientTypes.Any(ct => ct == lastSelectedType))
            {
                _wowUpService.SetLastSelectedClientType(initialClientType);
            }
            else
            {
                initialClientType = lastSelectedType;
            }

            _sessionState = new SessionState
            {
                SelectedClientType = initialClientType,
                StatusText         = string.Empty,
                UpdaterReady       = false
            };
        }
Example #2
0
        public SessionService(
            IWarcraftService warcraftService)
        {
            var installedClientTypes = warcraftService.GetWowClientTypes();
            var initialClientType    = installedClientTypes.Any() ? installedClientTypes.First() : WowClientType.None;

            _sessionState = new SessionState
            {
                SelectedClientType = initialClientType
            };
        }