示例#1
0
        private void cmdExpand_Click(object sender, EventArgs e)
        {
            Type           t   = this.ParameterInfo.ParameterType;
            object         obj = Activator.CreateInstance(t);
            FormShowObject frm = new FormShowObject(obj);
            DialogResult   res = frm.ShowDialog();

            if (res != DialogResult.Cancel)
            {
                this.Value = frm.SelectedObject;
            }

            frm.Dispose();
        }
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (null != context && null != context.Instance && null != provider)
            {
                this._service = (System.Windows.Forms.Design.IWindowsFormsEditorService)provider.GetService(typeof(System.Windows.Forms.Design.IWindowsFormsEditorService));
                if (null != this._service)
                {
                    FormShowObject frm = new FormShowObject(value);
                    switch (this._service.ShowDialog(frm))
                    {
                    case DialogResult.OK:
                        value = frm.SelectedObject;
                        break;

                    case DialogResult.Cancel:
                        break;
                    }
                }
            }

            return(value);
        }
        private void DisplaySingleObject(object obj)
        {
            FormShowObject frm = new FormShowObject(obj);

            frm.ShowDialog();
        }