Exemple #1
0
        public SyncList <MatchToGroupLn> RemoveByMatch(MatchLn match)
        {
            SyncList <MatchToGroupLn> lResult = new SyncList <MatchToGroupLn>();

            lock (m_oLocker)
            {
                SyncList <GroupLn> lGroups = m_diMatchToGroups.GetObjectList(match.MatchId);

                if (lGroups != null)
                {
                    foreach (var group in lGroups)
                    {
                        string sKey = MatchToGroupLn.GetKeyName(match.MatchId, @group.GroupId);

                        if (m_di.ContainsKey(sKey))
                        {
                            MatchToGroupLn mtog = m_di[sKey];
                            m_di.Remove(sKey);

                            lResult.Add(mtog);

                            SyncList <MatchLn> lMatches = this.GetGroupMatches(@group.GroupId);

                            if (lMatches != null)
                            {
                                lMatches.Remove(match);
                            }
                        }
                    }
                }
            }

            return(lResult);
        }
Exemple #2
0
        private void RemoveMatchWithoutCleaning(MatchLn match)
        {
            var lMatchBetDomains = match.BetDomains.Clone();

            foreach (var betDomain in lMatchBetDomains)
            {
                RemoveBetDomain(betDomain);
            }

            if (match.LiveMatchInfo != null)
            {
                m_diAll.LiveMatchInfos.Remove(match.MatchId);
                m_diObjectsToRemove.SafelyAddObject(match.LiveMatchInfo);
            }

            SyncList <MatchToGroupLn> lMatchesToGroups = m_diAll.MatchesToGroups.RemoveByMatch(match);

            foreach (MatchToGroupLn mtog in lMatchesToGroups)
            {
                m_diObjectsToRemove.SafelyAddObject(mtog);
            }

            if (match.outright_type != eOutrightType.None)
            {
                m_diAll.CompetitorsToOutright.RemoveByOutrightMatchId(match.MatchId);
            }



            // Remove Match
            m_diAll.Matches.Remove(match.MatchId);
            m_diObjectsToRemove.SafelyAddObject(match);
        }
Exemple #3
0
        public override MatchToGroupLn MergeLineObject(MatchToGroupLn objSource)
        {
            MatchToGroupLn objMerged = base.MergeLineObject(objSource);

            GroupLn group = LineSr.Instance.AllObjects.Groups.GetObject(objMerged.GroupId);
            MatchLn match = LineSr.Instance.AllObjects.Matches.GetObject(objMerged.MatchId);

            Debug.Assert(group != null);
            Debug.Assert(match != null);

            m_diMatchToGroups.SafelyAddObjectToList(objMerged.MatchId, group);
            m_diGroupToMatchs.SafelyAddObjectToList(objMerged.GroupId, match);

            return(objMerged);
        }
Exemple #4
0
        public void RemoveMatch(MatchLn match)
        {
            var lMatchBetDomains = match.BetDomains.Clone();

            foreach (var betDomain in lMatchBetDomains)
            {
                RemoveBetDomain(betDomain);
            }

            if (match.LiveMatchInfo != null)
            {
                m_diAll.LiveMatchInfos.Remove(match.MatchId);
                m_diObjectsToRemove.SafelyAddObject(match.LiveMatchInfo);
            }

            SyncList <MatchToGroupLn> lMatchesToGroups = m_diAll.MatchesToGroups.RemoveByMatch(match);

            foreach (MatchToGroupLn mtog in lMatchesToGroups)
            {
                m_diObjectsToRemove.SafelyAddObject(mtog);
            }

            if (match.outright_type != eOutrightType.None)
            {
                m_diAll.CompetitorsToOutright.RemoveByOutrightMatchId(match.MatchId);
            }



            // Remove Match
            m_diAll.Matches.Remove(match.MatchId);
            m_diObjectsToRemove.SafelyAddObject(match);


            //m_logger.DebugFormat("Removed from Line {0}", match);
        }
Exemple #5
0
 public BetDomainList(MatchLn mtchOwner)
     : base()
 {
     Debug.Assert(mtchOwner != null);
     m_match = mtchOwner;
 }
Exemple #6
0
        private static void MatchIdFromFileFound(long lFoundLong, params object[] args)
        {
            MatchLn mtch = args[0] as MatchLn;

            m_logger.InfoFormat("SearchMatches() found pointed {0}", mtch);
        }
Exemple #7
0
        private static void SearchMatchImp(HashSet <IMatchVw> hsMatches, SyncList <IMatchVw> lMatchesToSync, MatchLn mtch, DelegateFilterMatches dfm)
        {
            if (dfm == null || dfm(mtch))
            {
                hsMatches.Add(mtch.MatchView);

                if (!lMatchesToSync.Contains(mtch.MatchView))
                {
                    lMatchesToSync.Add(mtch.MatchView);
                }
            }
        }