예제 #1
0
        public BetDomainsViewModel()
        {
            PlaceBet = new Command <IOddVw>(OnBet);
            //Mediator.SendMessage<bool>(true, MsgTag.BlockSportFilter);
            //Mediator.SendMessage<bool>(true, MsgTag.BlockTimeFilter);
            Mediator.Register <string>(this, LanguageChosen, MsgTag.LanguageChosenHeader);
            Mediator.Register <string>(this, HeaderShowFirstView, MsgTag.RefreshStation);

            var scroller = this.GetScrollviewer();

            if (scroller != null)
            {
                scroller.ScrollToVerticalOffset(0);
            }

            ScrollChangedCommand = new Command <double>(ScrollChanged);

            if (StationRepository.IsStatisticsEnabled && MatchInfo == null && !ChangeTracker.CurrentMatch.IsLiveBet)
            {
                MatchInfo = new MatchStatistic(ChangeTracker.CurrentMatch.LineObject.BtrMatchId, ChangeTracker.CurrentMatch.TournamentView.LineObject.GroupTournament.BtrTournamentId);
            }

            if (ChangeTracker.CurrentMatch != null)
            {
                ChangeTracker.CurrentMatch.IsStartUp = true;
            }
            LineSr.SubsribeToEvent(DataCopy_DataSqlUpdateSucceeded);
            timer.Elapsed += timer_Tick;
            timer.Start();
            ChangeTracker.IsBetdomainViewOpen = true;
        }
 public TopTournamentsViewModel()
 {
     LayoutUpdatedCommand = new Command <double>(LayoutUpdated);
     ScrollChangedCommand = new Command <double>(ScrollChanged);
     CheckedBox           = new Command <TournamentVw>(OnCheckedExecute);
     Choice = new Command <TournamentVw>(OnChoiceExecute);
     LineSr.SubsribeToEvent(LineSr_DataSqlUpdateSucceeded);
 }
 public override void OnNavigationCompleted()
 {
     SelectedTournaments = ChangeTracker.SelectedTournaments;
     Mediator.Register <string>(this, OnLanguageChosenExecute, MsgTag.LanguageChosen);
     Mediator.Register <bool>(this, Refresh, MsgTag.Refresh);
     //Mediator.SendMessage<bool>(false, MsgTag.BlockTimeFilter);
     FillTournaments();
     LineSr.SubsribeToEvent(LineSr_DataSqlUpdateSucceeded);
     ChangeTracker.SelectedSports = true;
     base.OnNavigationCompleted();
 }
예제 #4
0
        public MatchesViewModel(params object[] args)
        {
            _ScrollViewerModule = new ScrollViewerModule(Dispatcher);

            BindingOperations.EnableCollectionSynchronization(_matches, _itemsLock);
            BindingOperations.EnableCollectionSynchronization(_sportsBarItemsPreMatch, _itemsLock2);
            OpenMatch         = new Command <IMatchVw>(OnChoiceExecute);
            OpenOutrightMatch = new Command <IMatchVw>(OnOutrightChoiceExecute);

            Mediator.Register <string>(this, OnLanguageChosenExecute, MsgTag.LanguageChosen);
            Mediator.Register <bool>(this, Refresh, MsgTag.Refresh);
            Mediator.Register <string>(this, HeaderShowFirstView, MsgTag.RefreshStation);
            Mediator.Register <bool>(this, ClearSelectedSports, MsgTag.ClearSelectedSports);
            //Mediator.Register<bool>(this, ShowSelectedTournaments, MsgTag.ShowSelectedTournaments);
            PreMatchScrollChangedCommand = new Command(PreMatchScrollChanged);
            PreMatchScrollLoadedCommand  = new Command <System.Windows.Controls.ScrollViewer>(PreMatchScrollLoaded);

            PlaceBet             = new Command <IOddVw>(OnBet);
            ScrollChangedCommand = new Command <double>(ScrollChanged);

            ScrollLeftStart  = new Command(OnScrollLeftStart);
            ScrollRightStart = new Command(OnScrollRightStart);
            CheckedBox       = new Command <SportBarItem>(OnCheckedExecute);

            ElementsVisibility     = Visibility.Collapsed;
            MainElementsVisibility = Visibility.Visible;

            if (args.Length > 0 && args[0] is HashSet <string> )
            {
                SelectedTournaments = args[0] as HashSet <string>;
            }

            if (args.Length > 0 && args[0] is int)
            {
                if ((int)args[0] == 1)
                {
                    MainElementsVisibility = Visibility.Collapsed;
                    ElementsVisibility     = Visibility.Visible;
                }
            }



            var scroller = this.GetScrollviewer();

            if (scroller != null)
            {
                scroller.ScrollToVerticalOffset(0);
            }
            //selected tournaments handling

            LineSr.SubsribeToEvent(LineSr_DataSqlUpdateSucceeded);
        }
