コード例 #1
0
ファイル: Véhicules.cs プロジェクト: vichy60/exercices
        //public int CompareTo(object obj)
        //{
        //    if (obj is Véhicule)
        //    {
        //        Véhicule v = (Véhicule)obj;
        //        if (PRK < v.PRK) return -1;
        //        else if (PRK > v.PRK) return 1;
        //        else return 0;
        //    }
        //    else
        //        throw new ArgumentException();

        //}

        public int CompareTo(object obj)
        {
            if (obj is Véhicule)
            {
                Véhicule v = (Véhicule)obj;
                if (this.Prix < v.Prix)
                {
                    return(-1);
                }
                else if (this.Prix > v.Prix)
                {
                    return(1);
                }
                else
                {
                    return(0);
                }
            }
            else
            {
                throw new ArgumentException();
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: vichy60/exercices
 public static void Vidanger(Véhicule v)
 {
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: vichy60/exercices
 public static void RetoucherPeinture(Véhicule v)
 {
 }
コード例 #4
0
ファイル: Program.cs プロジェクト: vichy60/exercices
 public static void ChangerPneus(Véhicule v)
 {
     var date = v.CarnetEntretien.Keys.Last();
 }