/// <summary> /// Update the application controls data source. /// </summary> public void UpdateAppControlDataSource(Workspace kws) { foreach (BaseAppControl ctrl in m_mainForm.AppControlTree.Values) { KwsApp app = (kws == null) ? null : kws.GetApp(ctrl.ID); try { ctrl.SetDataSource(app); } // Handle the error and continue updating the controls source // if possible. catch (Exception ex) { if (app != null) kws.HandleAppFailure(app, ex); else Base.HandleException(ex, true); } } }