コード例 #1
0
 public bool Equals(Catalog_Item x)
 {
     if (x.Title.GetValue() == this.Title.GetValue())
     {
         if (x.Album.GetValue() == this.Album.GetValue())
         {
             if (x.Duration.GetValue() == this.Duration.GetValue())
             {
                 if (x.File.GetValue() == this.File.GetValue())
                 {
                     if (x.MainArtist.GetValue() == this.MainArtist.GetValue())
                     {
                         if (!(x.FeatArtist != null ^ this.FeatArtist != null))
                         {
                             if (x.FeatArtist != null)
                             {
                                 if (x.FeatArtist.Length == this.FeatArtist.Length)
                                 {
                                     for (int i = 0; i < x.FeatArtist.Length; i++)
                                     {
                                         if (x.FeatArtist[i].GetValue() != this.FeatArtist[i].GetValue())
                                         {
                                             return(false);
                                         }
                                     }
                                 }
                                 else
                                 {
                                     return(false);
                                 }
                             }
                             if (!(x.Genres != null ^ this.Genres != null))
                             {
                                 if (x.Genres != null)
                                 {
                                     if (x.Genres.Length == this.Genres.Length)
                                     {
                                         for (int i = 0; i < x.Genres.Length; i++)
                                         {
                                             if (x.Genres[i].GetValue() != this.Genres[i].GetValue())
                                             {
                                                 return(false);
                                             }
                                         }
                                     }
                                     else
                                     {
                                         return(false);
                                     }
                                 }
                                 return(true);
                             }
                         }
                     }
                 }
             }
         }
     }
     return(false);
 }
コード例 #2
0
        public int FindEntry(Wrapper arg)
        {
            Catalog_Item tmp = Create_Item(arg);

            if (list != null)
            {
                return(list.FindIndex(x => x.Equals(tmp)));
            }
            return(-1);
        }
コード例 #3
0
        public int AddEntry(Wrapper arg, int index)
        {
            if (list == null)
            {
                list = new List <Catalog_Item>();
            }
            Catalog_Item tmp = Create_Item(arg);

            if (index >= 0)
            {
                list[index] = tmp;
            }
            else
            {
                list.Add(tmp);
            }
            return(list.Count);
        }