IfcDoc.CtlProperties.buttonExampleLoad_Click C# (CSharp) Method

buttonExampleLoad_Click() private method

private buttonExampleLoad_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void buttonExampleLoad_Click(object sender, EventArgs e)
        {
            if (this.openFileDialogExample.ShowDialog() == DialogResult.OK)
            {
                DocExample docExample = (DocExample)this.m_target;
                try
                {
                    using (System.IO.FileStream fs = new System.IO.FileStream(this.openFileDialogExample.FileName, System.IO.FileMode.Open, System.IO.FileAccess.Read))
                    {
                        if (fs.Length < Int32.MaxValue)
                        {
                            docExample.File = new byte[fs.Length];
                            fs.Read(docExample.File, 0, (int)fs.Length);
                            this.textBoxExample.Text = Encoding.ASCII.GetString(docExample.File);
                        }
                        else
                        {
                            MessageBox.Show("File is too large. Example files must be 2 GB or less, and recommended to be far less than that for documentation usability.");
                        }
                    }
                }
                catch(Exception xx)
                {
                    MessageBox.Show(xx.Message);
                }
            }
        }
CtlProperties