Click here to Skip to main content
15,887,267 members
Home / Discussions / C#
   

C#

 
GeneralRe: Treeview doesn't update after treenode.remove Pin
Ben Fair30-Dec-09 3:32
Ben Fair30-Dec-09 3:32 
GeneralRe: Treeview doesn't update after treenode.remove Pin
eyalle30-Dec-09 3:38
eyalle30-Dec-09 3:38 
Questionretrive user rights from sql table Pin
Jassim Rahma29-Dec-09 22:53
Jassim Rahma29-Dec-09 22:53 
AnswerRe: retrive user rights from sql table Pin
Ben Fair30-Dec-09 3:04
Ben Fair30-Dec-09 3:04 
GeneralRe: retrive user rights from sql table Pin
Jassim Rahma30-Dec-09 10:54
Jassim Rahma30-Dec-09 10:54 
GeneralRe: retrive user rights from sql table Pin
Jassim Rahma13-Jan-10 7:43
Jassim Rahma13-Jan-10 7:43 
QuestionC# - listen to add/remove function from event Pin
bonzaiholding29-Dec-09 22:15
bonzaiholding29-Dec-09 22:15 
AnswerRe: C# - listen to add/remove function from event Pin
DaveyM6929-Dec-09 23:17
professionalDaveyM6929-Dec-09 23:17 
You mention 'my event' but I don't see any events in your code, only a delegate.

If you are using events then you can use the add and remove methods and call your other function there.
C#
public class DoItUser
{
    public DoItUser()
    {
        MyClass myClass = new MyClass();
        myClass.MyEvent += new DoItDelegate(DoItFunction);
    }

    private void DoItFunction(int i)
    {
        // ...
    }
}

public delegate void DoItDelegate(int i);

public class MyClass
{
    private DoItDelegate myEvent;

    public event DoItDelegate MyEvent
    {
        add
        {
            myEvent += value;
            DoSomethingElse();
        }
        remove { myEvent -= value; }
    }

    private void DoSomethingElse()
    {
        // ...
    }
}


Dave

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Why are you using VB6? Do you hate yourself? (Christian Graus)

AnswerRe: C# - listen to add/remove function from event Pin
Afjal khan30-Dec-09 0:19
Afjal khan30-Dec-09 0:19 
QuestionC# VS 2005 Plotting real time data with Drawing 2D Pin
raj of jss29-Dec-09 21:33
raj of jss29-Dec-09 21:33 
AnswerRe: C# VS 2005 Plotting real time data with Drawing 2D Pin
Luc Pattyn30-Dec-09 0:49
sitebuilderLuc Pattyn30-Dec-09 0:49 
QuestionC# Delegates in vc++ Pin
Anu_Bala29-Dec-09 21:32
Anu_Bala29-Dec-09 21:32 
AnswerRe: C# Delegates in vc++ Pin
teejayem30-Dec-09 5:26
teejayem30-Dec-09 5:26 
QuestionRegistration of an assembly. Pin
SRKSHOME29-Dec-09 20:38
SRKSHOME29-Dec-09 20:38 
AnswerRe: Registration of an assembly. Pin
Md. Marufuzzaman29-Dec-09 21:09
professionalMd. Marufuzzaman29-Dec-09 21:09 
GeneralRe: Registration of an assembly. Pin
SRKSHOME29-Dec-09 21:48
SRKSHOME29-Dec-09 21:48 
GeneralRe: Registration of an assembly. Pin
Md. Marufuzzaman30-Dec-09 1:19
professionalMd. Marufuzzaman30-Dec-09 1:19 
Questionbreaking a string to substrings Pin
myinstincts29-Dec-09 19:21
myinstincts29-Dec-09 19:21 
AnswerRe: breaking a string to substrings Pin
myinstincts29-Dec-09 19:27
myinstincts29-Dec-09 19:27 
GeneralRe: breaking a string to substrings [modified] Pin
petercrab29-Dec-09 20:10
petercrab29-Dec-09 20:10 
GeneralRe: breaking a string to substrings Pin
coolestCoder29-Dec-09 22:16
coolestCoder29-Dec-09 22:16 
AnswerRe: breaking a string to substrings Pin
Md. Marufuzzaman29-Dec-09 20:42
professionalMd. Marufuzzaman29-Dec-09 20:42 
QuestionRichTextBox in WPF raised InvalidComObjectException in release build application Pin
Jingcheng29-Dec-09 17:52
Jingcheng29-Dec-09 17:52 
QuestionControlPaint.DrawBorder Pin
Saksida Bojan29-Dec-09 11:00
Saksida Bojan29-Dec-09 11:00 
AnswerRe: ControlPaint.DrawBorder Pin
Ravi Bhavnani29-Dec-09 14:53
professionalRavi Bhavnani29-Dec-09 14:53 

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.