c# - Am I trying to Implement Multiple Inheritance. How can I do this -


I'm called a class that some functions are defined as protected.

Now Class B handles A and Class C BCL B is a private default constructor and protected parametridge constructor in B class A.

I want to be able to access class B in all protected works as defined in class A but class C can gain access to some functions, not just all functions and in class C class B. There is a succession.

How can I restrict access to some classes of Class A from Class C?

edit:

  namespace db {public class} {private A} {} secure a (string cone) {assign this value Protected DataTable () {return table;} Protected Sqlparameters setParameters () {return parameter}}}} namespace {public class B: A {secure B (): base ("constring") {} protected DataTable output ( } {GetTable ();} Secure sqlparameter values ​​the absolute IDataParameter [] parameter) {}}} namespace BSN {public class} C: B {safe (C) : Base () {} Secure DataTable Show () {Return Value (Setpeter ())}}}}  

Edit

I think what I'm trying to do here is Multiple Warsaw.

Please check. Class A: A {// 5 functions are declared which are using A function in the internal body} class C: B { Using all functions of // b but only 4 functions of A must be accessible by C.}

I want to suggest that you can reconsider your design perhaps what is an easy way to get an example of getting it from (composition) instead of C (B). Uses? In this way, CBBs can use public methods but can not access protected people.

Class A should not care about the level / depth of the descent. If something has been preserved, then it should be preserved for both B and C (even if there is no depth of heritage chain). B can choose to divide his offspring by tightening obstacles in spite of (but it is rare).

If you can tell me more about your reference - the problem you are trying to solve .. I can give you more detailed / useful answers.


Comments