Aspose::Cells::Properties::IDocumentProperty Class Referenceabstract

Represents a custom or built-in document property. More...

Inherits Object.

Public Member Functions

virtual intrusive_ptr< Aspose::Cells::Systems::String > GetName ()=0
 Returns the name of the property. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Object > GetValue ()=0
 Gets the value of the property. More...
 
virtual void SetValue (intrusive_ptr< Aspose::Cells::Systems::Object > value)=0
 Sets the value of the property. More...
 
virtual bool IsLinkedToContent ()=0
 Indicates whether this property is linked to content More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetSource ()=0
 The linked content source. More...
 
virtual Aspose::Cells::Properties::PropertyType GetType ()=0
 Gets the data type of the property. More...
 
virtual bool IsGeneratedName ()=0
 Returns true if this property does not have a name in the OLE2 storage and a unique name was generated only for the public API. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > ToString ()=0
 Returns the property value as a string. More...
 
virtual Aspose::Cells::Systems::Int32 ToInt ()=0
 Returns the property value as integer. More...
 
virtual Aspose::Cells::Systems::Double ToDouble ()=0
 Returns the property value as double. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::DateTime > ToDateTime ()=0
 Returns the property value as DateTime in local time zone. More...
 
virtual bool ToBool ()=0
 Returns the property value as bool. More...
 

Detailed Description

Represents a custom or built-in document property.

[C++]
//Instantiate an IWorkbook object, which must contains document property
intrusive_ptr<Aspose::Cells::IWorkbook> workbook = Factory::CreateIWorkbook(new String("C:\\book1.xls"));
//Retrieve a list of all custom document properties of the Excel file
intrusive_ptr<Aspose::Cells::Properties::ICustomDocumentPropertyCollection> customProperties =
workbook->GetIWorksheets()->GetICustomDocumentProperties();
//Accessng a custom document property by using the property index
intrusive_ptr<Aspose::Cells::Properties::IDocumentProperty> customProperty1 = customProperties->GetObjectByIndex(3);
//Accessng a custom document property by using the property name
intrusive_ptr<Aspose::Cells::Properties::IDocumentProperty> customProperty2 = customProperties->GetObjectByIndex(new String("Owner"));

Member Function Documentation

◆ GetName()

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::Properties::IDocumentProperty::GetName ( )
pure virtual

Returns the name of the property.

◆ GetSource()

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::Properties::IDocumentProperty::GetSource ( )
pure virtual

The linked content source.

◆ GetType()

virtual Aspose::Cells::Properties::PropertyType Aspose::Cells::Properties::IDocumentProperty::GetType ( )
pure virtual

Gets the data type of the property.

◆ GetValue()

virtual intrusive_ptr<Aspose::Cells::Systems::Object> Aspose::Cells::Properties::IDocumentProperty::GetValue ( )
pure virtual

Gets the value of the property.

◆ IsGeneratedName()

virtual bool Aspose::Cells::Properties::IDocumentProperty::IsGeneratedName ( )
pure virtual

Returns true if this property does not have a name in the OLE2 storage and a unique name was generated only for the public API.

◆ IsLinkedToContent()

virtual bool Aspose::Cells::Properties::IDocumentProperty::IsLinkedToContent ( )
pure virtual

Indicates whether this property is linked to content

◆ SetValue()

virtual void Aspose::Cells::Properties::IDocumentProperty::SetValue ( intrusive_ptr< Aspose::Cells::Systems::Object >  value)
pure virtual

Sets the value of the property.

◆ ToBool()

virtual bool Aspose::Cells::Properties::IDocumentProperty::ToBool ( )
pure virtual

Returns the property value as bool.

Throws an exception if the property type is not PropertyType_Boolean.

◆ ToDateTime()

virtual intrusive_ptr<Aspose::Cells::Systems::DateTime> Aspose::Cells::Properties::IDocumentProperty::ToDateTime ( )
pure virtual

Returns the property value as DateTime in local time zone.

Throws an exception if the property type is not PropertyType_Date.

◆ ToDouble()

virtual Aspose::Cells::Systems::Double Aspose::Cells::Properties::IDocumentProperty::ToDouble ( )
pure virtual

Returns the property value as double.

Throws an exception if the property type is not PropertyType_Float.

◆ ToInt()

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::Properties::IDocumentProperty::ToInt ( )
pure virtual

Returns the property value as integer.

Throws an exception if the property type is not PropertyType_Number.

◆ ToString()

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::Properties::IDocumentProperty::ToString ( )
pure virtual

Returns the property value as a string.

Converts a number property using Object.ToString(). Converts a boolean property into "Y" or "N". Converts a date property into a short date string.