Пример #1
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM MUTABLE OBJECTS              //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="DataSourceCore"/> class.
        /// </summary>
        /// <param name="datasource">
        /// The datasource. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        public DataSourceCore(IDataSourceMutableObject datasource, ISdmxStructure parent)
            : base(datasource, parent)
        {
            this._dataUrl = datasource.DataUrl;
            this._wsdlUrl = datasource.WSDLUrl;
            this._isRestDatasource = datasource.RESTDatasource;
            this._isSimpleDatasource = datasource.SimpleDatasource;
            this._isWebServiceDatasource = datasource.WebServiceDatasource;
            this.Validate();
        }
 /// <summary>
 /// The add data sources.
 /// </summary>
 /// <param name="dataSourceMutableObject">
 /// The dataSourceMutableObject. 
 /// </param>
 public virtual void AddDataSources(IDataSourceMutableObject dataSourceMutableObject)
 {
     if (dataSourceMutableObject != null)
     {
         this._dataSources.Add(dataSourceMutableObject);
     }
 }
        /// <summary>
        /// Write Data source
        /// </summary>
        /// <param name="dataSource">
        /// The IDataSourceMutableObject to write
        /// </param>
        protected void WriteDataSource(IDataSourceMutableObject dataSource)
        {
            if (dataSource != null)
            {
                this.WriteStartElement(this.DefaultNS, ElementNameTable.Datasource);
                this.TryToWriteElement(this.DefaultNS, ElementNameTable.SimpleDatasource, dataSource.SimpleDatasource);
                {
                    this.WriteStartElement(this.DefaultNS, ElementNameTable.QueryableDatasource);
                    this.WriteAttribute(AttributeNameTable.isRESTDatasource, dataSource.RESTDatasource);
                    this.WriteAttribute(AttributeNameTable.isWebServiceDatasource, dataSource.WebServiceDatasource);
                    this.TryToWriteElement(this.DefaultNS, ElementNameTable.DataUrl, dataSource.DataUrl);
                    this.TryToWriteElement(this.DefaultNS, ElementNameTable.WSDLUrl, dataSource.WSDLUrl);
                    this.WriteEndElement();
                }

                this.WriteEndElement();
            }
        }