public void Dispose() { document.TextChanging -= OnTextReplacing; if (ParseComplete != null) { ParseComplete.Dispose(); ParseComplete = null; } if (EditorParser != null) { EditorParser.Dispose(); EditorParser = null; } }
public BeatmapInfo(string filename) { // Load, and parse. if (File.Exists(filename)) { if (filename.Split('.')[filename.Split('.').Length - 1] != "osu") { throw new InvalidBeatmapException("Unknown file format."); } Gen = GeneralParser.Parse(filename); Edit = EditorParser.Parse(filename); Meta = MetadataParser.Parse(filename); Diff = DifficultyParser.Parse(filename); Timing = TimingPointParser.Parse(filename); Color = ColourParser.Parse(filename); } else { throw new FileNotFoundException(); } }