Esempio 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 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);
        }
Esempio n. 2
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 LabelMapItem FromProto(RawProto rp)
        {
            LabelMapItem item = new LabelMapItem();
            string       strVal;

            if ((strVal = rp.FindValue("name")) != null)
            {
                item.name = strVal;
            }

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

            if ((strVal = rp.FindValue("display")) != null)
            {
                item.display = strVal;
            }

            return(item);
        }
Esempio n. 3
0
 /// <summary>
 /// Copy the source object.
 /// </summary>
 /// <param name="src">Specifies the source data.</param>
 public void Copy(LabelMapItem src)
 {
     m_strName    = src.m_strName;
     m_strDisplay = src.m_strDisplay;
     m_nLabel     = src.m_nLabel;
 }