public static MusicCdIdentifierFrame Get(TagLib.Id3v2.Tag tag, bool create) { MusicCdIdentifierFrame frame; IEnumerator<Frame> enumerator = tag.GetEnumerator(); try { while (enumerator.MoveNext()) { Frame current = enumerator.Current; frame = current as MusicCdIdentifierFrame; if (frame != null) { return frame; } } } finally { if (enumerator == null) { } enumerator.Dispose(); } if (!create) { return null; } frame = new MusicCdIdentifierFrame(); tag.AddFrame(frame); return frame; }
public override Frame Clone() { MusicCdIdentifierFrame frame = new MusicCdIdentifierFrame(); if (this.field_data != null) { frame.field_data = new ByteVector(this.field_data); } return frame; }
public override Frame Clone() { MusicCdIdentifierFrame frame = new MusicCdIdentifierFrame(); if (field_data != null) { frame.field_data = new ByteVector(field_data); } return(frame); }
public static MusicCdIdentifierFrame Get(Tag tag, bool create) { MusicCdIdentifierFrame mcdi; foreach (Frame frame in tag) { mcdi = frame as MusicCdIdentifierFrame; if (mcdi != null) { return(mcdi); } } if (!create) { return(null); } mcdi = new MusicCdIdentifierFrame(); tag.AddFrame(mcdi); return(mcdi); }
public void TestMusicCdIdentifierFrame () { MusicCdIdentifierFrame frame = new MusicCdIdentifierFrame (); ByteVector data = val_sing; data.Add (data); data.Add (data); data.Add (data); data.Add (data); data.Add (data); data.Add (data); data.Add (data); data.Add (data); data.Add (data); data.Add (data); data.Add (data); data.Add (data); // data.Add (data); data.Add (data); data.Add (data); frame.Data = data; FrameTest (frame, 2, null, delegate (ByteVector d, byte v) { return new MusicCdIdentifierFrame (d, v); }, delegate (Frame f, string m) { MusicCdIdentifierFrame g = (f as MusicCdIdentifierFrame); Assert.AreEqual (data, g.Data, m); }); }
/// <summary> /// Gets a music CD identifier frame from a specified tag, /// optionally creating it if it does not exist. /// </summary> /// <param name="tag"> /// A <see cref="Tag" /> object to search in. /// </param> /// <param name="create"> /// A <see cref="bool" /> specifying whether or not to create /// and add a new frame to the tag if a match is not found. /// </param> /// <returns> /// A <see cref="MusicCdIdentifierFrame" /> object containing /// the matching frame, or <see langword="null" /> if a match /// wasn't found and <paramref name="create" /> is <see /// langword="false" />. /// </returns> public static MusicCdIdentifierFrame Get (Tag tag, bool create) { MusicCdIdentifierFrame mcdi; foreach (Frame frame in tag) { mcdi = frame as MusicCdIdentifierFrame; if (mcdi != null) return mcdi; } if (!create) return null; mcdi = new MusicCdIdentifierFrame (); tag.AddFrame (mcdi); return mcdi; }