Click here to Skip to main content
15,901,373 members
Home / Discussions / C#
   

C#

 
AnswerRe: Manual Coding vs Code Generation Pin
Orjan Westin16-Nov-12 2:17
professionalOrjan Westin16-Nov-12 2:17 
GeneralRe: Manual Coding vs Code Generation Pin
Phanindra26116-Nov-12 3:09
Phanindra26116-Nov-12 3:09 
GeneralRe: Manual Coding vs Code Generation Pin
Orjan Westin16-Nov-12 3:25
professionalOrjan Westin16-Nov-12 3:25 
AnswerRe: Manual Coding vs Code Generation Pin
BobJanova16-Nov-12 3:25
BobJanova16-Nov-12 3:25 
AnswerRe: Manual Coding vs Code Generation Pin
fjdiewornncalwe16-Nov-12 7:11
professionalfjdiewornncalwe16-Nov-12 7:11 
GeneralRe: Manual Coding vs Code Generation Pin
Phanindra26116-Nov-12 7:56
Phanindra26116-Nov-12 7:56 
GeneralRe: Manual Coding vs Code Generation Pin
fjdiewornncalwe16-Nov-12 8:26
professionalfjdiewornncalwe16-Nov-12 8:26 
AnswerRe: Manual Coding vs Code Generation Pin
Mycroft Holmes16-Nov-12 15:37
professionalMycroft Holmes16-Nov-12 15:37 
GeneralRe: Manual Coding vs Code Generation Pin
PIEBALDconsult21-Nov-12 17:51
mvePIEBALDconsult21-Nov-12 17:51 
GeneralRe: Manual Coding vs Code Generation Pin
Mycroft Holmes21-Nov-12 18:46
professionalMycroft Holmes21-Nov-12 18:46 
GeneralRe: Manual Coding vs Code Generation Pin
PIEBALDconsult22-Nov-12 9:51
mvePIEBALDconsult22-Nov-12 9:51 
AnswerRe: Manual Coding vs Code Generation Pin
PIEBALDconsult21-Nov-12 4:00
mvePIEBALDconsult21-Nov-12 4:00 
QuestionDesign Question Pin
PozzaVecia15-Nov-12 17:31
PozzaVecia15-Nov-12 17:31 
AnswerRe: Design Question Pin
DaveyM6915-Nov-12 19:31
professionalDaveyM6915-Nov-12 19:31 
GeneralRe: Design Question Pin
PozzaVecia15-Nov-12 20:11
PozzaVecia15-Nov-12 20:11 
AnswerRe: Design Question Pin
Rahul Rajat Singh15-Nov-12 21:43
professionalRahul Rajat Singh15-Nov-12 21:43 
Why not make I2 and abstract class so that when I2's methods are not implemented by ClassA the default empty implementation will work. here is some sample code:

Note: Replace I2 with A2 and ClassA and ClassA2 are two possible versions you could have for ClassA

C#
public interface I1
{
    void A();
    void B();
}
public abstract class A2 : I1
{
    public virtual void C()
    {
        //nothing in default implementation
    }
    public virtual void D()
    {
        //nothing in default implementation
    }

    #region I1 Members

    public abstract void A();
    public abstract void B();

    #endregion
}

// case 1
// fuction A and B will be there always
// not implementing C and D
public class ClassA : A2
{
    public override void A()
    {

    }

    public override void B()
    {

    }
}

// case 2
// fuction A and B will be there always
// ALSO implementing C and D
public class ClassA2 : A2
{
    public override void A()
    {

    }

    public override void B()
    {

    }

    public override void C()
    {

    }

    public override void D()
    {

    }
}

Every now and then say, "What the Elephant." "What the Elephant" gives you freedom. Freedom brings opportunity. Opportunity makes your future.

GeneralRe: Design Question Pin
PozzaVecia15-Nov-12 23:14
PozzaVecia15-Nov-12 23:14 
AnswerRe: Design Question Pin
Rahul Rajat Singh15-Nov-12 23:22
professionalRahul Rajat Singh15-Nov-12 23:22 
AnswerRe: Design Question PinPopular
BobJanova15-Nov-12 23:12
BobJanova15-Nov-12 23:12 
GeneralRe: Design Question Pin
PozzaVecia15-Nov-12 23:16
PozzaVecia15-Nov-12 23:16 
GeneralRe: Design Question Pin
Rahul Rajat Singh15-Nov-12 23:35
professionalRahul Rajat Singh15-Nov-12 23:35 
GeneralRe: Design Question Pin
BobJanova16-Nov-12 0:09
BobJanova16-Nov-12 0:09 
AnswerRe: Design Question Pin
SledgeHammer0116-Nov-12 9:53
SledgeHammer0116-Nov-12 9:53 
GeneralRe: Design Question Pin
PozzaVecia16-Nov-12 10:06
PozzaVecia16-Nov-12 10:06 
AnswerRe: Design Question Pin
Clifford Nelson16-Nov-12 9:53
Clifford Nelson16-Nov-12 9: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.