Пример #1
0
        // ********************************************************************************
        /// <summary>
        ///
        /// </summary>
        /// <param name="props"></param>
        /// <returns></returns>
        /// <created>UPh,31.10.2015</created>
        /// <changed>UPh,31.10.2015</changed>
        // ********************************************************************************
        public void AppendProperties(TermInfo.Properties props)
        {
            if (props == null)
            {
                return;
            }
            if (!string.IsNullOrEmpty(props.Definition))
            {
                AppendDefinition(props.Definition);
            }

            if (props.Status != TermStatus.none)
            {
                if (props.Status == TermStatus.prohibited)
                {
                    AppendValueWithImage("Status", props.Status.ToString(), "Prohibited");
                }
                else
                {
                    AppendValue("Status", props.Status.ToString());
                }
            }

            if (props.Values != null)
            {
                foreach (var value in props.Values)
                {
                    AppendValue(value.Key, value.Value);
                }
            }

            _SB.AppendLine("");
        }
Пример #2
0
        // ********************************************************************************
        /// <summary>
        ///
        /// </summary>
        /// <param name="node"></param>
        /// <param name="props"></param>
        /// <returns></returns>
        /// <created>UPh,31.10.2015</created>
        /// <changed>UPh,31.10.2015</changed>
        // ********************************************************************************
        private void ReadProps(XmlNode node, ref TermInfo.Properties props)
        {
            foreach (XmlNode nodeDescrip in node.SelectNodes("./descripGrp/descrip"))
            {
                XmlAttribute attType = nodeDescrip.Attributes["type"];
                if (attType == null)
                {
                    continue;
                }

                if (props == null)
                {
                    props = new TermInfo.Properties();
                }

                if (!props.TrySetDefinition(attType.InnerText, nodeDescrip.InnerText) &&
                    !props.TrySetStatus(attType.InnerText, nodeDescrip.InnerText))
                {
                    props.AddValue(attType.InnerText, nodeDescrip.InnerText);
                }
            }

            foreach (XmlNode nodeDescrip in node.SelectNodes("./descrip"))
            {
                XmlAttribute attType = nodeDescrip.Attributes["type"];
                if (attType == null)
                {
                    continue;
                }

                if (props == null)
                {
                    props = new TermInfo.Properties();
                }

                if (!props.TrySetDefinition(attType.InnerText, nodeDescrip.InnerText) &&
                    !props.TrySetStatus(attType.InnerText, nodeDescrip.InnerText))
                {
                    props.AddValue(attType.InnerText, nodeDescrip.InnerText);
                }
            }
        }