コード例 #1
0
 /// <summary>
 /// Generates an object from its XML representation.
 /// </summary>
 /// <param name="reader">The XmlReader stream from which the object is deserialized. </param>
 public void ReadXml(System.Xml.XmlReader reader)
 {
     version = int.Parse(reader.GetAttribute("Version"));
     Term    = reader.GetAttribute("Term");
     NumberOfArtifactsContainingTerm = int.Parse(reader.GetAttribute("NoOfArtsWithTerm"));
     TotalFrequencyAcrossArtifacts   = int.Parse(reader.GetAttribute("TotalFrequency"));
     Weight = double.Parse(reader.GetAttribute("Weight"));
     reader.Read();
     while (reader.NodeType != System.Xml.XmlNodeType.EndElement)
     {
         TLPosting posting = new TLPosting();
         posting.ReadXml(reader);
         AddPosting(posting);
     }
     //read to the next
     reader.Read();
 }
コード例 #2
0
 /// <summary>
 /// Generates an object from its XML representation.
 /// </summary>
 /// <param name="reader">The XmlReader stream from which the object is deserialized. </param>
 public void ReadXml(System.Xml.XmlReader reader)
 {
     version = int.Parse(reader.GetAttribute("Version"));
     Term = reader.GetAttribute("Term");
     NumberOfArtifactsContainingTerm = int.Parse(reader.GetAttribute("NoOfArtsWithTerm"));
     TotalFrequencyAcrossArtifacts = int.Parse(reader.GetAttribute("TotalFrequency"));
     Weight = double.Parse(reader.GetAttribute("Weight"));
     reader.Read();
     while (reader.NodeType != System.Xml.XmlNodeType.EndElement)
     {
         TLPosting posting = new TLPosting();
         posting.ReadXml(reader);
         AddPosting(posting);
     }
     //read to the next
     reader.Read();
 }