Prolog.KnowledgeBase.Reconsult C# (CSharp) Method

Reconsult() private method

private Reconsult ( string path ) : void
path string
return void
        public void Reconsult(string path)
        {
            if (Path.GetExtension(path) == string.Empty && Directory.Exists(path))
            {
                foreach (var file in Directory.GetFiles(Prolog.LoadDirectoryPath(path)))
                    if (IsSourceFile(file))
                        Reconsult(file);
            }
            else
            {
                path = Prolog.LoadFilePath(path);
                using (var stream = File.OpenText(path))
                {
                    string savedFileName = Prolog.CurrentSourceFile;
                    int savedLineNumber = Prolog.CurrentSourceLineNumber;
                    try
                    {
                        Prolog.CurrentSourceFile = path;
                        Prolog.CurrentSourceLineNumber = 0;
                        Reconsult(new PositionTrackingTextReader(stream, path));
                    }
                    finally
                    {
                        Prolog.CurrentSourceFile = savedFileName;
                        Prolog.CurrentSourceLineNumber = savedLineNumber;
                    }
                }
            }
        }

Same methods

KnowledgeBase::Reconsult ( Stream stream ) : void
KnowledgeBase::Reconsult ( TextReader inStream ) : void