Beispiel #1
0
        public UploadParam(string fileName)
        {
            var file = new FileInfo(fileName);
            var ext  = file.Extension.ToLower();

            Directory = file.DirectoryName;
            Name      = Path.GetFileNameWithoutExtension(file.Name);
            Progress  = 0;
            IsPlanned = false;

            switch (ext)
            {
            case ".cfg":
                ExtractSourceDataTypeFromConfigFile(fileName);
                break;

            case ".csv":
                goto default;

            case ".kml":
                Type = SourceDataType.Kml;
                _dataLoaderParams = Kml.KmlToTablesDataLoaderParams.FromFile(this);
                break;

            default:
                Type = SourceDataType.Csv;
                _dataLoaderParams = CsvToTablesDataLoaderParams.FromFile(this);
                break;
            }
        }
Beispiel #2
0
        public void RefreshDataLoaderParams()
        {
            switch (_type)
            {
            case SourceDataType.Csv:
                goto default;

            case SourceDataType.DbfAndKml:
                //_dataLoaderParams = DbaseKml.DbaseKmlToTablesDataLoaderParams.FromFile(this);
                break;

            case SourceDataType.Kml:
                _dataLoaderParams = Kml.KmlToTablesDataLoaderParams.FromFile(this);
                break;

            default:
                _dataLoaderParams = CsvToTablesDataLoaderParams.FromFile(this);
                break;
            }
        }
Beispiel #3
0
        public UploadParam(SourceDataType type)
        {
            Type      = type;
            IsPlanned = true;

            switch (type)
            {
            case SourceDataType.Csv:
                _dataLoaderParams = CsvToTablesDataLoaderParams.FromFile(this);
                break;

            case SourceDataType.DbfAndKml:
                break;

            case SourceDataType.Kml:
                _dataLoaderParams = Kml.KmlToTablesDataLoaderParams.FromFile(this);
                break;

            default:
                throw new InvalidOperationException();
            }
        }