Exemplo n.º 1
0
        /// <summary>
        /// Parses the parameter from a RawProto.
        /// </summary>
        /// <param name="rp">Specifies the RawProto to parse.</param>
        /// <returns>A new instance of the parameter is returned.</returns>
        public static new MaskParameter FromProto(RawProto rp)
        {
            MaskParameter p = new MaskParameter(true);
            string        strVal;

            RawProto rpOption = rp.FindChild("option");

            if (rpOption != null)
            {
                ((OptionalParameter)p).Copy(OptionalParameter.FromProto(rpOption));
            }

            if ((strVal = rp.FindValue("boundary_left")) != null)
            {
                p.boundary_left = int.Parse(strVal);
            }

            if ((strVal = rp.FindValue("boundary_right")) != null)
            {
                p.boundary_right = int.Parse(strVal);
            }

            if ((strVal = rp.FindValue("boundary_top")) != null)
            {
                p.boundary_top = int.Parse(strVal);
            }

            if ((strVal = rp.FindValue("boundary_bottom")) != null)
            {
                p.boundary_bottom = int.Parse(strVal);
            }

            return(p);
        }
        /// <summary>
        /// Copies the specified source data label mapping parameter to this one.
        /// </summary>
        /// <param name="src">Specifies the source data label mapping parameter.</param>
        public override void Copy(OptionalParameter src)
        {
            base.Copy(src);

            if (src is DataLabelMappingParameter)
            {
                DataLabelMappingParameter p = (DataLabelMappingParameter)src;
                m_rgMapping = p.m_rgMapping.Clone();
            }
        }
        /// <summary>
        /// Parses the parameter from a RawProto.
        /// </summary>
        /// <param name="rp">Specifies the RawProto to parse.</param>
        /// <returns>A new instance of the parameter is returned.</returns>
        public static OptionalParameter FromProto(RawProto rp)
        {
            string            strVal;
            OptionalParameter p = new OptionalParameter();

            if ((strVal = rp.FindValue("active")) != null)
            {
                p.Active = bool.Parse(strVal);
            }

            return(p);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Copy the source object.
        /// </summary>
        /// <param name="src">Specifies the source data.</param>
        public override void Copy(OptionalParameter src)
        {
            base.Copy(src);

            if (src is MaskParameter)
            {
                MaskParameter p = (MaskParameter)src;
                m_nMaskLeft   = p.m_nMaskLeft;
                m_nMaskRight  = p.m_nMaskRight;
                m_nMaskTop    = p.m_nMaskTop;
                m_nMaskBottom = p.m_nMaskBottom;
            }
        }
        /// <summary>
        /// Parses the parameter from a RawProto.
        /// </summary>
        /// <param name="rp">Specifies the RawProto to parse.</param>
        /// <returns>A new instance of the parameter is returned.</returns>
        public static new DataLabelMappingParameter FromProto(RawProto rp)
        {
            DataLabelMappingParameter p = new DataLabelMappingParameter(true);

            RawProto rpOption = rp.FindChild("option");

            if (rpOption != null)
            {
                ((OptionalParameter)p).Copy(OptionalParameter.FromProto(rpOption));
            }

            p.m_rgMapping = LabelMappingCollection.Parse(rp.FindArray <string>("mapping"));

            return(p);
        }
 /// <summary>
 /// Copy the source object.
 /// </summary>
 /// <param name="src">Specifies the source data.</param>
 public virtual void Copy(OptionalParameter src)
 {
     m_bActive = src.m_bActive;
 }