Corey Scheich
asked on
Re-Usable Property values?
I swear I read about this at some point in time but haven't had a great use for it until now and I can't seem to find anything on it anymore.
I want to re-use a SaveFileDialog and an OpenFileDialog. The initialization properties for both classes are nearly identical. Is there a way to create a class or a structure or other that could be used to fill the properties?
for example
Public Struct FileDialog
Filter = "XML Files (*.xml)|*.xml"
DefaultExt = "XML"
InitialDirectory = "c:\"
end Struct
Dim SaveFileDialog1 as new SaveFileDialog
Dim OpenFileDialog1 as new OpenFileDialog
SaveFileDialog.Properties = FileDialog 'I just made that up =)
OpenFileDialog.Properties = FileDialog 'The ability to re-use for different objects and to have multiple pre-sets for a single object
TIA
Corey2
I want to re-use a SaveFileDialog and an OpenFileDialog. The initialization properties for both classes are nearly identical. Is there a way to create a class or a structure or other that could be used to fill the properties?
for example
Public Struct FileDialog
Filter = "XML Files (*.xml)|*.xml"
DefaultExt = "XML"
InitialDirectory = "c:\"
end Struct
Dim SaveFileDialog1 as new SaveFileDialog
Dim OpenFileDialog1 as new OpenFileDialog
SaveFileDialog.Properties = FileDialog 'I just made that up =)
OpenFileDialog.Properties = FileDialog 'The ability to re-use for different objects and to have multiple pre-sets for a single object
TIA
Corey2
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Idle_Mind do you have any examples for using reflection in this manner? The examples here are likely simpler but I would like to know incase it fits this or another situation better. Thanks.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Otherwise it would have been easy to include a structure into the inherited class.
Jack.net