示例#1
0
 private static void WriteGroups(XmlWriter writer, NzbFile file)
 {
     writer.WriteStartElement(NzbKeywords.Groups);
     foreach (string group in file.Groups)
     {
         writer.WriteElementString(NzbKeywords.Group, group);
     }
     writer.WriteEndElement();
 }
示例#2
0
        private static async Task WriteGroupsAsync(XmlWriter writer, NzbFile file)
        {
            await writer.WriteStartElementAsync(null, NzbKeywords.Groups, null);

            foreach (string group in file.Groups)
            {
                await writer.WriteElementStringAsync(null, NzbKeywords.Group, null, group);
            }
            await writer.WriteEndElementAsync();
        }
示例#3
0
 private static void WriteSegments(XmlWriter writer, NzbFile file)
 {
     writer.WriteStartElement(NzbKeywords.Segments);
     foreach (NzbSegment segment in file.Segments)
     {
         writer.WriteStartElement(NzbKeywords.Segment);
         writer.WriteAttributeString(NzbKeywords.Bytes, segment.Size.ToString(CultureInfo.InvariantCulture));
         writer.WriteAttributeString(NzbKeywords.Number, segment.Number.ToString(CultureInfo.InvariantCulture));
         writer.WriteString(segment.MessageId.Value);
         writer.WriteEndElement();
     }
     writer.WriteEndElement();
 }
示例#4
0
        private static async Task WriteSegmentsAsync(XmlWriter writer, NzbFile file)
        {
            await writer.WriteStartElementAsync(null, NzbKeywords.Segments, null);

            foreach (NzbSegment segment in file.Segments)
            {
                await writer.WriteStartElementAsync(null, NzbKeywords.Segment, null);

                await writer.WriteAttributeStringAsync(null, NzbKeywords.Bytes, null, segment.Size.ToString(CultureInfo.InvariantCulture));

                await writer.WriteAttributeStringAsync(null, NzbKeywords.Number, null, segment.Number.ToString(CultureInfo.InvariantCulture));

                await writer.WriteStringAsync(segment.MessageId.Value);

                await writer.WriteEndElementAsync();
            }
            await writer.WriteEndElementAsync();
        }