Exemplo n.º 1
0
        /// <summary>
        /// Check if an option listed at the object level is already known and add it otherwise.
        /// </summary>
        private void AddOption(string value)
        {
            if (string.IsNullOrEmpty(value))
            {
                return;
            }

            string[] keys = value.Split(new char[] { '|' });
            foreach (string key in keys)
            {
                bool known = Options.Values.Any(o => o.Label == key || o.Key == key);
                if (!known)
                {
                    GenericPostureOption option = new GenericPostureOption(key, key, false, false);
                    Options.Add(key, option);
                }
            }
        }
Exemplo n.º 2
0
        private void ParseOptions(XmlReader r)
        {
            r.ReadStartElement();

            while (r.NodeType == XmlNodeType.Element)
            {
                if (r.Name == "Option")
                {
                    GenericPostureOption option = new GenericPostureOption(r);
                    if (!Options.ContainsKey(option.Key))
                    {
                        Options.Add(option.Key, option);
                    }
                }
                else
                {
                    string outerXml = r.ReadOuterXml();
                    log.DebugFormat("Unparsed content in XML: {0}", outerXml);
                }
            }

            r.ReadEndElement();
        }