private void RefreshObjects(bool AddNewsOnly) { try { var map = new DataBaseMapper(DataBaseDataSet, SelectedConnection); try { Progreso = new FormProgress(); Progreso.Show(); map.ProgressProcessChanged += ProgressProcessChanged; map.ProgressActionChanged += ProgressActionChanged; map.ProgressIncrementProcess += ProgressIncrementProcess; map.ProgressIncrementAction += ProgressIncrementAction; map.LoadAndRefreshAllObjects(true, AddNewsOnly); Progreso.Close(); Application.DoEvents(); if (map.Log.ToString() != "") { var log = new FormLog(); log.AppendText(map.Log.ToString()); log.ShowDialog(); } } catch { Progreso.Close(); Application.DoEvents(); throw; } finally { map.ProgressProcessChanged -= ProgressProcessChanged; map.ProgressActionChanged -= ProgressActionChanged; map.ProgressIncrementProcess -= ProgressIncrementProcess; map.ProgressIncrementAction -= ProgressIncrementAction; } } catch (Exception ex) { MessageBox.Show(ex.Message, Program.AssemblyTitle, MessageBoxButtons.OK, MessageBoxIcon.Error); } this.Show(); }
private void RefreshObject(XsdDataBase.TBL_ObjectRow originalObject) { try { var map = new DataBaseMapper(DataBaseDataSet, SelectedConnection); var log = new StringBuilder(); if (originalObject.Generic_Type == "StoredProcedure") map.RefreshStoredProcedure(ref originalObject); else map.RefreshObjectTable(ref originalObject); // No aplica para modo por demanda originalObject.Mapped = true; if (log.ToString() != "") { var dlg = new FormLog(); dlg.AppendText(log.ToString()); dlg.ShowDialog(); } } catch (Exception ex) { if (originalObject != null) originalObject.Mapped = false; MessageBox.Show(ex.Message, Program.AssemblyTitle, MessageBoxButtons.OK, MessageBoxIcon.Error); } }