Beispiel #1
0
 protected override bool _Equals(TaskDict other)
 {
     return(Directions.Equals(other.Directions) &&
            AudioUrl.Equals(other.AudioUrl) &&
            ImageUrl.Equals(other.ImageUrl) &&
            Location.Equals(other.Location));
 }
Beispiel #2
0
 public override int GetHashCode()
 {
     unchecked {
         var hashCode = base.GetHashCode();
         hashCode = (hashCode * 397) ^ (Directions != null ? Directions.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AudioUrl != null ? AudioUrl.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ImageUrl != null ? ImageUrl.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Location.GetHashCode();
         return(hashCode);
     }
 }
Beispiel #3
0
        static void Main(string[] args)
        {
            Audio    sing   = new Audio("Scorpions", new DateTime(1990), "Classic rok", "Wind of Change", 4970250, new TimeSpan(0, 5, 10), 320);
            Image    photo  = new Image("Unknown", new DateTime(1990), "AlbumArt", "Scorpions", 65536, "500x500");
            Video    clip   = new Video("Scorpions", new DateTime(1990), "Classic rok", "Wind of Change", 555, new TimeSpan(0, 5, 10), Quality.Best);
            AudioUrl sing1  = new AudioUrl("Scorpions", new DateTime(1990), "Classic rok", "Wind of Change", 4970250, new TimeSpan(0, 5, 10), 320, "http://mmm");
            ImageURL photo1 = new ImageURL("Unknown", new DateTime(1990), "AlbumArt", "Scorpions", 65536, "500x500", "http://mmm");
            VideoURL clip1  = new VideoURL("Scorpions", new DateTime(1990), "Classic rok", "Wind of Change", 555, new TimeSpan(0, 5, 10), Quality.Best, "http://mmm");


            Disk disk = new Disk("MyDisk", DateTime.Now);

            disk.Add(sing);
            disk.Add(photo);
            disk.Add(clip); // Error

            Serial serial = new Serial("MySerial", DateTime.Now);

            serial.Add(new Video("Scorpions", new DateTime(1990), "Classic rok", "Wind of Change", 555, new TimeSpan(0, 5, 10), Quality.Best));
            serial.Add(new Image("Unknown", new DateTime(1990), "AlbumArt", "Scorpions", 65536, "500x500"));
            serial.Add(new Audio("Scorpions", new DateTime(1990), "Classic rok", "Wind of Change", 4970250, new TimeSpan(0, 5, 10), 320)); // Error

            History history = new History("MyHistory", DateTime.Now);

            history.Add(photo);
            history.Add(photo1);
            history.Add(clip);
            history.Add(clip1);
            history.Add(sing); // Error

            Compilation comp = new Compilation("MyCompilation", DateTime.Now);

            comp.Add(sing);
            comp.Add(photo);
            comp.Add(sing1); //Error
            foreach (var i in comp)
            {
                Console.ForegroundColor = ConsoleColor.Cyan;
                Console.WriteLine(i.OpenItem());
            }

            Console.ForegroundColor = ConsoleColor.White;
            // Console.WriteLine( history.OpenItem());

            Console.ReadKey();
        }