internal Id3Frame GetFrameFromFrameId(string frameId) { FrameHandler handler = FrameHandlers[frameId]; if (handler != null) { return((Id3Frame)Activator.CreateInstance(handler.Type)); } return(new UnknownFrame { Id = frameId }); }
/// <summary> /// Retrieves the frame ID from the specified frame instance. /// </summary> /// <param name="frame">The frame instance.</param> /// <returns>The frame ID, or null if there is no frame handler for the specified frame instance.</returns> internal string GetFrameIdFromFrame(Id3Frame frame) { if (frame is UnknownFrame unknownFrame) { return(unknownFrame.Id); } Type frameType = frame.GetType(); FrameHandler handler = FrameHandlers[frameType]; return(handler?.FrameId); }
internal string GetFrameIdFromFrame(Id3Frame frame) { var unknownFrame = frame as UnknownFrame; if (unknownFrame != null) { return(unknownFrame.Id); } Type frameType = frame.GetType(); FrameHandler handler = FrameHandlers[frameType]; return(handler != null ? handler.FrameId : null); }