コード例 #1
0
        public override void RemoveMetadata(TempFileForActions tempFile, CleanActionPropertySet cleanProperties)
        {
            CMetadataElements elementsToClean = GetMetaDataElementsToClean(cleanProperties);
            CExcludedMetadataElements excludedElements = GetMetaDataElementsToExclude(cleanProperties);
            
            CMetadataElements reviewersOnlyElements = new CMetadataElements();
            reviewersOnlyElements.SelectNoElements();
            reviewersOnlyElements["Reviewers"].Enabled = elementsToClean["Reviewers"].Enabled;

            int lDttm = 0;
            bool bExcludeSaveDate = FieldIsExcluded(excludedElements, "savedate");

            if (elementsToClean["DocumentStatistics"].Enabled && !bExcludeSaveDate)   // if zeroed, do not re-zero
            {
                lDttm = -1; // don't bother with dttm Revision
            }

            // We clean reviews on the binary level first to get ride of them correctly.

            if (!(bool) cleanProperties[CleanOption.SkipDomCleaning].Value)
            {
                lDttm = ExecuteStrategy3(tempFile.TempFile, lDttm, reviewersOnlyElements, excludedElements, "Metawall.WordBinaryStripper");
                DoDomRemoval(tempFile.TempFile, cleanProperties);
            }

            // Clean all binary metadata again, the DOM clean would have inserted some metadata.
            ExecuteStrategy3(tempFile.TempFile, lDttm, elementsToClean, excludedElements, "Metawall.WordBinaryStripper");
        }