Click here to Skip to main content
15,920,438 members
Home / Discussions / C#
   

C#

 
AnswerRe: Drag and Drop Text Pin
c#_keithy8-Oct-07 3:23
c#_keithy8-Oct-07 3:23 
QuestionKeyChar reference, does it vary with keyboard? Pin
c#_keithy8-Oct-07 3:13
c#_keithy8-Oct-07 3:13 
AnswerRe: KeyChar reference, does it vary with keyboard? Pin
Andrei Ungureanu8-Oct-07 3:27
Andrei Ungureanu8-Oct-07 3:27 
GeneralRe: KeyChar reference, does it vary with keyboard? Pin
c#_keithy8-Oct-07 3:35
c#_keithy8-Oct-07 3:35 
QuestionHow to determine provider type Pin
jpasher8-Oct-07 2:41
jpasher8-Oct-07 2:41 
QuestionCommunicating with a service Pin
Lars Lie8-Oct-07 2:30
Lars Lie8-Oct-07 2:30 
AnswerRe: Communicating with a service Pin
Judah Gabriel Himango8-Oct-07 4:34
sponsorJudah Gabriel Himango8-Oct-07 4:34 
Questionusing events as arguments Pin
Bekjong8-Oct-07 2:30
Bekjong8-Oct-07 2:30 
Since there's no default method that let's me unhook all listeners from an event at once, I sometimes do this:

public event PropertyChangedEventHandler PropertyChanged;

        public void UnHook()
        {
            if (this.PropertyChanged != null)
            {
                Delegate[] list = this.PropertyChanged.GetInvocationList();
                foreach (Delegate d in list) this.PropertyChanged -= d as PropertyChangedEventHandler;
            }
        }


However, since I find it kind of annoying to write this code for different types of events I'd really like to be able to do something this:

public static void Unhook<T>(event x)
        {
            Delegate[] list = x.GetInvocationList();
            foreach (Delegate d in list) x -= d as T;
        }



My question: Does anyone know of a way to implement parsing of events as method arguments? Thanks in advance...

Standards are great! Everybody should have one!

AnswerRe: using events as arguments Pin
Pete O'Hanlon8-Oct-07 2:41
mvePete O'Hanlon8-Oct-07 2:41 
GeneralRe: using events as arguments Pin
Bekjong8-Oct-07 3:11
Bekjong8-Oct-07 3:11 
GeneralRe: using events as arguments Pin
Scott Dorman8-Oct-07 3:57
professionalScott Dorman8-Oct-07 3:57 
GeneralRe: using events as arguments Pin
Pete O'Hanlon8-Oct-07 4:00
mvePete O'Hanlon8-Oct-07 4:00 
QuestionWSS 3.0 Config Database Pin
lsconyer8-Oct-07 2:22
lsconyer8-Oct-07 2:22 
Questionhow to read rext file? Pin
P_Elza8-Oct-07 0:52
P_Elza8-Oct-07 0:52 
AnswerRe: how to read rext file? Pin
Andrei Ungureanu8-Oct-07 0:59
Andrei Ungureanu8-Oct-07 0:59 
AnswerRe: how to read rext file? Pin
rajansethi8-Oct-07 2:47
rajansethi8-Oct-07 2:47 
QuestionHow to convert a PDF document to JPG. Pin
Exelioindia8-Oct-07 0:48
Exelioindia8-Oct-07 0:48 
AnswerRe: How to convert a PDF document to JPG. Pin
Christian Graus8-Oct-07 1:12
protectorChristian Graus8-Oct-07 1:12 
GeneralRe: How to convert a PDF document to JPG. Pin
Exelioindia8-Oct-07 2:28
Exelioindia8-Oct-07 2:28 
GeneralRe: How to convert a PDF document to JPG. Pin
Pete O'Hanlon8-Oct-07 2:43
mvePete O'Hanlon8-Oct-07 2:43 
QuestionWindowsPrincipal object gives null value for username when checked in component Pin
Naveen S H8-Oct-07 0:41
Naveen S H8-Oct-07 0:41 
QuestionWhere will be the assembly stores in the System Pin
pashitech8-Oct-07 0:40
pashitech8-Oct-07 0:40 
AnswerRe: Where will be the assembly stores in the System Pin
Pete O'Hanlon8-Oct-07 1:45
mvePete O'Hanlon8-Oct-07 1:45 
QuestionError while using System.Net.Mail.SmtpClient to send mail Pin
A M SOMAN7-Oct-07 22:59
A M SOMAN7-Oct-07 22:59 
AnswerRe: Error while using System.Net.Mail.SmtpClient to send mail Pin
Andrei Ungureanu7-Oct-07 23:23
Andrei Ungureanu7-Oct-07 23:23 

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.