|
|
||||||
|
#1
|
|
|
|
|
Hello group,
What is the equivalent of this code snippet in C#? public event EventHandler OnConnect { add { lock(syncRoot) { connectedEvent += value; } } remove { lock(syncRoot) { connectedEvent -= value; } } } best regards, Mobile Boy |
|
|
|
#2
|
|
|
|
|
First you have to ask yourself if you *really* need custom events. 99% of
the time you don't. If you really do, then VB2005 supports them so you are out of luck if you are targeting CF v1.0. For the syntax read this: http://www.panopticoncentral.net/arc...8/06/1545.aspx Cheers Daniel |
|
#3
|
|
|
|
|
Thanks for your response Daniel...
Do you already now how to achieve the += in VB.NET on the line connectedEvent += value? best regards "Daniel Moth" <dmoth74> schreef in bericht news:4952 [..] |
|
#4
|
|
|
|
|
Look at the site I referenced. It shows an example of that (hint: Combine
and Remove methods of your delegate). I am sure msdn2 has an example too but here is yet another: http://www.lhotka.net/WeBlog/BetterV...olution. aspx Cheers Daniel |
|
|
| Similar Threads | |
| Thread | Thread Starter |
| VB6 Equivalent Is there a .NET #C equivalent of VB6 "On Error Resume Next". |
Phil Hunt |
| VBA or VB.net equivalent of Equivalent of WordBasic WordBasic.SelectCurWord I have a old wordbasic code that I am converting to VSTO what is equivalent of Word 97 (WordBasic) code WordBasic.SelectCurWord in VSTO Tried several... |
c_shah |
| Equivalent of GetPrivateProfileString equivalent in C#? Does C# has an equivalent of the 'C' GetPrivateProfileString? or is the only way to get similar features to read from an INI file is to do a DllImport on Kernel32.dll? Thanks |
Germic |
| EQUIVALENT ON PC? Does any know of a comparable program to ActivSync for use between, say, PC and laptop please? TIA Nigel |
Nigel Albright |
| .net equivalent what's the equivalent to sendmessage? i want to explicitly kill the focus of a control. tia, steve |
steve |
|
Privacy Policy | All times are GMT. The time now is 05:31 PM.
|
|
|