CSI.Interpreter.ReadIncludeFile C# (CSharp) Method

ReadIncludeFile() public method

public ReadIncludeFile ( string file ) : bool
file string
return bool
        public bool ReadIncludeFile(string file)
        {
            if (File.Exists(file))
            {
                CodeChunk.DumpingValue = false;
                using (TextReader tr = File.OpenText(file))
                {
                    while (ProcessLine(tr.ReadLine()))
                        ;
                }
                CodeChunk.DumpingValue = true;
                return true;
            }

            return false;
        }

Usage Example

 // It's possible to load scripts from within the interpreter.
 public static void Include(string file)
 {
     interpreter.ReadIncludeFile(file);
 }
All Usage Examples Of CSI.Interpreter::ReadIncludeFile