コード例 #1
0
    /// <summary>
    /// Parses a DocumentReference element.
    /// </summary>
    DocumentReference ParseDocumentReference()
    {
      Debug.Assert(this.reader.Name == "DocumentReference");
      bool isEmptyElement = this.reader.IsEmptyElement;
      DocumentReference documentReference = new DocumentReference();
      while (MoveToNextAttribute())
      {
        switch (this.reader.Name)
        {
          case "Source":
            documentReference.Source = this.reader.Value;
            break;

          default:
            UnexpectedAttribute(this.reader.Name);
            break;
        }
      }
      MoveToNextElement();
      return documentReference;
    }
コード例 #2
0
        /// <summary>
        /// Parses a FixedDocumentSequence element.
        /// </summary>
        FixedDocumentSequence ParseFixedDocumentSequence()
        {
            Debug.Assert(this.reader.Name == "FixedDocumentSequence");
            bool isEmptyElement         = this.reader.IsEmptyElement;
            FixedDocumentSequence fdseq = new FixedDocumentSequence();

            while (MoveToNextAttribute())
            {
                switch (this.reader.Name)
                {
                default:
                    //UnexpectedAttribute();
                    break;
                }
            }
            if (!isEmptyElement)
            {
                MoveToNextElement();
                while (this.reader.IsStartElement())
                {
                    switch (this.reader.Name)
                    {
                    case "DocumentReference":
                    {
                        PdfSharp.Xps.XpsModel.DocumentReference dref = ParseDocumentReference();
                        //Debug.WriteLine("Path: " + (path.Name != null ? path.Name : ""));
                        fdseq.DocumentReferences.Add(dref);
                    }
                    break;

                    default:
                        Debugger.Break();
                        break;
                    }
                }
            }
            MoveToNextElement();
            return(fdseq);
        }