Ejemplo n.º 1
0
        private void LoadGuideTypeConfig(string stPath)
        {
            ScpReader reader = new ScpReader(stPath, true, 2);

            m_guideTypeDic = new Dictionary <int, SSchemeGuideType>();
            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                int    nTypeId       = reader.GetInt(i, (int)EConsumptionGuideConfig.ECGC_COL_TYPE, 0);
                string strGuideName  = reader.GetString(i, (int)EConsumptionGuideConfig.ECGC_COL_NAME, "");
                string strGuideTitle = reader.GetString(i, (int)EConsumptionGuideConfig.ECGC_COL_TITLE, "");
                string strGuideDesc  = reader.GetString(i, (int)EConsumptionGuideConfig.ECGC_COL_DESC, "");
                int    nWndId        = reader.GetInt(i, (int)EConsumptionGuideConfig.ECGC_COL_WND, 0);

                if (!m_guideTypeDic.ContainsKey(nTypeId))
                {
                    SSchemeGuideType guideType = new SSchemeGuideType();
                    guideType.nTypeId       = nTypeId;
                    guideType.strGuideName  = strGuideName;
                    guideType.strGuideTitle = strGuideTitle;
                    guideType.guideWndList  = new List <SSchemeGuideWnd>();
                    m_guideTypeDic.Add(nTypeId, guideType);
                }
                SSchemeGuideWnd guideWnd = new SSchemeGuideWnd();
                guideWnd.nGuideDesc = strGuideDesc;
                guideWnd.nGuideWnd  = nWndId;
                m_guideTypeDic[nTypeId].guideWndList.Add(guideWnd);
            }
        }
Ejemplo n.º 2
0
        public SSchemeGuideType GetGuideType(int nTypeId)
        {
            SSchemeGuideType scheme = null;

            if (m_guideTypeDic.TryGetValue(nTypeId, out scheme))
            {
                return(scheme);
            }

            return(null);
        }