Click here to Skip to main content
15,896,557 members
Home / Discussions / C#
   

C#

 
Questionhow to find websites that are using google ad-sense Pin
Anil Veeraghattapu 416-Sep-09 23:10
Anil Veeraghattapu 416-Sep-09 23:10 
AnswerRe: how to find websites that are using google ad-sense Pin
benjymous17-Sep-09 0:46
benjymous17-Sep-09 0:46 
GeneralRe: how to find websites that are using google ad-sense Pin
Anil Veeraghattapu 419-Sep-09 0:53
Anil Veeraghattapu 419-Sep-09 0:53 
GeneralRe: how to find websites that are using google ad-sense Pin
benjymous20-Sep-09 23:33
benjymous20-Sep-09 23:33 
Questionany way without cast [modified] Pin
mary_sa16-Sep-09 23:06
mary_sa16-Sep-09 23:06 
AnswerRe: no list my winservice at services Pin
Calla17-Sep-09 0:05
Calla17-Sep-09 0:05 
QuestionGeneric event triggering Pin
skbrann16-Sep-09 22:51
skbrann16-Sep-09 22:51 
AnswerRe: Generic event triggering Pin
N a v a n e e t h17-Sep-09 3:00
N a v a n e e t h17-Sep-09 3:00 
How about,
C#
class Publisher
{
    public event EventHandler<AEventArgs> EventA;
    public event EventHandler<BEventArgs> EventB;

    public void TriggerEvents()
    {
        TriggerEvent(EventA, new AEventArgs());
        TriggerEvent(EventB, new BEventArgs());
    }

    private void TriggerEvent<TEventArgs>(EventHandler<TEventArgs> eventHandler, TEventArgs args)
        where TEventArgs : EventArgs
    {
        EventHandler<TEventArgs> handler = eventHandler;
        if (handler != null)
        {
            handler(this, args);
        }
    }
}
You call it like TriggerEvent<AEventArgs>(EventA, new AEventArgs()) or without specifying the generic type. If type is not specified, compiler will infer from the type of parameter passed.

Smile | :)


GeneralRe: Generic event triggering Pin
skbrann20-Sep-09 21:49
skbrann20-Sep-09 21:49 
QuestionDll info Pin
mikla52116-Sep-09 22:30
mikla52116-Sep-09 22:30 
AnswerRe: Dll info Pin
Luc Pattyn17-Sep-09 2:46
sitebuilderLuc Pattyn17-Sep-09 2:46 
QuestionValidate java SAML signature from C# Pin
adrya16-Sep-09 21:57
adrya16-Sep-09 21:57 
AnswerRe: Validate java SAML signature from C# Pin
Mirko198016-Sep-09 23:02
Mirko198016-Sep-09 23:02 
GeneralRe: Validate java SAML signature from C# Pin
adrya16-Sep-09 23:25
adrya16-Sep-09 23:25 
GeneralRe: Validate java SAML signature from C# Pin
adrya23-Sep-09 19:03
adrya23-Sep-09 19:03 
QuestionHow can I get the local machine's IP address in a Windows app ? Pin
Rahad Rahman16-Sep-09 21:23
professionalRahad Rahman16-Sep-09 21:23 
AnswerRe: How can I get the local machine's IP address in a Windows app ? Pin
stancrm16-Sep-09 21:26
stancrm16-Sep-09 21:26 
GeneralRe: How can I get the local machine's IP address in a Windows app ? Pin
Calla16-Sep-09 21:36
Calla16-Sep-09 21:36 
AnswerRe: How can I get the local machine's IP address in a Windows app ? Pin
Harvey Saayman16-Sep-09 22:03
Harvey Saayman16-Sep-09 22:03 
AnswerRe: How can I get the local machine's IP address in a Windows app ? Pin
Luc Pattyn17-Sep-09 2:49
sitebuilderLuc Pattyn17-Sep-09 2:49 
AnswerRe: How can I get the local machine's IP address in a Windows app ? Pin
carlecomm22-Sep-09 2:02
carlecomm22-Sep-09 2:02 
QuestionTCP Servers Pin
Harvey Saayman16-Sep-09 21:18
Harvey Saayman16-Sep-09 21:18 
AnswerRe: TCP Servers Pin
N a v a n e e t h16-Sep-09 22:13
N a v a n e e t h16-Sep-09 22:13 
GeneralRe: TCP Servers Pin
Harvey Saayman17-Sep-09 0:51
Harvey Saayman17-Sep-09 0:51 
Questionmodify a css property in code behind Pin
firefeet16-Sep-09 20:50
firefeet16-Sep-09 20:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.