public void UpdateForView(UIForm Form) { if (changeTimer.Enabled) { PushChanges(); } // Make sure we are initializing Initializing = true; try { List <String> items; GrtValue newObjList; String objDescr; form = Form; if (null != form) { objDescr = wbContext.get_description_for_selection(form, out newObjList, out items); } else { objDescr = wbContext.get_description_for_selection(out newObjList, out items); } // update only if selection was changed if (!wbContext.are_lists_equal(activeObjList, newObjList)) { objSelComboBox.Items.Clear(); // Set description text if (null != activeObjList) { activeObjList.Dispose(); } activeObjList = newObjList; // Set properties NoItemsSelected = (null == items) || (0 == items.Count); MultipleItemsSelected = (items.Count > 1); // handle different number of selected items if (!NoItemsSelected) { objSelComboBox.SuspendLayout(); objSelComboBox.Items.Clear(); objSelComboBox.Items.AddRange(items.ToArray()); objSelComboBox.ResumeLayout(); objSelComboBox.SelectedIndex = 0; // lock on multi selection if (MultipleItemsSelected) { objDescr = "<double-click to overwrite multiple objects>"; ObjectDescriptionEnabled = false; } else { ObjectDescriptionEnabled = true; } } else { objSelComboBox.SuspendLayout(); objSelComboBox.Items.Clear(); objSelComboBox.Items.Add("No Selection"); objSelComboBox.ResumeLayout(); objSelComboBox.SelectedIndex = 0; objDescr = ""; ObjectDescriptionEnabled = false; } ObjectDescription = objDescr; } } finally { Initializing = false; } }