Exemplo n.º 1
0
        public void ReadXml(XmlReader reader)
        {
            bool wasEmpty = reader.IsEmptyElement;

            reader.Read();

            if (wasEmpty)
            {
                throw new InvalidOperationException("Tag result is empty");
            }

            reader.ReadStartElement("templateRecord");
            XmlSerializer templateRecordSerializer = new XmlSerializer(this.templateRecord.GetType());

            this.templateRecord = (Database.Record)templateRecordSerializer.Deserialize(reader);
            reader.ReadEndElement();

            reader.ReadStartElement("testedRecord");
            XmlSerializer testedRecordSerializer = new XmlSerializer(this.testedRecord.GetType());

            this.testedRecord = (Database.Record)testedRecordSerializer.Deserialize(reader);
            reader.ReadEndElement();

            XmlSerializer resultSerializer = new XmlSerializer(matchingScores.GetType());

            this.matchingScores = (BIO.Framework.Tools.SerializableDictionary <string, MatchingScore>)resultSerializer.Deserialize(reader);

            reader.ReadEndElement();
        }
Exemplo n.º 2
0
 /// <summary>
 /// construct
 /// </summary>
 /// <param name="r">testing record</param>
 public Result(Database.Record templateR, Database.Record testedR)
 {
     this.templateRecord = templateR;
     this.testedRecord = testedR;
 }
Exemplo n.º 3
0
        public void ReadXml(XmlReader reader)
        {
            bool wasEmpty = reader.IsEmptyElement;
            reader.Read();

            if (wasEmpty) {
                throw new InvalidOperationException("Tag result is empty");
            }

            reader.ReadStartElement("templateRecord");
            XmlSerializer templateRecordSerializer = new XmlSerializer(this.templateRecord.GetType());
            this.templateRecord = (Database.Record)templateRecordSerializer.Deserialize(reader);
            reader.ReadEndElement();

            reader.ReadStartElement("testedRecord");
            XmlSerializer testedRecordSerializer = new XmlSerializer(this.testedRecord.GetType());
            this.testedRecord = (Database.Record)testedRecordSerializer.Deserialize(reader);
            reader.ReadEndElement();

            XmlSerializer resultSerializer = new XmlSerializer(matchingScores.GetType());
            this.matchingScores = (BIO.Framework.Tools.SerializableDictionary<string, MatchingScore>)resultSerializer.Deserialize(reader);

            reader.ReadEndElement();
        }
Exemplo n.º 4
0
 /// <summary>
 /// construct
 /// </summary>
 /// <param name="r">testing record</param>
 public Result(Database.Record templateR, Database.Record testedR)
 {
     this.templateRecord = templateR;
     this.testedRecord   = testedR;
 }