Beispiel #1
0
        /**
	 * Will create whichever of SummaryInformation
	 *  and DocumentSummaryInformation (HPSF) properties
	 *  are not already part of your document.
	 * This is normally useful when creating a new
	 *  document from scratch.
	 * If the information properties are already there,
	 *  then nothing will happen.
	 */
        public void CreateInformationProperties()
        {
            if (!initialized) ReadProperties();
            if (sInf == null)
            {
                sInf = PropertySetFactory.CreateSummaryInformation();
            }
            if (dsInf == null)
            {
                dsInf = PropertySetFactory.CreateDocumentSummaryInformation();
            }
        }
Beispiel #2
0
        /// <summary>
        /// Find, and Create objects for, the standard
        /// Documment Information Properties (HPSF).
        /// If a given property Set is missing or corrupt,
        /// it will remain null;
        /// </summary>
        protected void ReadProperties()
        {
            PropertySet ps;

            // DocumentSummaryInformation
            ps = GetPropertySet(DocumentSummaryInformation.DEFAULT_STREAM_NAME);
            if (ps != null && ps is DocumentSummaryInformation)
            {
                dsInf = (DocumentSummaryInformation)ps;
            }
            else if (ps != null)
            {
                //logger.Log(POILogger.WARN, "DocumentSummaryInformation property Set came back with wrong class - ", ps.GetType());
            }

            // SummaryInformation
            ps = GetPropertySet(SummaryInformation.DEFAULT_STREAM_NAME);
            if (ps is SummaryInformation)
            {
                sInf = (SummaryInformation)ps;
            }
            else if (ps != null)
            {
                //logger.Log(POILogger.WARN, "SummaryInformation property Set came back with wrong class - ", ps.GetType());
            }

            // Mark the fact that we've now loaded up the properties
            initialized = true;
        }