1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
| public abstract class CBase
{
public abstract string Parametre1
{
get;
}
public abstract Dictionary<string, string> Parametre2
{
get;
}
//Methodes communes
public void Methode1(string boisson, string manger)
{
string test = Parametre1 + boisson;
TraitementRessource(test, Parametre2);
}
private void Methode2(string test, string parametre2)
{
string essai = test + parametre2;
}
}
public class A: CBase
{
public override string Parametre1
{
get { return "MonParametre1"; }
}
public Dictionary<string, string> Parametre2
{
get { return _parametre2; }
}
private static Dictionary<string, string> _parametre2 = new Dictionary<string, string> { { "Nom", "Toto" }, { "Prenom", "Tata" } };
}
public class B
{
public override string Parametre1
{
get { return "AutreParametre"; }
}
public Dictionary<string, string> Parametre2
{
get { return _parametre2; }
}
private static Dictionary<string, string> _parametre2 = new Dictionary<string, string> { { "Nom", "loki" }, { "Prenom", "poki" } };
} |