Exemplo n.º 1
0
        private IEnumerable <Tuple <Data.ProjectFile, MatchCollection> > GetMatches(Data.UI.TextEditorBaseDataContext curEditor, IEnumerable <Data.ProjectFile> files)
        {
            var regex = this.GetRegex();

            if (regex == null)
            {
                yield break;
            }
            if (curEditor != null)
            {
                yield return(new Tuple <Data.ProjectFile, MatchCollection>(curEditor.FileReference, regex.Matches(curEditor.FileReference.GetContentAsString())));
            }
            foreach (var it in files)
            {
                if (curEditor != null && curEditor.FileReference == it)
                {
                    continue;
                }
                var str = it.GetContentAsString();
                if (str.Contains('\0'))
                {
                    continue;
                }
                yield return(new Tuple <Data.ProjectFile, MatchCollection>(it, regex.Matches(str)));
            }
        }
Exemplo n.º 2
0
 private IEnumerable <Tuple <Data.ProjectFile, MatchCollection> > GetMatches(Data.UI.TextEditorBaseDataContext curEditor, params Data.ProjectFile[] files) => this.GetMatches(curEditor, (IEnumerable <Data.ProjectFile>)files);