示例#1
0
        public static void EnsureInstance()
        {
            if (m_instance == null)
            {
                try
                {
                    m_instance = new BetDomainMap();

                    ExcpHelper.ThrowIf(!File.Exists(DalStationSettings.Instance.BetDomainMap), "BetDomain Map file does not exist {0}");

                    m_instance.m_di = new SyncDictionary <int, BetDomainMapItem>();

                    m_instance.m_doc = new XmlDocument();
                    m_instance.m_doc.Load(DalStationSettings.Instance.BetDomainMap);

                    GenerateTypes(typeof(BetTypeLn), m_instance.m_doc.SelectNodes("map/betType"), GenerateBetType);
                    GenerateTypes(typeof(ScoreTypeLn), m_instance.m_doc.SelectNodes("map/scoreType"), GenerateScoreType);
                    GenerateTypes(typeof(TimeTypeLn), m_instance.m_doc.SelectNodes("map/timeType"), GenerateTimeType);
                    GenerateTypes(typeof(BetDomainTypeLn), m_instance.m_doc.SelectNodes("map/betDomainType"), GenerateBetDomainType);
                }
                catch (Exception excp)
                {
                    m_logger.Excp(excp, "Cannot create instance");
                }
            }
        }
示例#2
0
 public static void Clear()
 {
     m_instance = null;
 }