Пример #1
0
        /// <summary>
        /// Create a data reader based on an xml data reader. This mathod looks into the first element
        /// and creates the right reader (Generic, Compact, Utility, CrossSectional).
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <param name="keyFamily">The key family.</param>
        /// <returns>An instance of the DataReader.</returns>
        public static DataReader Create(XmlReader reader, KeyFamily keyFamily)
        {
            Contract.AssertNotNull(reader, "reader");

            if (reader.ReadState == ReadState.Initial)
            {
                reader.Read();
            }

            if (reader.NodeType != XmlNodeType.Element)
            {
                reader.ReadNextStartElement();
            }

            if (reader.LocalName == "CompactData")
            {
                return(new CompactDataReader(reader, keyFamily));
            }
            else if (reader.LocalName == "GenericData")
            {
                return(new GenericDataReader(reader, keyFamily));
            }
            else
            {
                throw new SDMXException("Unsupported root element ({0}) for data file.", reader.LocalName);
            }
        }
Пример #2
0
        internal Group(Id id, KeyFamily keyFamily)
        {
            Contract.AssertNotNull(id, "id");
            Contract.AssertNotNull(keyFamily, "keyFamily");

            Id          = id;
            KeyFamily   = keyFamily;
            Description = new InternationalText();
        }
Пример #3
0
 public DataWriter(StringBuilder stringBuilder, KeyFamily keyFamily)
 {
     KeyFamily = keyFamily;
     XmlWriter = XmlWriter.Create(stringBuilder, new XmlWriterSettings()
     {
         Indent = true
     });
     _validator = new DataValidator(keyFamily);
 }
Пример #4
0
 public DataWriter(TextWriter textWriter, KeyFamily keyFamily)
 {
     KeyFamily = keyFamily;
     XmlWriter = XmlWriter.Create(textWriter, new XmlWriterSettings()
     {
         Indent = true
     });
     _validator = new DataValidator(keyFamily);
 }
Пример #5
0
 public DataValidator(KeyFamily keyFamily)
 {
     KeyFamily = keyFamily;
 }
Пример #6
0
 public CompactDataWriter(Stream stream, KeyFamily keyFamily, XmlWriterSettings settings, string prefix, string targetNamespace)
     : base(stream, keyFamily, settings)
 {
     _prefix          = prefix;
     _targetNamespace = targetNamespace;
 }
Пример #7
0
 public CompactDataWriter(XmlWriter writer, KeyFamily keyFamily, string prefix, string targetNamespace)
     : base(writer, keyFamily)
 {
     _prefix          = prefix;
     _targetNamespace = targetNamespace;
 }
Пример #8
0
 public DataWriter(string path, KeyFamily keyFamily, XmlWriterSettings settings)
 {
     KeyFamily  = keyFamily;
     XmlWriter  = XmlWriter.Create(path, settings);
     _validator = new DataValidator(keyFamily);
 }
Пример #9
0
 public DataWriter(TextWriter textWriter, KeyFamily keyFamily, XmlWriterSettings settings)
 {
     KeyFamily  = keyFamily;
     XmlWriter  = XmlWriter.Create(textWriter, settings);
     _validator = new DataValidator(keyFamily);
 }
Пример #10
0
 public GenericDataWriter(Stream stream, KeyFamily keyFamily, XmlWriterSettings settings)
     : base(stream, keyFamily, settings)
 {
 }
Пример #11
0
 public GenericDataWriter(string path, KeyFamily keyFamily, XmlWriterSettings settings)
     : base(path, keyFamily, settings)
 {
 }
Пример #12
0
 public GenericDataWriter(TextWriter textWriter, KeyFamily keyFamily)
     : base(textWriter, keyFamily)
 {
 }
Пример #13
0
 public GenericDataWriter(StringBuilder stringBuilder, KeyFamily keyFamily)
     : base(stringBuilder, keyFamily)
 {
 }
Пример #14
0
 public GenericDataWriter(XmlWriter writer, KeyFamily keyFamily)
     : base(writer, keyFamily)
 {
 }
Пример #15
0
 public GenericDataWriter(Stream stream, KeyFamily keyFamily)
     : base(stream, keyFamily)
 {
 }
