A
Adriano Coser
Hello.
After I converted my .net code to the new VC2005 syntax I started to get
C4490 on my ExpandableObjectConverter subclass overrides. The GetProperties
method is no longer called by the PropertyGrid when I use my subclass as a
type converter.
Can anyone tell me what has changed? What's the correct way to override
GetProperties method? Here's the code for my class:
// ExpandableProperty.h
#pragma once
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System:iagnostics;
public ref class TExpandableProperty : public ExpandableObjectConverter
{
public:
TExpandableProperty();
virtual PropertyDescriptorCollection^
GetProperties(ITypeDescriptorContext^, Object^, Attribute^ attributes)
override { return GetProperties(); }
virtual PropertyDescriptorCollection^ GetProperties(Object^) override {
return GetProperties(); }
virtual PropertyDescriptorCollection^
GetProperties(ITypeDescriptorContext^, Object^) override { return
GetProperties(); }
virtual PropertyDescriptorCollection^ GetProperties() override { return
propertyCollection; }
virtual bool GetPropertiesSupported(ITypeDescriptorContext^) override {
return true; }
virtual bool GetPropertiesSupported() override { return true; }
bool AddProperty(PropertyDescriptor ^propertyDescriptor);
private:
PropertyDescriptorCollection ^propertyCollection;
};
// ExpandableProperty.cpp
#include "StdAfx.h"
#include ".\expandableproperty.h"
#using <mscorlib.dll>
//-----------------------------------------------------------
TExpandableProperty::TExpandableProperty()
{
propertyCollection = gcnew PropertyDescriptorCollection(nullptr);
}
//-----------------------------------------------------------
bool TExpandableProperty::AddProperty(PropertyDescriptor^
propertyDescriptor)
{
propertyCollection->Add(propertyDescriptor);
return true;
}
Thanks in advance for any help.
Regards,
Adriano.
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
After I converted my .net code to the new VC2005 syntax I started to get
C4490 on my ExpandableObjectConverter subclass overrides. The GetProperties
method is no longer called by the PropertyGrid when I use my subclass as a
type converter.
Can anyone tell me what has changed? What's the correct way to override
GetProperties method? Here's the code for my class:
// ExpandableProperty.h
#pragma once
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System:iagnostics;
public ref class TExpandableProperty : public ExpandableObjectConverter
{
public:
TExpandableProperty();
virtual PropertyDescriptorCollection^
GetProperties(ITypeDescriptorContext^, Object^, Attribute^ attributes)
override { return GetProperties(); }
virtual PropertyDescriptorCollection^ GetProperties(Object^) override {
return GetProperties(); }
virtual PropertyDescriptorCollection^
GetProperties(ITypeDescriptorContext^, Object^) override { return
GetProperties(); }
virtual PropertyDescriptorCollection^ GetProperties() override { return
propertyCollection; }
virtual bool GetPropertiesSupported(ITypeDescriptorContext^) override {
return true; }
virtual bool GetPropertiesSupported() override { return true; }
bool AddProperty(PropertyDescriptor ^propertyDescriptor);
private:
PropertyDescriptorCollection ^propertyCollection;
};
// ExpandableProperty.cpp
#include "StdAfx.h"
#include ".\expandableproperty.h"
#using <mscorlib.dll>
//-----------------------------------------------------------
TExpandableProperty::TExpandableProperty()
{
propertyCollection = gcnew PropertyDescriptorCollection(nullptr);
}
//-----------------------------------------------------------
bool TExpandableProperty::AddProperty(PropertyDescriptor^
propertyDescriptor)
{
propertyCollection->Add(propertyDescriptor);
return true;
}
Thanks in advance for any help.
Regards,
Adriano.
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