public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
		{
			if((context != null) && (provider != null)) 
			{
				// Access the Property Browser's UI display service
				_editorService = (IWindowsFormsEditorService)	provider.GetService(typeof(IWindowsFormsEditorService));

				if(_editorService != null)
				{
					_listBox = new ListBox();
					_listBox.Click += new EventHandler(_listBox_Click);
					_listBox.BorderStyle = BorderStyle.None;
                    nugenCCalc = (NugenCCalcBase)context.Instance;

                    if (nugenCCalc.Site.DesignMode)
                    {
                        foreach (Component component in context.Container.Components)
                        {
                            try
                            {
                                if (nugenCCalc.ValidateControl(component))
                                    _listBox.Items.Add(component);
                            }
                            catch { }
                        }
                    }
                    else 
                    {
                        if (nugenCCalc.Owner != null)
                        {
                            IterateControls((nugenCCalc.Owner as Form).Controls);
                        }
                    }
					
					_editorService.DropDownControl(_listBox);
					if (_listBox.SelectedItem != null)
						value = _listBox.SelectedItem;
				}
			}
			return value;
		}
示例#2
0
		/// <summary>
		/// Initializes a new instance of the PropertyView class.
		/// </summary>
		/// <param name="component">NugenCCalcComponent component</param>
		public PropertyView(NugenCCalcBase component) : this()
		{			
			_component = component;
		}