BitOrchestra.MainForm._Load C# (CSharp) Method

_Load() private method

Opens an open file dialog for loading text.
private _Load ( ) : void
return void
        private void _Load()
        {
            OpenFileDialog ofg = new OpenFileDialog();
            ofg.Filter = _FileFilter;
            ofg.RestoreDirectory = true;

            if (ofg.ShowDialog() == DialogResult.OK)
            {
                using (TextReader tr = new StreamReader(ofg.FileName))
                {
                    string text = tr.ReadToEnd();
                    text = Regex.Replace(text, @"\r\n|\n\r|\n|\r", "\r\n");
                    this._Text.Text = text.ToString();
                    tr.Close();
                }
                this._Saved = true;
            }
        }