ExpandableObjectConverter::GetProperties override

A

Adriano Coser

Hello.

I'm facing the exact problem described here:
http://groups.google.com/groups?hl=...&lr=&q=TypeConverter%3A%3AGetProperties&meta=

I made a ExpandableObjectConverter subclass but its GetProperties method is
not called when my object is set as a Converter of PropertyDescriptor. The
thread above gives a good explanation of the problem, but the solution is
not described there!

Does anyone have an idea.

Bellow is the code of my derived class. If I try to use 'override' on
GetProperties declarations, the compiler says there's not a compatible
declaration on base class.

#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();

virtual PropertyDescriptorCollection^
GetProperties(ITypeDescriptorContext^, Object^, Attribute^ attributes)
{return GetProperties();}
virtual PropertyDescriptorCollection^ GetProperties(Object^) {return
GetProperties();}
virtual PropertyDescriptorCollection^
GetProperties(ITypeDescriptorContext^, Object^) {return GetProperties();}
virtual PropertyDescriptorCollection^ GetProperties();

virtual bool GetPropertiesSupported(ITypeDescriptorContext^) override
{return GetPropertiesSupported();}
bool GetPropertiesSupported() {return true;}

bool AddProperty(PropertyDescriptor ^propertyDescriptor);

property bool ReverseProperties {
void set(bool newValue){reverseProperties=newValue;}
}

protected:

private:
PropertyDescriptorCollection ^propertyCollection;
PropertyDescriptorCollection
^ReversePropertyDescriptorCollection(PropertyDescriptorCollection^
propertyDescriptorCollection);

bool reverseProperties;
};

Thanks in advance for any help.

Regards,

Adriano Coser

AltoQi - Tecnologia Aplicada à Engenharia Adriano Coser Departamento de
Desenvolvimento Tel.: (48) 239-7000 ramal: 7069 e-mail: (e-mail address removed)
website: www.altoqi.com.br
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top