Click here to Skip to main content
15,913,453 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Problem in Running WebApplication in Visual Studio.Net Pin
VenkataRamana.Gali27-Dec-05 8:10
VenkataRamana.Gali27-Dec-05 8:10 
QuestionCheck for an objects subscription to an event Pin
analytiks25-Dec-05 20:09
analytiks25-Dec-05 20:09 
AnswerRe: Check for an objects subscription to an event Pin
HakunaMatada25-Dec-05 20:20
HakunaMatada25-Dec-05 20:20 
GeneralRe: Check for an objects subscription to an event Pin
analytiks26-Dec-05 17:14
analytiks26-Dec-05 17:14 
GeneralRe: Check for an objects subscription to an event Pin
HakunaMatada26-Dec-05 17:28
HakunaMatada26-Dec-05 17:28 
GeneralRe: Check for an objects subscription to an event Pin
analytiks26-Dec-05 17:56
analytiks26-Dec-05 17:56 
GeneralRe: Check for an objects subscription to an event Pin
umesh kanyal28-Dec-05 0:21
umesh kanyal28-Dec-05 0:21 
AnswerRe: Check for an objects subscription to an event Pin
S. Senthil Kumar26-Dec-05 19:16
S. Senthil Kumar26-Dec-05 19:16 
Is the event fired from within your class? If true, you can write a routine like this
class A
{
public bool IsSubscribed(MethodDelegate passedDelegate)
{
            if (evt == null)
                return false;

            foreach (Delegate d in evt.GetInvocationList())
            {
                if (d == passedDelegate)
                {
                    return true;
                }
            }

            return false;
}
}


You can then use it like
A a = new A();
MethodDelegate thisMethod = new MethodDelegate(SomeMethod);
a.evt += thisMethod;
Console.WriteLine(a.IsSubscribed(thisMethod));
a.evt -= thisMethod;
Console.WriteLine(a.IsSubscribed(thisMethod));


Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
GeneralRe: Check for an objects subscription to an event Pin
analytiks26-Dec-05 19:41
analytiks26-Dec-05 19:41 
Questionmedia player for pda Pin
pgcnet25-Dec-05 1:55
pgcnet25-Dec-05 1:55 
QuestionSetting attributes to folders Pin
Yevgeny Efter24-Dec-05 18:50
Yevgeny Efter24-Dec-05 18:50 
AnswerRe: Setting attributes to folders Pin
VenkataRamana.Gali27-Dec-05 8:04
VenkataRamana.Gali27-Dec-05 8:04 
QuestionToolstrip Pin
kenexcelon24-Dec-05 16:59
kenexcelon24-Dec-05 16:59 
QuestionSetting Min/Max size for FormViews and Dialogs Pin
brdavid24-Dec-05 2:37
brdavid24-Dec-05 2:37 
AnswerRe: Setting Min/Max size for FormViews and Dialogs Pin
S. Akif Kamal27-Dec-05 20:48
S. Akif Kamal27-Dec-05 20:48 
GeneralRe: Setting Min/Max size for FormViews and Dialogs Pin
brdavid2-Jan-06 14:52
brdavid2-Jan-06 14:52 
QuestionProblems creating .NET Structures... Pin
Xtek23-Dec-05 19:17
Xtek23-Dec-05 19:17 
AnswerRe: Problems creating .NET Structures... Pin
Dave Kreskowiak27-Dec-05 7:43
mveDave Kreskowiak27-Dec-05 7:43 
GeneralRe: Problems creating .NET Structures... Pin
Xtek27-Dec-05 11:30
Xtek27-Dec-05 11:30 
GeneralRe: Problems creating .NET Structures... Pin
Dave Kreskowiak28-Dec-05 2:07
mveDave Kreskowiak28-Dec-05 2:07 
GeneralRe: Problems creating .NET Structures... Pin
Xtek28-Dec-05 13:22
Xtek28-Dec-05 13:22 
GeneralRe: Problems creating .NET Structures... Pin
Dave Kreskowiak28-Dec-05 16:18
mveDave Kreskowiak28-Dec-05 16:18 
GeneralRe: Problems creating .NET Structures... Pin
Xtek28-Dec-05 16:29
Xtek28-Dec-05 16:29 
QuestionThreading Issues... Pin
HakunaMatada23-Dec-05 17:52
HakunaMatada23-Dec-05 17:52 
AnswerRe: Threading Issues... Pin
Gerben Jongerius23-Dec-05 23:40
Gerben Jongerius23-Dec-05 23:40 

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.