예제 #5
0
        public HeaderViewModel()
        {
            //FillComboBoxes();



            Mediator.Register <string>(this, OpenLogin, MsgTag.OpenLogin);
            Mediator.Register <string>(this, LanguageChosen, MsgTag.LanguageChosenHeader);
            Mediator.Register <string>(this, ShowFirstViewAndResetFilters, MsgTag.ShowFirstViewAndResetFilters);
            //Mediator.Register<string>(this, ResetFilters, MsgTag.ResetFilters);
            //Mediator.Register<bool>(this, BlockTimeFilter, MsgTag.BlockTimeFilter);
            Mediator.Register <long>(this, LockStation, MsgTag.LockStation);
            Mediator.Register <bool>(this, ShowResultFilter, MsgTag.ShowResultFilters);
            Mediator.Register <bool>(this, ActivateForwardSelected, MsgTag.ActivateForwardSelected);
            Mediator.Register <bool>(this, ActivateShowSelected, MsgTag.ActivateShowSelected);
            Mediator.Register <bool>(this, NavigateBack, MsgTag.NavigateBack);


            IsSportFilterEnabled      = true;
            ShowMenuCommand           = new Command(OnShowMenu);
            OpenPlaceBetCommand       = new Command(OpenPlaceBetWindow);
            OpenAuthorizationCommand  = new Command(OpenAuthorizationWindow);
            OpenUserProfile           = new Command(OpenProfile);
            ShowCashViewCommand       = new Command(ShowCash);
            PrintCreditNoteCommand    = new Command(AskPrintCreditNote);
            InsertCreditNoteCommand   = new Command(InsertCreditNote);
            RestoreTicketCommand      = new Command(RestoreTicket);
            DoSearchCommand           = new Command(DoSearch);
            ShowResultsViewCommand    = new Command(ShowResultsViewModel);
            ShowCategoriesViewCommand = new Command(ShowSports);
            ShowLiveViewCommand       = new Command(ShowLiveView);
            PrevView = new Command(OnPrevViewExecute);
            NextView = new Command(OnNextViewExecute);
            ShowEntertainmentCommand     = new Command(ShowEntertainment);
            ExitTestMode                 = new Command(onExitTestMode);
            _forwardButtonText           = TranslationProvider.Translate(MultistringTags.TERMINAL_NAVIGATION_FORWARD) as string;
            _forwardButtonImagePath      = "BreadcrumbsCenter.png";
            _forwardButtonLeftImagePath  = "BreadcrumbsButtonLeft.png";
            _forwardButtonRightImagePath = "BreadcrumbsRight.png";
            LogoutCommand                = new Command(OnLogoutQuestion);
            OpenAnonymousSessionFromHeader();
            ResultsTimeCommand = new Command <string>(OnResultsTimeCommand);
            LiveModeCommand    = new Command <string>(OnLiveModeCommand);

            TopTournamentsCommand = new Command(OnTopTournamentsCommand);
            LastMinuteCommand     = new Command(OnLastMinuteCommand);
            TodaysOfferCommand    = new Command(OnTodaysOfferCommand);
            AllSportsCommand      = new Command(OnAllSportsCommand);
            IsTimeFilterEnabled   = true;
            InitCashin();

            LineSr.SubsribeToEvent(DataCopy_DataSqlUpdateSucceeded);
        }
        public CategoriesViewModel()
        {
            BindingOperations.EnableCollectionSynchronization(_categories, _itemsLock);

            Choice = new Command <long>(OnChoiceExecute);
            ScrollChangedCommand = new Command <double>(ScrollChanged);
            LayoutUpdatedCommand = new Command <double>(LayoutUpdated);
            Mediator.Register <string>(this, OnLanguageChosenExecute, MsgTag.LanguageChosen);
            Mediator.Register <bool>(this, Refresh, MsgTag.Refresh);
            Mediator.Register <string>(this, HeaderShowFirstView, MsgTag.RefreshStation);

            LineSr.SubsribeToEvent(LineSr_DataSqlUpdateSucceeded);
        }
