/// <include file='doc\AdvancedPropertyDialog.uex' path='docs/doc[@for="AdvancedPropertyDialog.OnNewPropertySelected"]/*' />
        /// <devdoc>
        /// Called when the user selects a new property in the listbox.
        /// </devdoc>
        private void OnNewPropertySelected(object sender, EventArgs e)
        {
            int index = propertiesList.SelectedIndex;

            if (index == -1)
            {
                keyCombo.Items.Clear();
                keyCombo.Text    = "";
                keyCombo.Enabled = false;
                return;
            }

            keyCombo.Items.Clear();
            BindingData bindingData = (BindingData)propertiesList.SelectedItem;

            ManagedPropertiesService mpService = (ManagedPropertiesService)host.GetService(typeof(ManagedPropertiesService));

            if (mpService != null)
            {
                keyCombo.Items.Clear();
                keyCombo.Items.AddRange(mpService.GetKeysForType(bindingData.Value.Property.PropertyType));
            }

            keyCombo.Text    = bindingData.Key;
            keyCombo.Enabled = bindingData.Bound;
        }
        private void FillUI()
        {
            keyCombo.Items.Clear();

            ManagedPropertiesService mpService = (ManagedPropertiesService)binding.Host.GetService(typeof(ManagedPropertiesService));

            if (mpService != null)
            {
                keyCombo.Items.Clear();
                keyCombo.Items.AddRange(mpService.GetKeysForType(binding.Property.PropertyType));
            }

            keyCombo.Enabled      = binding.Bound;
            boundCheckbox.Checked = binding.Bound;
            keyCombo.Sorted       = true;
            keyCombo.Text         = binding.Key;
        }