AGS.Types.Script.LoadFromDisk C# (CSharp) Method

LoadFromDisk() public method

public LoadFromDisk ( ) : void
return void
        public void LoadFromDisk()
        {
            // Ensure that the file gets read in 8-bit ANSI
            using (BinaryReader reader = new BinaryReader(File.Open(_fileName, FileMode.Open, FileAccess.Read)))
            {
                byte[] bytes = reader.ReadBytes((int)reader.BaseStream.Length);
                _text = Encoding.Default.GetString(bytes);
            }
            _modified = false;
        }

Usage Example

Beispiel #1
0
 public void LoadScript()
 {
     if (_script == null)
     {
         _script = new Script(this.ScriptFileName, string.Empty, false);
     }
     _script.LoadFromDisk();
 }
All Usage Examples Of AGS.Types.Script::LoadFromDisk