Beispiel #1
0
            Dictionary<string, string> GetDetails(IEnumerator i, ref HtmlElement c)
            {
                Dictionary<string, string> details = new Dictionary<string, string>();
                string key = null;
                string value = null;
                bool isFirst = true;

                while (c != null)
                {
                    if (!isFirst && c.HasAttribute("title")) { break; }
                    isFirst = false;
                    try
                    {
                        var subRow = c.Children[4].Children[0].Children[0].Children[0];
                        string newKey = subRow.Children[0].InnerText.FirstWord();
                        string newValue = subRow.Children[1].InnerText.Trim();
                        if (String.IsNullOrEmpty(newKey))
                        {
                            value = value + "\r\n" + newValue;
                        }
                        else
                        {
                            if (!String.IsNullOrEmpty(key))
                            {
                                details[key] = value;
                            }
                            key = newKey;
                            value = newValue;
                        }
                    }
                    catch (Exception)
                    {
                    }

                    c = i.MoveNext() ? (HtmlElement)i.Current : null;
                }

                if (!String.IsNullOrEmpty(key))
                {
                    details[key] = value;
                }

                return details;
            }