Exemple #1
0
        /// <summary>
        /// Internal metadata read process.
        /// </summary>
        /// <param name="pToFill"></param>
        /// <param name="pElement"></param>
        protected override void InternalRead(ref IMetadata pToFill, XElement pElement)
        {
            ABoundableMetadata <int> lToFill = pToFill as ABoundableMetadata <int>;

            XAttribute lXMin = pElement.Attribute(cMetadataMinTag);

            if (lXMin != null)
            {
                int lMin;
                if (int.TryParse(lXMin.Value, out lMin))
                {
                    lToFill.Min = lMin;
                }
            }

            XAttribute lXMax = pElement.Attribute(cMetadataMaxTag);

            if (lXMax != null)
            {
                int lMax;
                if (int.TryParse(lXMax.Value, out lMax))
                {
                    lToFill.Max = lMax;
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Internal metadata read process.
        /// </summary>
        /// <param name="pToFill"></param>
        /// <param name="pElement"></param>
        protected override void InternalRead(ref IMetadata pToFill, XElement pElement)
        {
            ABoundableMetadata <double> lToFill = pToFill as ABoundableMetadata <double>;

            XAttribute lXMin = pElement.Attribute(cMetadataMinTag);

            if (lXMin != null)
            {
                double lMin;
                if (double.TryParse(lXMin.Value, NumberStyles.Float, CultureInfo.InvariantCulture, out lMin))
                {
                    lToFill.Min = lMin;
                }
            }

            XAttribute lXMax = pElement.Attribute(cMetadataMaxTag);

            if (lXMax != null)
            {
                double lMax;
                if (double.TryParse(lXMax.Value, NumberStyles.Float, CultureInfo.InvariantCulture, out lMax))
                {
                    lToFill.Max = lMax;
                }
            }
        }