Example #1
0
        private List<string> m_List = null; // 索引列表

        #endregion Fields

        #region Constructors

        //-------------------------------------
        public DBFItor(DBFInterface data)
        {
            if (data == null)
                return;

            m_Data = data;
            m_List = data.List();
            m_iPos = 0;
        }
Example #2
0
        private int m_iPos           = 0;    // 目前位置
        //-------------------------------------
        public DBFItor(DBFInterface data)
        {
            if (data == null)
            {
                return;
            }

            m_Data = data;
            m_List = data.List();
            m_iPos = 0;
        }
Example #3
0
        /**
         * @brief 新增dbf
         * @param szName dbf名稱
         * @param szClass 類別名稱(包括命名空間與類別名稱, 用 . 分隔)
         * @param szComponent 組件名稱
         * @param szFilePath 檔名路徑
         * @return true表示成功, false則否
         */
        public bool Add(string szName, string szClass, string szComponent, string szFilePath)
        {
            try
            {
                string szType  = szClass + ", " + szComponent + ", Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";
                Type   TypeDBF = Type.GetType(szType);

                if (TypeDBF == null)
                {
                    throw new Exception("can't found dbf type(" + szType + ")");
                }

                Type TypeGeneric = typeof(DBFUnit <>).MakeGenericType(new Type[] { TypeDBF });

                if (TypeGeneric == null)
                {
                    throw new Exception("make generic type failed(" + szType + ")");
                }

                DBFInterface Data = (DBFInterface)Activator.CreateInstance(TypeGeneric);

                if (Data == null)
                {
                    throw new Exception("create dbf loader failed(" + szType + ")");
                }

                if (Data.Load(szFilePath) == false)
                {
                    throw new Exception("load failed");
                }

                m_Data.Add(szName, Data);

                return(true);
            }//try

            catch (Exception e)
            {
                return(Output.Error(this, "add dbf filed [" + szName + "] [" + e.Message + "]"));
            }//catch
        }