/// <summary> /// Tries to get the media identified by <paramref name="id"/> and fills <paramref name="noteMediaData"/> /// with the retrieved media. /// </summary> /// <param name="noteData"></param> /// <param name="id">The id of the media to retrieve.</param> /// <param name="noteMediaData">The media to fill with the retrieval result.</param> /// <returns></returns> public static bool TryGetMedia(this NoteData noteData, int id, out NoteMediaData noteMediaData) { if (!noteData.HasMedia(id)) { noteMediaData = null; return(false); } noteMediaData = noteData.GetMedia(id); return(true); }