Пример #1
0
        /// <summary>
        /// Initializes a new <see cref="LengthMeasure" /> based on a <see cref="Energistics.DataAccess.WITSML141.ComponentSchemas.LengthMeasure" />.
        /// </summary>
        /// <param name="lengthMeasure">The WITSML 1.4.1.1 LengthMeasure</param>
        public LengthMeasure(Energistics.DataAccess.WITSML141.ComponentSchemas.LengthMeasure lengthMeasure)
        {
            lengthMeasure.NotNull(nameof(lengthMeasure));

            _lengthMeasure141 = lengthMeasure;
            DataSchemaVersion = OptionsIn.DataVersion.Version141.Value;
        }
Пример #2
0
        /// <summary>
        /// Initializes a new <see cref="LengthMeasure" /> based on either a <see cref="Energistics.DataAccess.WITSML131.ComponentSchemas.LengthMeasure" />
        /// or a <see cref="Energistics.DataAccess.WITSML141.ComponentSchemas.LengthMeasure" />.
        /// </summary>
        /// <param name="lengthMeasure">The WITSML 1.3.1.1 or 1.4.1.1 LengthMeasure</param>
        public LengthMeasure(object lengthMeasure)
        {
            lengthMeasure.NotNull(nameof(lengthMeasure));

            if (lengthMeasure is Energistics.DataAccess.WITSML131.ComponentSchemas.LengthMeasure)
            {
                _lengthMeasure131 = (Energistics.DataAccess.WITSML131.ComponentSchemas.LengthMeasure)lengthMeasure;
                DataSchemaVersion = OptionsIn.DataVersion.Version131.Value;
            }
            else if (lengthMeasure is Energistics.DataAccess.WITSML141.ComponentSchemas.LengthMeasure)
            {
                _lengthMeasure141 = (Energistics.DataAccess.WITSML141.ComponentSchemas.LengthMeasure)lengthMeasure;
                DataSchemaVersion = OptionsIn.DataVersion.Version141.Value;
            }
            else
            {
                throw new ArgumentException(@"Not a WITSML 1.3.1.1 or WITSML 1.4.1.1 LengthMeasure", nameof(lengthMeasure));
            }
        }