Runtime PropertyGrid and custom UITypeEditor with Business object

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I have a conundrum I'm hoping someone here might have an idea for:

I am implementing a propertygrid on a form that is "bound" to a business
object class containing global settings that a user will edit using the
property grid.
So far so good, works just fine etc etc.

One of the properties is a string that requires a separate dialog box to
edit it.

No problem normally: I can just use a custom UI Type editor, however, I
don't think I can because the class with the property being edited is in a
business object layer assembly that knows nothing about Windows Forms, it's
got no UI code whatsoever and is used for both the web and winform version
of the app.

I can't put the UIEditor code in the business object layer as that would
create a dependancy on windows forms.

I can't put the UIEditor code in the Winform UI layer assembly because I
would then need to reference it in the Editor attribute of the property in
the business object which would create a dependancy on the UI Layer which I
can't have obviously.

My only potential solution I can think of is to duplicate the business
objects properties in a "middle-man" object in the UI and copy back and
forth as it's edited, but this seems really clunky and will result in two
separate classes that need to be kept in sync during development rather than
the nice neat single one now.

I can't find any way of setting the editor at runtime and attributes can't
be changed at runtime so that avenue seems to be out as well.

Is there any way to accomplish this?

Any ideas would be gratefully appreciated.


.



Relevant Pages

  • Re: proper programming? (events)
    ... User's permissions. ... abstracted into a business object). ... which delegate to be registered as an event handler. ... processing in the appropriate business object. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: OO Design, Physical Implementation, DAOs
    ... You have a feature request called "Maintainability". ... must write a structured business object layer that you can maintain. ... You test this by maintaining it, as you design it. ...
    (comp.object)
  • Re: What is a business object?
    ... the business object. ... backend database Entity necessarily. ... I don't assume a business object always needs a persistance. ... can there be such a thing as a business layer? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Adding New Rows in DataGridView when Bound to BindingList
    ... I am binding a DataGridView with a BindingList, ... I obviously loose this somewhere when I switch to my custom business ... Is this something I have to implement at the business object ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Repositories, package dependencies, and domain-flavoured exceptions
    ... > particular kind of Customer using an Account Number. ... -'command' corresponding to business process layer ... -'domain' corresponding to business object layer ...
    (comp.object)