public static void AddFrame(this EditID3File file, string id, string text) { TextFrame frame = FrameFactory.GetFrame(id) as TextFrame; frame.Text = text; file.V2Tag.Add(frame); }
private EditTextFrame CreateTextFrame(string id, string value) { EditTextFrame frame = (EditTextFrame)FrameFactory.GetFrame(id); frame.Text = value; V2Tag.Add(frame); return(frame); }
public void SaveHighlights() { try { TextFrame frame; ID3File id3File = new ID3File(FullPath); if (id3File.ID3v2Tag == null) { id3File.ID3v2Tag = new ID3v2Tag(); } if (!TryFindHighlightsFrame(id3File.ID3v2Tag.Frames, out frame)) { frame = FrameFactory.GetFrame(FrameFactory.UserDefinedTextFrameId) as TextFrame; id3File.ID3v2Tag.Frames.Add(frame); } if (Highlights.Count > 0) { frame.Text = SerializeHighlights(Highlights); } else { id3File.ID3v2Tag.Frames.Remove(frame); } id3File.Save(FullPath); HasChanges = false; } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e.Message); } }
public static EditTextFrame GetFrameFromId(string frameId) { return(new EditTextFrame((TextFrame)FrameFactory.GetFrame(frameId))); }
public void ChangeOrCreateTextFrame(string id, string value) { EditTextFrame frame = GetTextFrame(id) ?? (EditTextFrame)FrameFactory.GetFrame(id); frame.Text = value; }