private void PerformImport(string strFileExt, string strFileDesc, ImportFn f) { OpenFileDialogEx ofd = UIUtil.CreateOpenFileDialog("Import " + strFileDesc, strFileDesc + " (*." + strFileExt + ")|*." + strFileExt + "|All Files (*.*)|*.*", 1, strFileExt, false, AppDefs.FileDialogContext.Import); if (ofd.ShowDialog() != DialogResult.OK) { return; } try { f(m_trl, IOConnectionInfo.FromPath(ofd.FileName)); } catch (Exception ex) { MessageBox.Show(this, ex.Message, TrlUtilName, MessageBoxButtons.OK, MessageBoxIcon.Warning); } UpdateStringTableUI(); UpdateControlTree(); m_tvControls.SelectedNode = m_tvControls.Nodes[0]; UpdatePreviewForm(); }
private void PerformImport(string strFileExt, string strFileDesc, ImportFn f) { OpenFileDialogEx ofd = UIUtil.CreateOpenFileDialog("Import " + strFileDesc, strFileDesc + " (*." + strFileExt + ")|*." + strFileExt + "|All Files (*.*)|*.*", 1, strFileExt, false, AppDefs.FileDialogContext.Import); if(ofd.ShowDialog() != DialogResult.OK) return; try { f(m_trl, IOConnectionInfo.FromPath(ofd.FileName)); } catch(Exception ex) { MessageService.ShowWarning(ex); } UpdateStringTableUI(); UpdateControlTree(); m_tvControls.SelectedNode = m_tvControls.Nodes[0]; UpdatePreviewForm(); }