tags:

views:

76

answers:

0

I can declare a delegate as General type, like a public or internal types, also i can create it within a (abstract) class and make it protected, so just some classes can access to that delegate for example:

delegate void PublicSample();

interface IMyInterface
{
    event PublicSample mySample;
}

class Implementor : IMyInterface
{

    public event PublicSample mySample;
}

abstract class BaseClass
{
    protected delegate void Sample();

}

class SampleClass : BaseClass
{
    event Sample ss;
}

class AnotherClass
{
    //event Sample sample; u can't do this
    event PublicSample publicSample; // u can do this.
}

each one has its situation first one can be used everywhere but second one can be used within a specific condition, I think when i want to use some events within some of my internal or specific application its better to use abstract class, I want to know is there anybody think about using abstract instead of interface (and vise verse) and why and when. Thanks.