Exemple #1
0
 /// <summary>
 /// Creates section 2 if it is not alReady present.
 /// </summary>
 private void EnsureSection2()
 {
     if (SectionCount < 2)
     {
         MutableSection s2 = new MutableSection();
         s2.SetFormatID(SectionIDMap.DOCUMENT_SUMMARY_INFORMATION_ID2);
         AddSection(s2);
     }
 }
        /// <summary>
        /// Creates a new document summary information.
        /// </summary>
        /// <returns>the new document summary information.</returns>
        public static DocumentSummaryInformation CreateDocumentSummaryInformation()
        {
            MutablePropertySet ps = new MutablePropertySet();
            MutableSection     s  = (MutableSection)ps.FirstSection;

            s.SetFormatID(SectionIDMap.DOCUMENT_SUMMARY_INFORMATION_ID1);
            try {
                return(new DocumentSummaryInformation(ps));
            }
            catch (UnexpectedPropertySetTypeException ex) {
                /* This should never happen. */
                throw new HPSFRuntimeException(ex);
            }
        }