/// <summary> Creates a new control. </summary>
        /// <param name="presenter"> An instance of a main window presenter. </param>
        /// <param name="vehicle"> The vehicle positioned in the cell. </param>
        /// <param name="displayVehicleInformationStrategy"> The strategy for generating a formatted string with <see cref="IVehicle"/> information for the given <see cref="EGameMode"/>. </param>
        /// <param name="type"> The type of the vehicle card. </param>
        /// <param name="isToggled"> Whether the vehicles is toggled on, i.e. participating in randomisation. </param>
        public ResearchTreeCellVehicleControl(IMainWindowPresenter presenter, IVehicle vehicle, IDisplayVehicleInformationStrategy displayVehicleInformationStrategy, EVehicleCard type, bool isToggled)
            : this()
        {
            Type = type;
            _displayVehicleInformationStrategy = displayVehicleInformationStrategy;
            _presenter = presenter;

            Vehicle         = vehicle;
            _name.Text      = Vehicle?.ResearchTreeName?.GetLocalisation(WpfSettings.LocalizationLanguage) ?? Vehicle.GaijinId;
            _useCountryFlag = Vehicle.Country != Vehicle.Nation.AsEnumerationItem.GetBaseCountry();

            if (Vehicle.IsSquadronVehicle)
            {
                _reseachType = EVehicleResearchType.Squadron;
            }
            else if (Vehicle.IsPremium)
            {
                _reseachType = EVehicleResearchType.Premium;
            }
            else
            {
                _reseachType = EVehicleResearchType.Regular;
            }

            IsToggled = isToggled;

            Initialise();
            ApplyIdleStyle();
        }
        /// <summary> Creates a new main window. </summary>
        /// <param name="presenter"> The presenter to attach. </param>
        /// <param name="guiLoadingWindowPresenter"> An instance of a presenter to communicate with the GUI loading window. </param>
        public MainWindow(IMainWindowPresenter presenter, IGuiLoadingWindowPresenter guiLoadingWindowPresenter)
            : base(EWpfClientLogCategory.MainWindow, null, presenter)
        {
            _initializationStatus = EInitializationStatus.Initializing;
            {
                Log.Trace(ECoreLogMessage.Initialising);

                _loadingTracker = guiLoadingWindowPresenter;
Example #3
0
 public void Initialise(IMainWindowPresenter presenter)
 {
     if (!_initialised && presenter is IMainWindowPresenter)
     {
         _presenter   = presenter;
         _initialised = true;
     }
 }
Example #4
0
 public ResearchTreeCellControl With(IMainWindowPresenter presenter)
 {
     if (!_initialised && presenter is IMainWindowPresenter)
     {
         _presenter   = presenter;
         _initialised = true;
     }
     return(this);
 }
Example #5
0
        public PresentationWindow(IMainWindowPresenter dataContext)
        {
            InitializeComponent();
            context = SynchronizationContext.Current;

            // register callbacks for slide control
            dataContext.NextSlide += (o, args) => context.Post(state => NextSlide(), null);
            dataContext.PreviousSlide += (o, pres) => context.Post(state => PreviousSlide(), null);
            dataContext.SwitchPause += (o, pres) => context.Post(state => SwitchPause(), null);
        }
Example #6
0
        public void Initialise(IMainWindowPresenter presenter)
        {
            if (!_initialised && presenter is IMainWindowPresenter)
            {
                _presenter = presenter;
                _researchTreeControl.Initialise(_presenter);

                _vehicleInformationTab.ToolTip = ApplicationHelpers.LocalisationManager.GetLocalisedString(ELocalisationKey.UnderConstruction);

                ToolTipService.SetShowOnDisabled(_vehicleInformationTab, true);

                _initialised = true;
            }
        }
Example #7
0
        public void Initialise(IMainWindowPresenter presenter)
        {
            if (!_initialised && presenter is IMainWindowPresenter)
            {
                _presenter   = presenter;
                _initialised = true;
            }

            if (_tabControl.SelectedItem == _vehicleCountsTab)
            {
                _vehicleCountsControl.Initialise(this);
                _vehicleListControl.Initialise(_presenter);
            }
        }
Example #8
0
        public void Initialise(IMainWindowPresenter presenter)
        {
            if (!_initialised && presenter is IMainWindowPresenter)
            {
                _presenter = presenter;

                if (_includeHeadersOnCopyCheckBox.IsChecked != _presenter.IncludeHeadersOnRowCopy)
                {
                    _includeHeadersOnCopyCheckBox.IsChecked = _presenter.IncludeHeadersOnRowCopy;

                    SetHeaderCopyBehaviour(_includeHeadersOnCopyCheckBox.IsChecked());
                }

                _includeHeadersOnCopyCheckBox.CommandParameter = _presenter;
                _includeHeadersOnCopyCheckBox.Command          = _presenter.GetCommand(ECommandName.SwitchIncludeHeadersOnRowCopyFlag);

                _initialised = true;
            }
        }
Example #9
0
 public MainWindow(IMainWindowPresenter mainWindowPresenter) : this(new Builder("MainWindow.glade"))
 {
     _mainWindowPresenter = mainWindowPresenter;
 }
Example #10
0
        private void OnMainWindowSourceInitialized(object sender, EventArgs e)
        {
            dataContext = DataContext as IMainWindowPresenter;
            if (dataContext == null) return;

            // register callbacks after window is ready
            dataContext.IsAuthenticated += (o, args) => context.Post(state => HideLoginScreen(), null);
            dataContext.EditPresentation += (o, pres) => context.Post(state => EditPresentation(pres), null);
            dataContext.PresentationList += (o, pres) => context.Post(state => ShowSelectPresentation(pres), null);
            dataContext.PresentationSaved += (o, pres) => context.Post(state => HideEditPresentation(), null);
            dataContext.PresentationDeleted += (o, pres) => context.Post(state => HideEditPresentation(), null);
            dataContext.ShowPresentation += (o, pres) => context.Post(state => ShowPresentation(pres), null);
            dataContext.CancelStartPresentation += (o, args) => context.Post(state => CancelShowPresentation(), null);
            dataContext.GotPresentationSlidesCount += (o, count) => context.Post(state => GotPresentationSlidesCount(count), null);
            dataContext.GotPresentationSlide += (o, args) => context.Post(state => GotPresentationSlide(), null);
        }