Esempio n. 1
0
        public void SetSelected(IOddLn oddToDo, bool bIsSelected)
        {
            IBetDomainLn bdmnSelected = m_bdmnSelected;

            if (bIsSelected)
            {
                // Check if operation is valid
                if (LineSr.AllowMultiway)
                {
                    ExcpHelper.ThrowIf <InvalidOperationException>(bdmnSelected != null && bdmnSelected.BetDomainId != oddToDo.BetDomain.BetDomainId, "Cannot select {0} because other betdomain already selected {1}", this, bdmnSelected);
                }
                else
                {
                    IOddLn oddSelected = null;

                    if (bdmnSelected != null)
                    {
                        SyncList <IOddLn> lSelectedOdds = bdmnSelected.GetSelectedOdds();

                        if (lSelectedOdds.Count > 0)
                        {
                            oddSelected = lSelectedOdds[0];
                        }
                    }

                    ExcpHelper.ThrowIf <InvalidOperationException>(bdmnSelected != null, "Cannot select {0} because other odd already selected {1}", this, oddSelected);
                }
            }

            oddToDo.BetDomain.SetSelected(oddToDo, bIsSelected);

            m_bdmnSelected = oddToDo.BetDomain.GetSelectedOdds().Count > 0 ? oddToDo.BetDomain : null;

            if (bdmnSelected != m_bdmnSelected)
            {
                this.MatchView.DoPropertyChanged("IsSelected");
            }

            var lMatchBetDomains = this.GetSortedBetDomains();

            foreach (var bdmn in lMatchBetDomains)
            {
                bdmn.NotifyOddsEnabledChanged();
            }
        }
Esempio n. 2
0
        public IBetDomainLn GetBaseBetDomain()
        {
            IBetDomainLn bdmnWINFT  = null;
            IBetDomainLn bdmnWINFTR = null;

            this.BetDomains.SafelyForEach(delegate(BetDomainLn bdmn)
            {
                //  System.Diagnostics.Debug.WriteLine(bdmn.BetTag.Value + " " + bdmn.GetDisplayName(DalStationSettings.DEFAULT_LANGUAGE) + "  " + bdmn.BetDomainType);
                if (bdmn.BetTag == BetDomainTypeLn.BET_TAG_WINFT)
                {
                    bdmnWINFT = bdmn;
                }

                if (bdmn.BetTag == BetDomainTypeLn.BET_TAG_WINFTR)
                {
                    bdmnWINFTR = bdmn;
                }

                return(false);
            });
            //System.Diagnostics.Debug.WriteLine("**********************");
            return(bdmnWINFT != null ? bdmnWINFT : bdmnWINFTR);
        }
Esempio n. 3
0
 public void MergeFrom(IBetDomainLn objSource)
 {
     throw new NotImplementedException();
 }