Пример #16
0
 public GenericDataWriter(string path, KeyFamily keyFamily)
     : base(path, keyFamily)
 {
 }
Пример #17
0
 internal DataReader(XmlReader reader, KeyFamily keyFamily)
 {
     XmlReader = reader;
     KeyFamily = keyFamily;
     ThrowExceptionIfNotValid = true;
 }
Пример #18
0
 public GenericDataWriter(StringBuilder stringBuilder, KeyFamily keyFamily, XmlWriterSettings settings)
     : base(stringBuilder, keyFamily, settings)
 {
 }
Пример #19
0
 public DataWriter(XmlWriter writer, KeyFamily keyFamily)
 {
     KeyFamily  = keyFamily;
     XmlWriter  = writer;
     _validator = new DataValidator(keyFamily);
 }
Пример #20
0
 public GenericDataWriter(TextWriter textWriter, KeyFamily keyFamily, XmlWriterSettings settings)
     : base(textWriter, keyFamily, settings)
 {
 }
Пример #21
0
 public MessageGroupReader(string fileName, KeyFamily keyFamily)
     : this(XmlReader.Create(fileName), keyFamily)
 {
 }
Пример #22
0
 public MessageGroupReader(Stream stream, KeyFamily keyFamily)
     : this(XmlReader.Create(stream), keyFamily)
 {
 }
Пример #23
0
 public DataWriter(StringBuilder stringBuilder, KeyFamily keyFamily, XmlWriterSettings settings)
 {
     KeyFamily  = keyFamily;
     XmlWriter  = XmlWriter.Create(stringBuilder, settings);
     _validator = new DataValidator(keyFamily);
 }
Пример #24
0
 public MessageGroupReader(XmlReader xmlReader, KeyFamily keyFamily)
 {
     XmlReader = xmlReader;
     KeyFamily = keyFamily;
     ThrowExceptionIfNotValid = true;
 }
Пример #25
0
 public CompactDataWriter(string path, KeyFamily keyFamily, string prefix, string targetNamespace)
     : base(path, keyFamily)
 {
     _prefix          = prefix;
     _targetNamespace = targetNamespace;
 }
Пример #26
0
 /// <summary>
 /// Create a data reader based on the type of the file. This mathod looks into the first element of the file
 /// and creates the right reader (Generic, Compact, Utility, CrossSectional).
 /// </summary>
 /// <param name="fileName">The file name.</param>
 /// <param name="keyFamily">The key family.</param>
 /// <returns>An instance of the DataReader.</returns>
 public static DataReader Create(string fileName, KeyFamily keyFamily)
 {
     Contract.AssertNotNullOrEmpty(fileName, "fileName");
     return(Create(XmlReader.Create(fileName), keyFamily));
 }
Пример #27
0
 public CompactDataWriter(StringBuilder stringBuilder, KeyFamily keyFamily, string prefix, string targetNamespace)
     : base(stringBuilder, keyFamily)
 {
     _prefix          = prefix;
     _targetNamespace = targetNamespace;
 }
Пример #28
0
 /// <summary>
 /// Create a data reader based on the type of the stream. This mathod looks into the first element of the stream
 /// and creates the right reader (Generic, Compact, Utility, CrossSectional).
 /// </summary>
 /// <param name="stream">The stream.</param>
 /// <param name="keyFamily">The key family.</param>
 /// <returns>An instance of the DataReader.</returns>
 public static DataReader Create(Stream stream, KeyFamily keyFamily)
 {
     Contract.AssertNotNull(stream, "stream");
     return(Create(XmlReader.Create(stream), keyFamily));
 }
Пример #29
0
 public CompactDataWriter(TextWriter textWriter, KeyFamily keyFamily, XmlWriterSettings settings, string prefix, string targetNamespace)
     : base(textWriter, keyFamily, settings)
 {
     _prefix          = prefix;
     _targetNamespace = targetNamespace;
 }
Пример #30
0
 public CompactDataReader(XmlReader xmlReader, KeyFamily keyFamily)
     : base(xmlReader, keyFamily)
 {
 }