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
  • 176,635
  • 17
  • 154
  • 256
user3736648
  • 7,421
  • 21
  • 73
  • 152

1 Answers1

0
if(PropertyValueChanged != null)
       PropertyValueChanged(with parameters defined on the signature of PropertyValueChangedEventHandler)
Zinov
  • 3,350
  • 5
  • 31
  • 61