Exemple #1
0
        public FileDirDataReader(System.Data.CommandBehavior behavior, FileDirConnection conn, FileDirCommand cmd)
        {
            _fdconn           = conn;
            _fdcmd            = cmd;
            _behavior         = behavior;
            _FilePattern      = _fdcmd.FilePattern;
            _DirectoryPattern = _fdcmd.DirectoryPattern;
            _TrimEmpty        = _fdcmd.TrimEmpty;

            _Data = new object[_Names.Length];                                  // allocate enough room for data

            if (behavior == CommandBehavior.SchemaOnly)
            {
                return;
            }

            string dir = _fdcmd.Directory;

            if (dir == null)
            {
                throw new Exception("Directory parameter must be specified.");
            }

            // Populate the data array
            _RowData = new ArrayList();
            PopulateData(new DirectoryInfo(dir), -1);
            _ie = _RowData.GetEnumerator();
        }
		public FileDirDataReader(System.Data.CommandBehavior behavior, FileDirConnection conn, FileDirCommand cmd)
		{
			_fdconn = conn;
			_fdcmd = cmd;
			_behavior = behavior;
			_FilePattern = _fdcmd.FilePattern;
			_DirectoryPattern = _fdcmd.DirectoryPattern;
			_TrimEmpty = _fdcmd.TrimEmpty;

			_Data = new object[_Names.Length];			// allocate enough room for data

			if (behavior == CommandBehavior.SchemaOnly)
				return;

			string dir = _fdcmd.Directory;
			if (dir == null)
				throw new Exception("Directory parameter must be specified.");

			// Populate the data array
			_RowData = new ArrayList();
			PopulateData(new DirectoryInfo(dir), -1);
			_ie = _RowData.GetEnumerator();
		}