Ejemplo n.º 1
0
        /// <summary>
        /// Gets a reader based on the specified <paramref name="operation"/>
        /// </summary>
        /// <param name="operation">
        /// The operation
        /// </param>
        /// <param name="keyFamily">
        /// The SDMX-ML dataset KeyFamily (i.e. DSD)
        /// </param>
        /// <param name="store">
        /// The <see cref="IDataSetStore"/> in which the dataset will be stored
        /// </param>
        /// <param name="dataflow">
        /// The <see cref="IDataflowObject"/> the dataflow
        /// </param>
        /// <param name="dataLocation">
        /// The <see cref="IReadableDataLocation"/> the data location
        /// </param>
        public static void GetReader(SDMXWSFunction operation, IDataStructureObject keyFamily, IDataSetStore store,
                                     IDataflowObject dataflow, IReadableDataLocation dataLocation)
        {
            switch (operation)
            {
            case SDMXWSFunction.GetCompactData:
                var compact       = new CompactDataReaderEngine(dataLocation, dataflow, keyFamily);
                var readerCompact = new SdmxDataReader(keyFamily, store);
                readerCompact.ReadData(compact);
                break;

            case SDMXWSFunction.GetCrossSectionalData:
                var dsdCrossSectional = (ICrossSectionalDataStructureObject)keyFamily;
                var crossSectional    = new CrossSectionalDataReaderEngine(dataLocation, dsdCrossSectional, dataflow);
                var reader            = new SdmxDataReader(keyFamily, store);
                reader.ReadData(crossSectional);
                break;

            default:
                throw new ArgumentException(Resources.ExceptionUnsupported_operation + operation.ToString(), "operation");
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets a reader based on the specified <paramref name="operation"/>
        /// </summary>
        /// <param name="operation">
        /// The operation
        /// </param>
        /// <param name="keyFamily">
        /// The SDMX-ML dataset KeyFamily (i.e. DSD) 
        /// </param>
        /// <param name="store">
        /// The <see cref="IDataSetStore"/> in which the dataset will be stored
        /// </param>
        /// <param name="dataflow">
        /// The <see cref="IDataflowObject"/> the dataflow
        /// </param>
        /// <param name="dataLocation">
        /// The <see cref="IReadableDataLocation"/> the data location 
        /// </param>
        public static void GetReader(SDMXWSFunction operation, IDataStructureObject keyFamily, IDataSetStore store,
          IDataflowObject dataflow, IReadableDataLocation dataLocation)
        {
            switch (operation)
            {
                case SDMXWSFunction.GetCompactData:
                    var compact = new CompactDataReaderEngine(dataLocation, dataflow, keyFamily);
                    var readerCompact = new SdmxDataReader(keyFamily, store);
                    readerCompact.ReadData(compact);
                    break;

                case SDMXWSFunction.GetCrossSectionalData:
                    var dsdCrossSectional = (ICrossSectionalDataStructureObject)keyFamily;
                    var crossSectional = new CrossSectionalDataReaderEngine(dataLocation, dsdCrossSectional, dataflow);
                    var reader = new SdmxDataReader(keyFamily, store);
                    reader.ReadData(crossSectional);
                    break;

                default:
                    throw new ArgumentException(Resources.ExceptionUnsupported_operation + operation.ToString(), "operation");
            }
        }