Exemple #1
0
        private void LoadFromContent(string content)
        {
            var rawContent = content.Split(new[] { Environment.NewLine }, StringSplitOptions.None);

            foreach (var line in rawContent)
            {
                var lrc = new LrcModel(line);
                LrcModels.Add(lrc);
            }
        }
Exemple #2
0
        private void LoadFromFile(string filePath)
        {
            using (var fs = new FileStream(filePath, FileMode.Open, FileAccess.Read))
            {
                using (var sr = new StreamReader(fs))
                {
                    var line = sr.ReadLine();
                    for (; line != null; line = sr.ReadLine())
                    {
                        if (string.IsNullOrWhiteSpace(line))
                        {
                            continue;
                        }

                        var lrc = new LrcModel(line);
                        LrcModels.Add(lrc);
                    }
                }
            }
        }