Exemple #1
0
        static ColumnIndexes getColumnIndexes(string header)
        {
            var   c     = new ColumnIndexes();
            Regex r     = new Regex("<td(.|\\n)*?</td>");
            var   res   = r.Match(header);
            int   index = 0;

            while (res.Success)
            {
                if (res.Value.IndexOf("Conductor") >= 0)
                {
                    c.ConductorIndex = index;
                }
                else
                if (res.Value.IndexOf("Soloist") >= 0)
                {
                    c.SoloistIndex = index;
                }
                else
                if (res.Value.IndexOf("Version") >= 0)
                {
                    c.VersionIndex = index;
                }
                else
                if (res.Value.IndexOf("Label") >= 0)
                {
                    c.LabelIndex = index;
                }
                else
                if (res.Value.IndexOf("Live") >= 0)
                {
                    c.LabelIndex = index;
                }
                else
                if (res.Value.IndexOf("Rec") >= 0)
                {
                    c.RecDateIndex = index;
                }
                else
                if (res.Value.IndexOf("Year") >= 0)
                {
                    c.YearIndex = index;
                }
                else
                if (res.Value.IndexOf("Orchestra") >= 0)
                {
                    c.OrchestraIndex = index;
                }
                index++;
                res = res.NextMatch();
            }
            return(c);
        }
Exemple #2
0
        static Record getRecord(string s, ColumnIndexes ci)
        {
            if (s == null)
            {
                return(null);
            }
            Regex r      = new Regex("<td(.|\\n)*?</td>");
            var   res    = r.Match(s);
            var   record = new Record();
            int   cnt    = 0;

            while (res.Success)
            {
                if (cnt == ci.YearIndex)
                {
                    record.Year = res.Value.deleteTags();
                }
                else
                if (cnt == ci.ConductorIndex)
                {
                    record.Conductor = res.Value.deleteTags();
                }
                else
                if (cnt == ci.LabelIndex)
                {
                    record.Label = res.Value.deleteTags();
                }
                else
                if (cnt == ci.LiveIndex)
                {
                    record.Live = res.Value.deleteTags();
                }
                else
                if (cnt == ci.OrchestraIndex)
                {
                    record.Orchestra = res.Value.deleteTags();
                }
                else
                if (cnt == ci.RecDateIndex)
                {
                    record.RecDate = res.Value.deleteTags();
                }
                else
                if (cnt == ci.SoloistIndex)
                {
                    record.Soloists = res.Value.deleteTags();
                }
                else
                if (cnt == ci.VersionIndex)
                {
                    record.Version = res.Value.deleteTags();
                }
                cnt++;
                res = res.NextMatch();
            }
            if ((record.Conductor != null) && (record.Conductor != ""))
            {
                var t = extractConductorAndImage(record.Conductor);
                record.Conductor = t.name.Replace("/", "");
                record.Image     = t.image.Replace("/images/", domainURL + "/images/");
            }
            return(record);
        }