public void EnumeratePropertiesWithIndexer()
{
//ExStart
//ExFor:DocumentPropertyCollection.Count
//ExFor:DocumentPropertyCollection.Item(int)
//ExFor:DocumentProperty
//ExFor:DocumentProperty.Name
//ExFor:DocumentProperty.Value
//ExFor:DocumentProperty.Type
//ExSummary:Enumerates through all built-in and custom properties in a document using indexed access.
string fileName = MyDir + "Properties.doc";
Document doc = new Document(fileName);
Console.WriteLine("1. Document name: {0}", fileName);
Console.WriteLine("2. Built-in Properties");
for (int i = 0; i < doc.BuiltInDocumentProperties.Count; i++)
{
DocumentProperty prop = doc.BuiltInDocumentProperties[i];
Console.WriteLine("{0}({1}) : {2}", prop.Name, prop.Type, prop.Value);
}
Console.WriteLine("3. Custom Properties");
for (int i = 0; i < doc.CustomDocumentProperties.Count; i++)
{
DocumentProperty prop = doc.CustomDocumentProperties[i];
Console.WriteLine("{0}({1}) : {2}", prop.Name, prop.Type, prop.Value);
}
//ExEnd
}