all groups > dotnet windows forms > january 2008 >
You're in the

dotnet windows forms

group:

FileNameEditor: How do I control the returned value?


FileNameEditor: How do I control the returned value? Jeff Johnson
1/3/2008 4:49:47 PM
dotnet windows forms:
I have a need to derive from FileNameEditor to provide the ability to select
multiple files. It's not hard to make the OpenFileDialog function that way
by overriding the InitializeDialog() method, but the problem is that the
RETURN VALUE is still only a single file name. Is there any way to control
this? I thought the answer would lie in overriding ToString(), but that
didn't work. If EditValue() is what I need to use, can comeone please
explain HOW I would use it? The MSDN documentation tells me next to nothing
about this.

Also, before you suggest I use a CollectionEditor, I can't, because the
property I'm associating this with is kind of multi-purpose and needs to be
a string. It could hold any values like

C:\Temp\SomeFile.txt
"C:\Temp\1.dat" "C:\Temp\2.dat" "C:\Temp\3.dat"
C:\Data\*.txt
C:\\Data\\[^.]*\.(dat|csv|txt)

Re: FileNameEditor: How do I control the returned value? Jeff Johnson
1/4/2008 2:20:57 PM
[quoted text, click to view]

It appears that EditValue() is the answer. I found a good article at
http://www.devx.com/DevX/Article/20920/0/page/1 and also a decent MSDN code
sample in the docs for the IWindowsFormsEditorService Interface.

Re: FileNameEditor: How do I control the returned value? Jeff Johnson
1/4/2008 6:27:25 PM
[quoted text, click to view]

Note to self: next time just use Reflector and disassemble a Framework class
to see how Microsoft did it....

AddThis Social Bookmark Button