Exemplo n.º 1
0
			public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
			{
				if (context != null && context.Instance != null)
				{
					GridItem gridItem = context as GridItem;

					ReferencePathCollectionEditorForm form = new ReferencePathCollectionEditorForm();
					form.ReferencePaths = (ReferencePathCollection)value;
					DialogResult result = form.ShowDialog();

					object returnObject = null;
					if (result == DialogResult.OK)
					{
						returnObject = form.ReferencePaths;
						RemoveBlankPaths(returnObject as ReferencePathCollection);
					}
					else
					{
						//HACK: we must collapse any child members, otherwise a PropertyGrid bug will cause an error msg to appear
						CollapseChildren(gridItem);
						returnObject = value;
					}

					return returnObject;
				}
				else
					return value;
			}
			public RefPathPropGridProxy(ReferencePathCollectionEditorForm editorForm)
			{
				_editorForm = editorForm;
				ListViewItem li = editorForm.listView1.SelectedItems[0];
				_listViewItem = li;
				_referencePath = (ReferencePath)li.Tag;
			}