DiagramPackage

DiagramPackage class

Represents a native metadata package in a diagram format.

public class DiagramPackage : DocumentPackage

Properties

Name Description
AlternateNames { get; set; } Gets or sets the alternate names for the document. Can be updated in VDX and VSX formats only.
BuildNumberCreated { get; } Gets the full build number of the instance used to create the document.
BuildNumberEdited { get; } Gets the build number of the instance last used to edit the document.
Category { get; set; } Gets or sets the descriptive text for the type of drawing, such as flowchart or office layout. This text can also be entered in the Microsoft Visio user interface in the Category box in the Properties dialog box.
Company { get; set; } Gets or sets the user-entered information identifying the company creating the drawing or the company the drawing is being created for. Maximum length is 63 characters.
Count { get; } Gets the number of metadata properties.
Creator { get; set; } Gets or sets the person who created or last updated the file. The maximum length is 63 characters..
Description { get; set; } Gets or sets a descriptive text string for the document. Use this element to store important information about the document, such as its purpose, recent changes, or pending changes. The maximum is 191 characters.
HyperlinkBase { get; set; } Gets or sets the path to be used for relative hyperlinks (hyperlinks for which the linked file location is described in relation to the Microsoft Visio diagram). By default, a hyperlink path is relative to the current document unless a different path is specified in this element. Maximum length is 256 characters.
Item { get; } Gets the MetadataProperty with the specified name.
Keys { get; } Gets a collection of the metadata property names.
Keywords { get; set; } Gets or sets a text string that identifies topics or other important information about the file, such as project name, client name, or version number. The maximum string length is 63 characters.
Language { get; set; } Gets or sets the language of the document. Can be updated in VSD and VSDX formats only.
Manager { get; set; } Gets or sets a user-entered text string identifying the person in charge of the project or department. The maximum length is 63 characters.
MetadataType { get; } Gets the metadata type.
PreviewPicture { get; set; } Gets or sets the preview picture.
PropertyDescriptors { get; } Gets a collection of descriptors that contain information about properties accessible through the GroupDocs.Metadata search engine.
Subject { get; set; } Gets or sets a user-defined text string that describes the contents of the document. Maximum length is 63 characters.
Template { get; set; } Gets or sets a string value specifying the file name of the template from which the document was created.
TimeCreated { get; set; } Gets or sets a date and time value indicating when the document was created.
TimeEdited { get; } Gets a date and time value indicating when the document was last edited.
TimePrinted { get; } Gets a date and time value indicating when the document was last printed.
TimeSaved { get; } Gets a date and time value indicating when the document was last saved.
Title { get; set; } Gets or sets a user-defined text string that serves as a descriptive title for the document. Maximum length is 63 characters.

Methods

Name Description
AddProperties(Func<MetadataProperty, bool>, PropertyValue) Adds known metadata properties satisfying the specified predicate. The operation is recursive so it affects all nested packages as well.
Clear() Removes all writable metadata properties from the package.
ClearBuiltInProperties() Removes all built-in metadata properties.
ClearCustomProperties() Removes all custom metadata properties.
Contains(string) Determines whether the package contains a metadata property with the specified name.
virtual FindProperties(Func<MetadataProperty, bool>) Finds the metadata properties satisfying the specified predicate. The search is recursive so it affects all nested packages as well.
GetEnumerator() Returns an enumerator that iterates through the collection.
Remove(string) Removes a writable metadata property by the specified name.
virtual RemoveProperties(Func<MetadataProperty, bool>) Removes metadata properties satisfying the specified predicate.
virtual Sanitize() Removes writable metadata properties from the package. The operation is recursive so it affects all nested packages as well.
Set(string, bool) Adds or replaces the metadata property with the specified name.
Set(string, DateTime) Adds or replaces the metadata property with the specified name.
Set(string, double) Adds or replaces the metadata property with the specified name.
Set(string, string) Adds or replaces the metadata property with the specified name.
SetProperties(Func<MetadataProperty, bool>, PropertyValue) Sets known metadata properties satisfying the specified predicate. The operation is recursive so it affects all nested packages as well. This method is a combination of AddProperties and UpdateProperties. If an existing property satisfies the predicate its value is updated. If there is a known property missing in the package that satisfies the predicate it is added to the package.
UpdateProperties(Func<MetadataProperty, bool>, PropertyValue) Updates known metadata properties satisfying the specified predicate. The operation is recursive so it affects all nested packages as well.

Remarks

Learn more

Examples

This code sample demonstrates how to extract built-in metadata properties from a diagram.

using (Metadata metadata = new Metadata(Constants.InputVsdx))
{
    var root = metadata.GetRootPackage<DiagramRootPackage>();

    Console.WriteLine(root.DocumentProperties.Creator);
    Console.WriteLine(root.DocumentProperties.Company);
    Console.WriteLine(root.DocumentProperties.Keywords);
    Console.WriteLine(root.DocumentProperties.Language);
    Console.WriteLine(root.DocumentProperties.TimeCreated);
    Console.WriteLine(root.DocumentProperties.Category);

    // ... 
}

See Also