can't edit properties on custom attribute types

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
mindplay
Posts: 148
Joined: Tue 13 Dec 2011 22:58
Location: Ithaca, NY

can't edit properties on custom attribute types

Post by mindplay » Wed 28 Dec 2011 18:03

I have the following attribute type:

Code: Select all

 
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
    public class BinderAttribute : Attribute
    {
        /// <summary>
        /// Specifies the kind of binding to perform on the property.
        /// </summary>
        public BinderMode Mode { get; set; }

        public BinderAttribute()
        {
            Mode = BinderMode.Reference;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="BinderAttribute"/> class.
        /// </summary>
        public BinderAttribute(BinderMode mode)
        {
            Mode = mode;
        }
    }
It has a single, public property with the following enum type:

Code: Select all

 
    public enum BinderMode
    {
        /// <summary>
        /// Bind the property as a reference to another entity.
        /// </summary>
        Reference = 1,

        /// <summary>
        /// Bind the property as a list of references to another type of entity.
        /// </summary>
        MultiReference =2,

        /// <summary>
        /// Bind the property as a contained entity, belonging to the entity to which the property belongs.
        /// </summary>
        Contained = 3
    }
In the user-interface, the BinderMode property doesn't show, so I can't edit it's value.

What gives?

Shalex
Site Admin
Posts: 8240
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 29 Dec 2011 12:16

We have compiled a separate class library with your BinderAttribute class and BinderMode enum, added it via right click on diagram > Model Settings > Attributes menu. Then right click on diagram > Attributes > move BinderAttribute to Selected Attributes => there is the Mode property in the Properties section with drop-down list of all BinderMode enum members. So we cannot reproduce the problem with Entity Developer v 4.2.95.

mindplay
Posts: 148
Joined: Tue 13 Dec 2011 22:58
Location: Ithaca, NY

Post by mindplay » Thu 29 Dec 2011 16:25

Yeah, this is weird - not sure what's going on here. This fixed it:

Code: Select all

        [Browsable(true)]
        public BinderMode Mode { get; private set; }
According to the MSDN documentation, "By default, a public property is always shown in the grid" - so I should not need to explicitly mark the property as Browsable.

Perhaps your PropertyGrid behaves differently from the standard PropertyGrid?

mindplay
Posts: 148
Joined: Tue 13 Dec 2011 22:58
Location: Ithaca, NY

Post by mindplay » Fri 30 Dec 2011 22:24

I figured out what's wrong here.

Try adding two different attributes to a property.

Now click back and forth between them on the "select attributes" list - it appears, sometimes, if you click too quickly, it registers as a double-click, and the property-grid below does not update... that is, the selection changes, but the property-grid is still displaying the properties of the previously selected attribute.

(try hooking the mouse-down or select-event instead of the click-event, which may not broadcast for double-clicks)

Helen
Devart Team
Posts: 127
Joined: Wed 07 Sep 2011 11:54

Post by Helen » Wed 04 Jan 2012 11:23

Thank you for the detailed explanation.

We have reproduced the described behaviour. We will fix the issue and inform you when the build containing the fix is published.

Helen
Devart Team
Posts: 127
Joined: Wed 07 Sep 2011 11:54

Post by Helen » Thu 12 Jan 2012 15:10

We've fixed the bug with invalid Properties grid data refreshing for the selected attribute in the Attributes dialog box.

The fix is available in the latest 4.2.110 build of Entity Developer.
The new build can be downloaded from http://www.devart.com/entitydeveloper/download.html (the trial and free versions) or from Registered Users' Area (provided that you have an active subscription).

For the detailed information about the improvements and fixes available in Entity Developer 4.2.110, please refer to
http://www.devart.com/forums/viewtopic.php?t=23135

Post Reply