D
David W. Simmonds
I have a custom object that I use in a PropertyGrid as seen below. It
presents an elipsis button that when clicked brings up a custom modal
dialog. When I make a change in the property, the PropertyValueChanged event
never gets fired. I have other properties in the PropertyGrid that do fire
the event. Is there anything special that I need to do to have the event
fired?
[System::ComponentModel::EditorAttribute(__typeof(CPictureEditor),
__typeof(System:rawing:esign::UITypeEditor))]
[System::ComponentModel::TypeConverterAttribute(__typeof(CPictureConverter))
]
[Serializable]
public __gc class PictureObj : public
System::Runtime::Serialization::ISerializable
{
private:
CPicture* m_pPicture;
public:
PictureObj()
{
m_pPicture = new CPicture;
}
~PictureObj()
{
delete m_pPicture;
}
PictureObj(System::Runtime::Serialization::SerializationInfo *si,
System::Runtime::Serialization::StreamingContext sc)
{
m_pPicture = new CPicture;
SetObjectData(si, sc);
}
void SetPicture(CPicture* pic) { *m_pPicture = *pic; }
CPicture* GetPicture() { return m_pPicture; }
void GetObjectData(System::Runtime::Serialization::SerializationInfo
*si,
System::Runtime::Serialization::StreamingContext sc);
void SetObjectData(System::Runtime::Serialization::SerializationInfo
*si,
System::Runtime::Serialization::StreamingContext sc);
__property IPicture* get_Picture() { return m_pPicture->m_pImage; }
__property void set_Picture(IPicture* value) { m_pPicture->m_pImage =
value; }
__property System::String* get_ImageExt() { return new
System::String(m_pPicture->m_strImageExt); }
__property void set_ImageExt(System::String* value) {
m_pPicture->m_strImageExt = value; }
};
presents an elipsis button that when clicked brings up a custom modal
dialog. When I make a change in the property, the PropertyValueChanged event
never gets fired. I have other properties in the PropertyGrid that do fire
the event. Is there anything special that I need to do to have the event
fired?
[System::ComponentModel::EditorAttribute(__typeof(CPictureEditor),
__typeof(System:rawing:esign::UITypeEditor))]
[System::ComponentModel::TypeConverterAttribute(__typeof(CPictureConverter))
]
[Serializable]
public __gc class PictureObj : public
System::Runtime::Serialization::ISerializable
{
private:
CPicture* m_pPicture;
public:
PictureObj()
{
m_pPicture = new CPicture;
}
~PictureObj()
{
delete m_pPicture;
}
PictureObj(System::Runtime::Serialization::SerializationInfo *si,
System::Runtime::Serialization::StreamingContext sc)
{
m_pPicture = new CPicture;
SetObjectData(si, sc);
}
void SetPicture(CPicture* pic) { *m_pPicture = *pic; }
CPicture* GetPicture() { return m_pPicture; }
void GetObjectData(System::Runtime::Serialization::SerializationInfo
*si,
System::Runtime::Serialization::StreamingContext sc);
void SetObjectData(System::Runtime::Serialization::SerializationInfo
*si,
System::Runtime::Serialization::StreamingContext sc);
__property IPicture* get_Picture() { return m_pPicture->m_pImage; }
__property void set_Picture(IPicture* value) { m_pPicture->m_pImage =
value; }
__property System::String* get_ImageExt() { return new
System::String(m_pPicture->m_strImageExt); }
__property void set_ImageExt(System::String* value) {
m_pPicture->m_strImageExt = value; }
};