Table of Contents

SummaryInformation Class

Definition

Namespace
Bodu.IO.Compound.PropertySets
Assembly
Bodu.IO.Compound.dll
Package
Bodu.IO.Compound 1.0.0
Source
SummaryInformation.cs

Provides a strongly-typed view over the standard summary-information property set (\x05SummaryInformation) of a compound file.

public sealed class SummaryInformation
Inheritance
SummaryInformation
Inherited Members
Extension Methods

Remarks

The summary-information set carries document metadata such as the title, author, and revision times. Each property is optional; a property that is absent or of an unexpected type is surfaced as null.

The following example reads the standard summary-information set from a compound file and prints a few fields.
using Bodu.IO.Compound;
using Bodu.IO.Compound.PropertySets;

using CompoundFile file = CompoundFile.OpenRead("book.xls");
if (file.TryGetSummaryInformation(out SummaryInformation? summary))
{
    Console.WriteLine($"Title:   {summary.Title}");
    Console.WriteLine($"Author:  {summary.Author}");
    Console.WriteLine($"Created: {summary.CreateTime:u}");
}

Constructors

SummaryInformation(OlePropertySet)

Initializes a new instance of the SummaryInformation class over a parsed property set.

public SummaryInformation(OlePropertySet propertySet)

Parameters

propertySet OlePropertySet

The parsed summary-information property set.

Exceptions

ArgumentNullException

Thrown when propertySet is null.

Fields

StreamName

The directory name of the summary-information stream, including its control prefix.

public const string StreamName = "\u0005SummaryInformation"

Field Value

string

Properties

ApplicationName

Gets the name of the application that created the document.

public string? ApplicationName { get; }

Property Value

string

The application name, or null when absent.

Author

Gets the document author.

public string? Author { get; }

Property Value

string

The author, or null when absent.

CharacterCount

Gets the character count.

public int? CharacterCount { get; }

Property Value

int?

The character count, or null when absent.

Comments

Gets the document comments.

public string? Comments { get; }

Property Value

string

The comments, or null when absent.

CreateTime

Gets the time the document was created.

public DateTimeOffset? CreateTime { get; }

Property Value

DateTimeOffset?

The creation time, or null when absent.

Keywords

Gets the document keywords.

public string? Keywords { get; }

Property Value

string

The keywords, or null when absent.

LastAuthor

Gets the name of the user who last saved the document.

public string? LastAuthor { get; }

Property Value

string

The last author, or null when absent.

LastPrinted

Gets the time the document was last printed.

public DateTimeOffset? LastPrinted { get; }

Property Value

DateTimeOffset?

The last-printed time, or null when absent.

LastSaveTime

Gets the time the document was last saved.

public DateTimeOffset? LastSaveTime { get; }

Property Value

DateTimeOffset?

The last-saved time, or null when absent.

PageCount

Gets the page count.

public int? PageCount { get; }

Property Value

int?

The page count, or null when absent.

PropertySet

Gets the underlying parsed property set.

public OlePropertySet PropertySet { get; }

Property Value

OlePropertySet

The summary-information OlePropertySet.

RevisionNumber

Gets the document revision number.

public string? RevisionNumber { get; }

Property Value

string

The revision number, or null when absent.

Security

Gets the document security flags.

public int? Security { get; }

Property Value

int?

The security value, or null when absent.

Subject

Gets the document subject.

public string? Subject { get; }

Property Value

string

The subject, or null when absent.

Template

Gets the document template name.

public string? Template { get; }

Property Value

string

The template name, or null when absent.

Title

Gets the document title.

public string? Title { get; }

Property Value

string

The title, or null when absent.

TotalEditTime

Gets the total editing time.

public TimeSpan? TotalEditTime { get; }

Property Value

TimeSpan?

The total editing time, or null when absent.

WordCount

Gets the word count.

public int? WordCount { get; }

Property Value

int?

The word count, or null when absent.

Methods

Read(Stream)

Reads and parses a summary-information property set from a stream, consuming it to the end.

public static SummaryInformation Read(Stream stream)

Parameters

stream Stream

The stream containing the summary-information property-set bytes.

Returns

SummaryInformation

A SummaryInformation view over the parsed property set.

Exceptions

ArgumentNullException

Thrown when stream is null.

CompoundFileFormatException

Thrown when the data is not a well-formed property set.

Applies to

ProductVersions
.NET8, 10