Created
February 13, 2012 06:20
-
-
Save tig/1814218 to your computer and use it in GitHub Desktop.
Mono compiler says "The variable `myStream' is assigned but its value is never used"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void toolStripButtonChooseText_Click(object sender, EventArgs e) | |
{ | |
Stream myStream = null; | |
OpenFileDialog openFileDialog = new OpenFileDialog(); | |
openFileDialog.InitialDirectory = "."; | |
openFileDialog.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"; | |
openFileDialog.FilterIndex = 1; | |
openFileDialog.RestoreDirectory = false; | |
if (openFileDialog.ShowDialog() == DialogResult.OK) | |
{ | |
Stop(); | |
try | |
{ | |
if ((myStream = openFileDialog.OpenFile()) != null) | |
{ | |
_settings.TextFile = openFileDialog.FileName; | |
CurrentTextFile = _settings.TextFile; | |
} | |
} | |
catch (Exception ex) | |
{ | |
MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment