private void FormMain_Load(object sender, EventArgs ev) { string curPath = Environment.CurrentDirectory; List <string> listFullPathFilesettings = Directory.GetFiles(curPath, @"*.xls", SearchOption.TopDirectoryOnly).ToList(); listFullPathFilesettings.ForEach(fullPathFileSettings => { m_listBoxFileSettings.Items.Add(Path.GetFileName(fullPathFileSettings)); }); try { if (m_listBoxFileSettings.Items.Count > 0) { m_listBoxFileSettings.SelectedIndex = 0 ; } else { ; } // проверка выполнения ACad ACadIsRunning = ACadApp.EnsureAutoCadIsRunning(string.Empty, true); } catch (System.IO.FileNotFoundException e) { Logging.ExceptionCaller(MethodBase.GetCurrentMethod(), e); } catch (Exception e) { Logging.ExceptionCaller(MethodBase.GetCurrentMethod(), e); } }
private void buttonAcadView_Click(object sender, EventArgs e) { ACadIsRunning = ACadApp.EnsureAutoCadIsRunning(string.Empty, false); }