private void _refreshOptimizationList(int selectObjectWithId) { listBoxOptimizations.Items.Clear(); navMasterPath.resetPositions(); PNavigator navMasterItems = new PNavigator(_data.Root, navMasterPath); if (navMasterItems.Pointer.Id != _data.Root.Id) { ListBox.ObjectCollection items = new ListBox.ObjectCollection(listBoxOptimizations); int selectIndex = -1; do { IPObject obj = navMasterItems.Pointer; if (obj != null) { RMasterItem item = new RMasterItem(); item.Title = formatMasterItem(obj); item.Object = obj; items.Add(item); if (obj.Id == selectObjectWithId) selectIndex = items.Count - 1; } } while (navMasterItems.Navigate(0, NAV_DIRECTION.DOWN, false) != null); listBoxOptimizations.BeginUpdate(); listBoxOptimizations.Items.Clear(); listBoxOptimizations.Items.AddRange(items); if (selectIndex >= 0) listBoxOptimizations.SelectedIndex = selectIndex; listBoxOptimizations.EndUpdate(); } //listBoxOptimizations.EndUpdate(); }
private void Awesomium_Windows_Forms_WebControl_DocumentReady(object sender, Awesomium.Core.UrlEventArgs e) { try { if (this.master != null) { _jsObject = webControlDetails.CreateGlobalJavascriptObject("app"); _jsBind(); _addProcessedClass(); //enableChildControls(panelNavigator, true); //enableChildControls(panelAppCommands, true); navDetailPath.resetPositions(); navDetails = new PNavigator(this.master, this.navDetailPath); navDetails.OnNavigated += navDetails_OnNavigated; this.scrollDetailViewOnNavigate = true; navDetails.Navigate(navDetailPath); } } catch (Exception ex) { MessageBox.Show("Document Ready handler exception:\r\n" + ex.Message, "Ошибка в обработчике", MessageBoxButtons.OK, MessageBoxIcon.Error); } }