示例#1
0
        /// <summary>
        /// Return a copy of this object.
        /// </summary>
        /// <returns>A new copy of the object is returned.</returns>
        public LabelMap Clone()
        {
            LabelMap p = new LabelMap();

            p.Copy(this);
            return(p);
        }
示例#2
0
        /// <summary>
        /// Copy the source object.
        /// </summary>
        /// <param name="src">Specifies the source data.</param>
        public void Copy(LabelMap src)
        {
            m_rgItems = new List <LabelMapItem>();

            foreach (LabelMapItem item in src.item)
            {
                m_rgItems.Add(item.Clone());
            }
        }
示例#3
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 LabelMap FromProto(RawProto rp)
        {
            LabelMap p = new LabelMap();

            RawProtoCollection col = rp.FindChildren("item");

            foreach (RawProto child in col)
            {
                LabelMapItem item = LabelMapItem.FromProto(child);
                p.item.Add(item);
            }

            return(p);
        }