ARCed.Scripting.Script.Load C# (CSharp) Method

Load() public method

Loads a script file from the given path
public Load ( string filename ) : bool
filename string The path to the script
return bool
        public bool Load(string filename)
        {
            try
            {
                this._text = File.ReadAllText(filename, Encoding.UTF8).Replace("  ", "\t");
                filename = Path.GetFileNameWithoutExtension(filename);
                if (String.IsNullOrEmpty(filename))
                    return false;
                this._title = filename.Substring(5, filename.Length - 5);
                this.NeedSaved = false;
                return true;
            }
            catch
            {
                this._text = "";
                this._title = "";
                this.NeedSaved = true;
                return false;
            }
        }