المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Scope issue declaring a delegate within a static class



C# Programming
10-22-2011, 01:30 PM
I have a static class that requires a delegate. A delegate should not be static and cant be fine. However a static class requires the variable and methods be static; There for how do I declare a delegate within the class?

e.g.
public delegate void currentBalance(int value);

public static DoSomething()
{
do something...
balance = 10;
currentBalance(balance);
}

Any Help more than welcome.
Thanks
dotman1