/// <summary> /// Imports the environment variable. /// </summary> private void ImportEnvironmentVariable() { try { openFileDialog.InitialDirectory = Environment.SpecialFolder.MyDocuments.ToString(); if (openFileDialog.ShowDialog() == DialogResult.OK) { VarImportCommand importCommand = new VarImportCommand( txtVariableName, this.EnvironmentVariableValue().ToString(), openFileDialog.FileName, this.dgvHandler); if (importCommand.IsAbleToImport) { this.AddCommand(importCommand); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error!"); } }