public IEnumerator<IWordData> GetEnumerator () { string line = null; string wordData = ""; using (m_reader = new StreamReader (m_fileName)) { while ((line = m_reader.ReadLine ()) != null) { Match match = m_newWordTitle.Match (line); if (match.Success) { if (m_lastWordTitle == null) { m_lastWordTitle = match.Value; } else { English1WordData wordDataObject = new English1WordData (m_lastWordTitle, wordData, m_replace); if (!wordDataObject.IsObsolete && !string.IsNullOrEmpty(wordDataObject.Descriptor)) { yield return wordDataObject; } m_lastWordTitle = match.Value; wordData = ""; } } wordData += "\n" + line; } } }
public IEnumerator <IWordData> GetEnumerator() { string line = null; string wordData = ""; using (m_reader = new StreamReader(m_fileName)) { while ((line = m_reader.ReadLine()) != null) { Match match = m_newWordTitle.Match(line); if (match.Success) { if (m_lastWordTitle == null) { m_lastWordTitle = match.Value; } else { English1WordData wordDataObject = new English1WordData(m_lastWordTitle, wordData, m_replace); if (!wordDataObject.IsObsolete && !string.IsNullOrEmpty(wordDataObject.Descriptor)) { yield return(wordDataObject); } m_lastWordTitle = match.Value; wordData = ""; } } wordData += "\n" + line; } } }