_cefGlueBrowser.LoadEnd += (s, e) =>
{
BeginInvoke(new Action(() =>
{
MyCefStringVisitor visitor = new MyCefStringVisitor(this, m_url);
e.Browser.GetMainFrame().GetSource(visitor);
loaded = true;
}));
};
But problem is that Event Handler is called many times. After each JS reload for example. How to remove multiple calls. How to call LoadEnd
event just once.
I try with
_cefGlueBrowser.LoadEnd -= delegate { };
but not working.
What can i do? I want to call it just once!
EventHandler handler = null;
obj.SomeEvent += handler = (s, e) => {
obj.SomeEvent -= handler;
// more stuff
};
This works because it is the variable that us captured (lexical closure), not the value of the variable at any particular time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With