Hello.
I have an ExpandableObjectConverter subclass that I associate to the
'Converter' of a custom property descriptor.
After I changed my .net code to the new syntax (VC 2005), the
GetProperties method of my converter class is not called anymore by
the PropertyGrid. Now my expandable properties always show a property
'Length' with value 0.
Another thing: if I try to declare the GetProperties functions as
'override' the compiler says that there isn't a compatible version in
the base class. But, according to the documentation, the declarations
are right.
Does anyone have an idea of what's wrong?
Thanks in advance for any help.
Adriano Coser.
The header of my expandable converter:
#pragma once
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Diagnostics;
public ref class TExpandableProperty : public
ExpandableObjectConverter
{
public:
TExpandableProperty();
PropertyDescriptorCollection^
GetProperties(ITypeDescriptorContext^, Object^, Attribute^ attributes)
{ return GetProperties(); }
PropertyDescriptorCollection^ GetProperties(Object^) { return
GetProperties(); }
PropertyDescriptorCollection^
GetProperties(ITypeDescriptorContext^, Object^) { return
GetProperties(); }
PropertyDescriptorCollection^ GetProperties() { return
propertyCollection; }
virtual bool GetPropertiesSupported(ITypeDescriptorContext^)
override { return true; }
bool GetPropertiesSupported() { return true; }
bool AddProperty(PropertyDescriptor ^propertyDescriptor);
private:
PropertyDescriptorCollection ^propertyCollection;
};