PropertyValue Class
Represents a property value.
Inheritance Hierarchy
SystemObject
  GroupDocs.MetadataPropertyValue

Namespace: GroupDocs.Metadata
Assembly: GroupDocs.Metadata (in GroupDocs.Metadata.dll) Version: 19.5
Syntax
public sealed class PropertyValue : IEquatable<PropertyValue>

The PropertyValue type exposes the following members.

Constructors
  NameDescription
Public methodPropertyValue(Boolean)
Initializes a new instance of the PropertyValue class with a boolean value.
Public methodPropertyValue(Byte)
Initializes a new instance of the PropertyValue class with a byte array.
Public methodPropertyValue(DateTime)
Initializes a new instance of the PropertyValue class with a DateTime value.
Public methodPropertyValue(Double)
Initializes a new instance of the PropertyValue class with a double value.
Public methodPropertyValue(Int32)
Initializes a new instance of the PropertyValue class with an integer value.
Public methodPropertyValue(Int64)
Initializes a new instance of the PropertyValue class with a long value.
Public methodPropertyValue(String)
Initializes a new instance of the PropertyValue class with a string value.
Public methodPropertyValue(String)
Initializes a new instance of the PropertyValue class with a string array.
Public methodPropertyValue(TimeSpan)
Initializes a new instance of the PropertyValue class with a TimeSpan value.
Properties
  NameDescription
Public propertyType
Methods
  NameDescription
Public methodEquals(Object)
Indicates whether the current object is equal to another object of the same type.
(Overrides ObjectEquals(Object).)
Public methodEquals(PropertyValue)
Indicates whether the current object is equal to another object of the same type.
Public methodEquals(PropertyValue, Boolean) Obsolete.
Indicates whether the current object is equal to another object of the same type.
Public methodGetHashCode
Returns a hash code for this instance.
(Overrides ObjectGetHashCode.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Public methodToBool
Gets the boolean value.
Public methodToByteArray
Gets the array of Byte values.
Public methodToDateTime
Gets the DateTime value.
Public methodToDouble
Gets the double value.
Public methodToDoubleArray
Gets the array of Double values.
Public methodToInt
Gets the integer value.
Public methodToIntegerArray
Gets the array of Int32 values.
Public methodToLong
Gets the long value.
Public methodToLongArray
Gets the array of Int64 values.
Public methodToMetadata
Gets the Metadata value.
Public methodToMetadataArray
Gets the array of Metadata values.
Public methodToString
Returns a string that represents the property value.
(Overrides ObjectToString.)
Public methodToStringArray
Gets the String array.
Public methodToTimeSpan
Gets the TimeSpan value.
Examples
This example demonstrates how to work with property values.
C#
// path to the MS Word file
string path = @"C:\\example.docx";

// initialize DocFormat
DocFormat docFormat = new DocFormat(path);

// get DocMetadata
DocMetadata metadata = docFormat.DocumentProperties;
foreach (KeyValuePair<string, PropertyValue> keyValuePair in metadata)
{
  string metadataKey = keyValuePair.Key;

// get metadata value by it's key
PropertyValue metadataValue = metadata[metadataKey];

// use appropriate method to show metadata value
switch (metadataValue.Type)
{
 case MetadataPropertyType.Boolean:
 Console.WriteLine("Boolean value: {0}", metadataValue.ToBool());
 break;

 case MetadataPropertyType.DateTime:
 Console.WriteLine("DateTime value: {0}", metadataValue.ToDateTime());
 break;

 case MetadataPropertyType.Double:
 Console.WriteLine("Double value: {0}", metadataValue.ToDouble());
 break;

 case MetadataPropertyType.Integer:
 Console.WriteLine("Integer value: {0}", metadataValue.ToInt());
 break;

 case MetadataPropertyType.String:
 Console.WriteLine("String value: {0}", metadataValue.ToString());
 break;
 }
}
See Also