예제 #7
0
        public VFLViewModel()
        {
            NextPageCmd          = new Command(NextPage);
            PreviousPageCmd      = new Command(PrevPage);
            OpenVflPage          = new Command <VFLMatchButton>(OnOpenVflPage);
            OpenMatch            = new Command <IMatchVw>(OnChoiceExecute);
            PlaceBet             = new Command <IOddVw>(OnBet);
            ScrollChangedCommand = new Command <double>(ScrollChanged);

            _timer          = new DispatcherTimer(DispatcherPriority.Background);
            _timer.Interval = new TimeSpan(0, 0, 1);
            _timer.Tick    += Timer_Elapsed;
            _timer.Start();
            LineSr.SubsribeToEvent(DataCopy_DataSqlUpdateSucceeded);
        }
예제 #8
0
        public CategoriesViewModel()
        {
            Category._instances.Clear();
            BindingOperations.EnableCollectionSynchronization(_categories, _itemsLock);

            TournamentChoice     = new Command <TournamentVw>(OnTournamentChoiceExecute);
            CountryChoice        = new Command <object>(OnCountryChoiceExecute);
            Choice               = new Command <long>(OnChoiceExecute);
            PlaceBet             = new Command <IOddVw>(OnBet);
            OpenMatch            = new Command <IMatchVw>(OnChoiceExecute);
            ScrollChangedCommand = new Command <double>(ScrollChanged);
            LayoutUpdatedCommand = new Command <double>(LayoutUpdated);
            Mediator.Register <string>(this, OnLanguageChosenExecute, MsgTag.LanguageChosen);
            Mediator.Register <bool>(this, Refresh, MsgTag.Refresh);
            Mediator.Register <string>(this, HeaderShowFirstView, MsgTag.RefreshStation);

            LineSr.SubsribeToEvent(LineSr_DataSqlUpdateSucceeded);
        }
예제 #9
0
        public override void OnNavigationCompleted()
        {
            ChangeTracker.SelectedLive          = true;
            ChangeTracker.LiveSelectedAllSports = true;

            if (disabledLive)
            {
                LineSr.SubsribeToEvent(DataCopy_DataSqlUpdateSucceeded);
                disabledLive = false;
            }

            Mediator.SendMessage(true, MsgTag.ActivateForwardSelected);
            Mediator.Register <bool>(this, ChangeOffset, MsgTag.OffsetChanged);
            Mediator.Register <string>(this, HeaderShowFirstView, MsgTag.RefreshStation);
            Mediator.Register <string>(this, OnLanguageChosenExecute, MsgTag.LiveLanguageChosen);
            Mediator.Register <bool>(this, Refresh, MsgTag.Refresh);
            Mediator.Register <bool>(this, ClearSelectedSports, MsgTag.ClearSelectedSports);

            base.OnNavigationCompleted();
            UpdateSorting();

            Dispatcher.Invoke((Action)(() =>
            {
                var window = (Window)GetActiveWindow();
                if (window != null)
                {
                    window.Focus();
                }
            }));
            Mediator.SendMessage <bool>(true, MsgTag.UpdateLiveMonitorTemplates);

            Update();
            //ClearSelectedSports(true);

            //FillSportsBar();

            //CheckSportBarButtons();
        }
