Ejemplo n.º 1
0
        public void Show(ServerEntry server)
        {
            ServerEntry = server;

            if (!ReferenceEquals(DataContext, this))
            {
                DataContext = this;
                InitializeComponent();
                Show();

                Owner = Application.Current?.MainWindow;

                _timer = new DispatcherTimer {
                    Interval  = TimeSpan.FromSeconds(1),
                    IsEnabled = true
                };
                _timer.Tick += OnTick;
            }

            Car   = server.SelectedCarEntry?.CarObject;
            Track = server.Track;

            try {
                _ignoreSkinChange = true;
                Skin = server.GetSelectedCarSkin();
            } finally {
                _ignoreSkinChange = false;
            }

            Buttons = new[] {
                CreateExtraStyledDialogButton("Go.Button", AppStrings.Common_Go, () => ServerEntry?.JoinCommand.Execute(ServerEntry.ActualJoin), () => Ready),
                CancelButton
            };
        }
Ejemplo n.º 2
0
        public void OnUpdate(BookingResult response)
        {
            if (response?.IsSuccessful != true)
            {
                return;
            }

            Car   = ServerEntry.SelectedCarEntry?.CarObject;
            Track = ServerEntry.Track;

            try {
                _ignoreSkinChange = true;
                Skin = ServerEntry.GetSelectedCarSkin();
            } finally {
                _ignoreSkinChange = false;
            }
        }