private void TryOpenGCode(string path) { try { StreamReader sr = new StreamReader(path); try { GParser.Reset(); List<GCodeCommand> Commands = GParser.Parse(sr); GCodePreview prev = new GCodePreview(Commands, this, path); HeightMapUpdated += prev.HeightMapUpdated; prev.Show(); prev.BringToFront(); } catch (Exception ex) { MessageBox.Show(string.Format("Error while parsing file {0}\n{1}", path, ex.Message)); } } catch (Exception ex) { MessageBox.Show(string.Format("Error while opening file {0}\n{1}", path, ex.Message)); } }
private void openFileDialogGCode_FileOk(object sender, CancelEventArgs e) { foreach (string path in openFileDialogGCode.FileNames) { try { StreamReader sr = new StreamReader(path); try { GParser.Reset(); List<GCodeCommand> Commands = GParser.Parse(sr); GCodePreview prev = new GCodePreview(Commands, this, path); HeightMapUpdated += prev.HeightMapUpdated; prev.Show(); prev.BringToFront(); } catch (Exception ex) { MessageBox.Show(string.Format("Error while parsing file {0}\n{1}", path, ex.Message)); } } catch (Exception ex) { MessageBox.Show(string.Format("Error while opening file {0}\n{1}", path, ex.Message)); } } }
private void TryOpenGCode(string path) { try { StreamReader sr = new StreamReader(path); try { GParser.Reset(); List <GCodeCommand> Commands = GParser.Parse(sr); GCodePreview prev = new GCodePreview(Commands, this, path); HeightMapUpdated += prev.HeightMapUpdated; prev.Show(); prev.BringToFront(); } catch (Exception ex) { MessageBox.Show(string.Format("Error while parsing file {0}\n{1}", path, ex.Message)); } } catch (Exception ex) { MessageBox.Show(string.Format("Error while opening file {0}\n{1}", path, ex.Message)); } }
private void openFileDialogGCode_FileOk(object sender, CancelEventArgs e) { foreach (string path in openFileDialogGCode.FileNames) { try { StreamReader sr = new StreamReader(path); try { GParser.Reset(); List <GCodeCommand> Commands = GParser.Parse(sr); GCodePreview prev = new GCodePreview(Commands, this, path); HeightMapUpdated += prev.HeightMapUpdated; prev.Show(); prev.BringToFront(); } catch (Exception ex) { MessageBox.Show(string.Format("Error while parsing file {0}\n{1}", path, ex.Message)); } } catch (Exception ex) { MessageBox.Show(string.Format("Error while opening file {0}\n{1}", path, ex.Message)); } } }