예제 #10
0
        public VHCViewModel()
        {
            if (ChangeTracker.VhcSelectedType == null)
            {
                ChangeTracker.VhcSelectedType = VHCType.WinPlace;
            }
            _winVisibility      = Visibility.Visible;
            _invertedVisibility = Visibility.Collapsed;

            onWinPlacePressed = new Command(OpenWinPlace);
            onForecastPressed = new Command(OpenForecast);
            onTricastPressed  = new Command(OpenTricast);

            PlaceBet = new Command <IOddVw>(OnBet);

            PreviousPageCmd = new Command(PrevPage);
            NextPageCmd     = new Command(NextPage);

            OpenVHCHelpCommand = new Command(OpenVHCHelp);

            ScrollChangedCommand = new Command <double>(ScrollChanged);
            LineSr.SubsribeToEvent(DataCopy_DataSqlUpdateSucceeded);
        }
예제 #11
0
        public BetDomainsViewModel()
        {
            PlaceBet = new Command <IOddVw>(OnBet);
            //Mediator.SendMessage<bool>(true, MsgTag.BlockSportFilter);
            //Mediator.SendMessage<bool>(true, MsgTag.BlockTimeFilter);
            Mediator.Register <string>(this, LanguageChosen, MsgTag.LanguageChosenHeader);
            Mediator.Register <string>(this, HeaderShowFirstView, MsgTag.RefreshStation);

            var scroller = this.GetScrollviewer();

            if (scroller != null)
            {
                scroller.ScrollToVerticalOffset(0);
            }

            ScrollChangedCommand = new Command <double>(ScrollChanged);

            if (StationRepository.IsStatisticsEnabled && MatchInfo == null && !ChangeTracker.CurrentMatch.IsLiveBet)
            {
                MatchInfo = new MatchStatistic(ChangeTracker.CurrentMatch.LineObject.BtrMatchId, ChangeTracker.CurrentMatch.TournamentView.LineObject.GroupTournament.BtrTournamentId);
            }

            if (ChangeTracker.CurrentMatch != null)
            {
                ChangeTracker.CurrentMatch.IsStartUp = true;
            }

            switch (ChangeTracker.CurrentMatch.SportDescriptor)
            {
            case SportSr.SPORT_DESCRIPTOR_SOCCER:
                BackgroundBrush = new LinearGradientBrush()
                {
                    StartPoint = new System.Windows.Point(0, 0), EndPoint = new System.Windows.Point(0, 1)
                };
                BackgroundBrush.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#FF3F8145"), 1));
                BackgroundBrush.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#FF90C696"), 0));
                PicturePath    = (BitmapImage) new ResolveImagePath("LiveView/socker-ball.png").ProvideValue(null);
                BackgroundPath = (BitmapImage) new ResolveImagePath("LiveView/socker-fon.png").ProvideValue(null);
                SimpleColor    = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#008000"));
                break;

            case SportSr.SPORT_DESCRIPTOR_BASKETBALL:
                BackgroundBrush = new LinearGradientBrush()
                {
                    StartPoint = new System.Windows.Point(0, 0), EndPoint = new System.Windows.Point(0, 1)
                };
                BackgroundBrush.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#AF6828"), 1));
                BackgroundBrush.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#D8A362"), 0));
                PicturePath    = (BitmapImage) new ResolveImagePath("LiveView/Basket-ball.png").ProvideValue(null);
                BackgroundPath = (BitmapImage) new ResolveImagePath("LiveView/Basketball-fon.png").ProvideValue(null);
                SimpleColor    = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#AF6828"));
                break;

            case SportSr.SPORT_DESCRIPTOR_ICE_HOCKEY:
                BackgroundBrush = new LinearGradientBrush()
                {
                    StartPoint = new System.Windows.Point(0, 0), EndPoint = new System.Windows.Point(0, 1)
                };
                BackgroundBrush.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#1A5181"), 1));
                BackgroundBrush.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#73B0D8"), 0));
                PicturePath    = (BitmapImage) new ResolveImagePath("LiveView/hockey-ball.png").ProvideValue(null);
                BackgroundPath = (BitmapImage) new ResolveImagePath("LiveView/Hokkey-fon.png").ProvideValue(null);
                SimpleColor    = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#1A5181"));
                break;

            case SportSr.SPORT_DESCRIPTOR_TENNIS:
                BackgroundBrush = new LinearGradientBrush()
                {
                    StartPoint = new System.Windows.Point(0, 0), EndPoint = new System.Windows.Point(0, 1)
                };
                BackgroundBrush.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#979F0D"), 1));
                BackgroundBrush.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#DDE04A"), 0));
                PicturePath    = (BitmapImage) new ResolveImagePath("LiveView/tennis-ball.png").ProvideValue(null);
                BackgroundPath = (BitmapImage) new ResolveImagePath("LiveView/tennis-fon.png").ProvideValue(null);
                SimpleColor    = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#DDE04A"));
                break;

            case SportSr.SPORT_DESCRIPTOR_HANDBALL:
                BackgroundBrush = new LinearGradientBrush()
                {
                    StartPoint = new System.Windows.Point(0, 0), EndPoint = new System.Windows.Point(0, 1)
                };
                BackgroundBrush.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#C8C8CA"), 1));
                BackgroundBrush.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#F4F4F4"), 0));
                PicturePath    = (BitmapImage) new ResolveImagePath("LiveView/hand-ball.png").ProvideValue(null);
                BackgroundPath = (BitmapImage) new ResolveImagePath("LiveView/handball-fon.png").ProvideValue(null);
                SimpleColor    = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#EFEFDA"));
                break;

            case SportSr.SPORT_DESCRIPTOR_RUGBY:
                BackgroundBrush = new LinearGradientBrush()
                {
                    StartPoint = new System.Windows.Point(0, 0), EndPoint = new System.Windows.Point(0, 1)
                };
                BackgroundBrush.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#963D2D"), 1));
                BackgroundBrush.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#989E98"), 0));
                PicturePath    = (BitmapImage) new ResolveImagePath("LiveView/rugby-ball.png").ProvideValue(null);
                BackgroundPath = (BitmapImage) new ResolveImagePath("LiveView/rugby-fon.png").ProvideValue(null);
                SimpleColor    = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#E86F25"));
                break;

            case SportSr.SPORT_DESCRIPTOR_VOLLEYBALL:
                BackgroundBrush = new LinearGradientBrush()
                {
                    StartPoint = new System.Windows.Point(0, 0), EndPoint = new System.Windows.Point(0, 1)
                };
                BackgroundBrush.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#3685D3"), 1));
                BackgroundBrush.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#FDC903"), 0));
                PicturePath    = (BitmapImage) new ResolveImagePath("LiveView/volley-ball.png").ProvideValue(null);
                BackgroundPath = (BitmapImage) new ResolveImagePath("LiveView/volleyball-fon.png").ProvideValue(null);
                SimpleColor    = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#E8C425"));
                break;
            }

            LineSr.SubsribeToEvent(DataCopy_DataSqlUpdateSucceeded);
            timer.Elapsed += timer_Tick;
            timer.Start();
            ChangeTracker.IsBetdomainViewOpen = true;
        }