public bool Equals(MusicFile file)
 {
     return(file == null
                         ? false : this.Album == file.Album &&
            this.Artist == file.Artist &&
            this.Title == file.Title &&
            this.Track == file.Track);
 }
Example #2
0
 public bool Equals(MusicFile file)
 {
     return file == null
         ? false : this.Album == file.Album
             && this.Artist == file.Artist
             && this.Title == file.Title
             && this.Track == file.Track;
 }
Example #3
0
        private static void TestUpload(Gphoto2.FileSystem fs)
        {
            MusicFile f = new MusicFile("/home/alan", "a.mp3");
            f.Album = "AAAA";
            f.Artist = "Band Of Horses";
            f.Bitrate = 160;
            f.Duration = 60;
            f.Format = "MP3";
            f.Genre = "Rock";
            f.Year = 2000;

            Console.WriteLine("About to upload");

            if(fs.CanUpload(f))
            {
                string path = FileSystem.CombinePath("Music", "Test");
            //				if(!fs.Contains(path))
            //					fs.CreateDirectory("Music", "Test");
            //
            //				if(fs.Contains(path, "a.mp3"))
            //				{
            //					Console.WriteLine("Deleting existing");
            //					fs.DeleteFile(path, "a.mp3");
            //				}

                Console.WriteLine("Uploading");
                try
                {
                    MusicFile fa = (MusicFile)fs.Upload(f, path);
                    Console.Write(fa.Album + fa.Artist + fa.Bitrate.ToString());
                }
                catch
                {
                    Console.WriteLine("Crashed uploading");
                }
                Console.WriteLine("Uploaded");
            }
        }
        /// <summary>
        /// Creates a new file from the supplied stream
        /// </summary>
        /// <param name="stream">The stream containing the file data
        /// A <see cref="Stream"/>
        /// </param>
//		public MusicFile(System.IO.Stream stream)
//			: base(stream)
//		{
//
//		}

        public override bool Equals(object o)
        {
            MusicFile f = o as MusicFile;

            return(f == null ? false : Equals(f));
        }