Ejemplo n.º 1
0
 public Track(
     // LibraryEntry
     uint id,
     Uri location,
     TimeSpan?duration,
     DateTime?lastModified,
     uint?fileSizeBytes,
     // Track
     string title,
     IEnumerable <string> performers,
     IEnumerable <string> composers,
     uint?year,
     TrackAlbumAssociation albumAssociation)
     : this(id, location, duration, lastModified, fileSizeBytes, title, performers, composers, year, albumAssociation, false, DateTime.Now)
 {
 }
Ejemplo n.º 2
0
 public AddTrackCommand(
     // LibraryEntry
     Uri location,
     TimeSpan?duration,
     DateTime?lastModified,
     uint?fileSizeBytes,
     // Track
     string title,
     IEnumerable <string> performers,
     IEnumerable <string> composers,
     uint?year,
     TrackAlbumAssociation albumAssociation)
     : base(location, duration, lastModified, fileSizeBytes)
 {
     this.Title            = title;
     this.Performers       = performers.ToImmutableArray();
     this.Composers        = composers.ToImmutableArray();
     this.Year             = year;
     this.AlbumAssociation = albumAssociation;
 }
Ejemplo n.º 3
0
 public Track(
     // LibraryEntry
     uint id,
     Uri location,
     TimeSpan?duration,
     DateTime?lastModified,
     uint?fileSizeBytes,
     // Track
     string title,
     IEnumerable <string> performers,
     IEnumerable <string> composers,
     uint?year,
     TrackAlbumAssociation albumAssociation,
     bool isLoved,
     DateTime addedToLibraryDateTime)
     : base(id, location, duration, lastModified, fileSizeBytes, isLoved, addedToLibraryDateTime)
 {
     this.Title            = title?.Trim(); // ?? throw new ArgumentNullException(nameof(title));
     this.Performers       = performers.EmptyIfNull().RemoveNullOrWhitespaces().TrimAll().ToImmutableArray();
     this.Composers        = composers.EmptyIfNull().RemoveNullOrWhitespaces().TrimAll().ToImmutableArray();
     this.AlbumAssociation = albumAssociation;
     this.Year             = year.ThrowIf(x => x > DateTime.Now.Year, () => throw new ArgumentOutOfRangeException(nameof(year)));
 }