0

In C#, if I have an event in a class, how can I raise this event?

I have a class called test, with the following event:

public event PropertyValueChangedEventHandler PropertyValueChanged

I have a PropertyGrid object that is in a CollectionEditor, and I want to raise the PropertyValueChanged event in the test object when the CollectionEditor.PropertyGrid value is changed.

I am not sure of the correct code to do this, this is what I have so far with a test object called obj:

propertyGridObject.PropertyValueChanged += customWebpageHtmlNode.PropertyValueChanged;

Can someone please help me with this?

Sweeper
  • 213,210
  • 22
  • 193
  • 313
Simon
  • 7,991
  • 21
  • 83
  • 163

1 Answers1

0
if(PropertyValueChanged != null)
       PropertyValueChanged(with parameters defined on the signature of PropertyValueChangedEventHandler)
Zinov
  • 3,817
  • 5
  • 36
  • 70