Property inspector. What's happening ?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Property inspector. What's happening ?

  1. #1
    Willy Van den Driessche Guest

    Property inspector. What's happening ?

    When I put an ErrorProvider (say errorProvider1) on a windows form I get new
    properties on all other controls (Error on ErrorProvider1). Putting another
    ErrorProvider (say ErrorProvider2) on it, adds yet more properties to them.
    I'm convinced that this is intended behavior. But I'm not sure How it
    happens. [for some reason I can only access my helpfiles on CD and I left
    it at the office] A quick look told be it had something to do with
    ProvidePropertyAttribute and the IExtenderProvider interface.

    Does anybody know how it works ?
    Does anybody know if there are more goodies like this ?
    Does anybody have a good reference book where these things are explained ?
    (not listed but explained ?) Will MS publish a series of books like the MFC
    documentation (although I prefer having the rationale behind above a
    reference work)


    --
    Van den Driessche Willy
    For a work in progress :
    http://users.skynet.be/wvdd2/index.html



  2. #2
    Kathleen Dollard Guest

    Re: Property inspector. What's happening ?

    Willy,

    Actually this _is_ a really cool feature called extenders that is mostly
    ignored. I did an article in VSM on this in September or October (Desktop
    Developer column). I used an example of adding events, but these pups can be
    widely used. They also provide ToolTips if you need an example to try to
    explain to someone how they work. .

    An extender is a separate component. All it has to do is fulfill hte
    component interface so that it can be sited, and IExtender to provide the
    pseudo-properties. A single extneder can provide multiple properties. You
    can control which controls get the extender property. As interestingly, you
    control what happens when the property is set. It is set when the control is
    loaded, so you can do fun things like hook up events based on the property
    (the point of the article), as well as the simplest case where you provide a
    property that your event code can use to determine behavior.

    There are some gotchas, and it took a bit of effort to figure out just how
    to set up the attributes, and some of the property Set stuff is different
    than I expected (annoying set/get procs rather than proper properties) so I
    would suggest trying to modify an existing extender example. If you don't
    have access to VSM or its archives, let me know and I will try to explain
    further.

    In my opinion, your gut feel that thsi was the tip of something interesting
    is spot on. I think it is one of the two most innovative features in .NET
    (regions being the other). They are in my bag of tricks and worth figuring
    out how to use.

    Kathleen




  3. #3
    Phil Weber Guest

    Re: Property inspector. What's happening ?

    > Actually this _is_ a really cool feature called extenders that
    > is mostly ignored. I did an article in VSM on this in September
    > or October (Desktop Developer column).


    Kathleen/Willy: October. The article is available online here:
    <http://www.devx.com/premier/mgznarch...0oct01/dt0110/
    dt0110.asp>.
    ---
    Phil Weber



  4. #4
    Willy Van den Driessche Guest

    Re: Property inspector. What's happening ?


    "Phil Weber" <pweber @ fawcette.com> wrote:
    > > Actually this _is_ a really cool feature called extenders that
    > > is mostly ignored. I did an article in VSM on this in September
    > > or October (Desktop Developer column).

    >
    >Kathleen/Willy: October. The article is available online here:
    ><http://www.devx.com/premier/mgznarch...0oct01/dt0110/
    >dt0110.asp>.
    >---
    >Phil Weber
    >
    >


    Thanks both.
    Extenders are a very handy thing for me. Up until now, I created Usercontrols
    for each business object. We used the BrokenRules mechanism of Lhotka.
    For each brokne rule we added a property path that identified the "most likely
    wrong" property. The form was then able to use this property path to bring
    focus to the visual control that "represented" the property. For this, there
    was a chain of responsibility inside the usercontrols to bring focus to the
    corresponding property.
    I don't know inhowfar you are still following, but extenders allow me to
    "set the business object property ID on the visual control". No more ugly
    case statements for this one. I like it (a lot). It will be a chain of
    extenders doing my work.

    Come to think of it, extenders are "only possible" due to the inheritance
    structure for the visual and other controls. On my toplist is also the fact
    that a "TextBox" or "Control" property on a control now opens up a dropdown
    in the form designer. That eliminates some coding too. My problem will
    be how to control this box of Pandora. Those are possibilities we didn't
    have in VB6 (you could code property pages of course) and now we have a lot
    more things to decide when designing an application.

    As I said in a previous post, the errorprovider can help me even further
    with showing validation errors. (we do it now by showing/hiding image controls
    which is nice for the user but not for the programmer) Cool.

    See you both and thanks again,
    Van den Driessche Willy



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center