Exemplo n.º 1
0
        public void LoadStream(Stream stream)
        {
            m_LoadingFile = true;

            AsciiPaintCanvas.DontRepaint = true;
            try
            {
                AsciiPaintCanvas.LoadStream(stream);
                numColumns.Value = AsciiPaintCanvas.Columns;
                numRows.Value    = AsciiPaintCanvas.Rows;
                m_LoadingFile    = false;
            }
            finally
            {
                AsciiPaintCanvas.DontRepaint = false;
                AsciiPaintCanvas.CompleteRepaint();
            }
        }
Exemplo n.º 2
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult res = openFileDialog.ShowDialog(this);

            if (res == DialogResult.OK)
            {
                Cursor cur = Cursor.Current;
                Cursor.Current = Cursors.WaitCursor;
                try
                {
                    m_LoadingFile = true;
                    Stream stream = openFileDialog.OpenFile();
                    AsciiPaintCanvas.LoadStream(stream);
                    stream.Close();
                    numColumns.Value = AsciiPaintCanvas.Columns;
                    numRows.Value    = AsciiPaintCanvas.Rows;
                    m_LoadingFile    = false;
                }
                finally
                {
                    Cursor.Current = cur;
                }
            }
        }