Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Errors after update to version3.1 (Read 3060 times)
PDM.
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 256
Joined: Dec 2nd, 2010
Errors after update to version3.1
Jul 14th, 2014 at 7:35pm
Print Post  


Check in the attach all errors i have after update to 3.1
Pleaese can helpme with this.

Code
Select All
ContainerNode c = form.Factory.CreateContainerNode(100, 100, 100, 100);
           c.Bounds = new Rect(e.MousePosition, new Size(75, 75));
           var node = new DiagramNodeAdapter(form, c);
           node.SizeSyncMode = SizeSyncMode.SetSize;
           c.IsManipulationEnabled = true;
           c.Shape =  ContainerShape.RoundedRectangle;
 





Code
Select All
   void SetZdown(DiagramItem item)
        {
            //item.ZBottom();

            var parent = ContainerNode.GetContainer(item as DiagramNode);
            item.ZIndex = parent == null ? 0 : parent.ZIndex + 1;

            var ctr = item as ContainerNode;
            if (ctr != null && ctr.SubordinateGroup != null)
            {
                foreach (DiagramNode child in ctr.SubordinateGroup.AttachedNodes)
                    child.ZLevelUp();
            }
        }

        void SetZup(DiagramItem item)
        {


            item.ZTop();
            var ctr = item as ContainerNode;
            if (ctr != null && ctr.SubordinateGroup != null)
            {
                foreach (DiagramNode child in ctr.SubordinateGroup.AttachedNodes)
                    child.ZTop();
            }
        }
 






Something change on references, why all that event handlers errors?
Check the attached pic.
  

error_002.png (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Errors after update to version3.1
Reply #1 - Jul 14th, 2014 at 7:53pm
Print Post  
From version history topic for v3:

Quote:
- Event handler delegates have been removed; events are now defined as generic EventHandler specialized via EventArgs type. For example the type of NodeCreated is now EventHandler<NodeEventArgs>;
- TableStyle enum renamed to SimpleShape;
- ZLevelUp, ZLevelDown, ZTop and ZBottom methods now require a boolean argument specifying whether items are allowed to change layers;


If you have code that manually adds event handlers, replace named delegates with generic ones, or simply skip specifying delegate type:

Code
Select All
d.NodeCreated += new EventHandler<NodeEventArgs>(OnNodeCreated);
// or
d.NodeCreated += OnNodeCreated; 



For Z order methods, just add an extra false argument when calling them.
  
Back to top
 
IP Logged
 
PDM.
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 256
Joined: Dec 2nd, 2010
Re: Errors after update to version3.1
Reply #2 - Jul 14th, 2014 at 8:16pm
Print Post  
Thankyou, is nice back tgo the future. All fixed, only see strange thing.

I cant select container when is folder, only when is unfolded.
Why this happen?
  
Back to top
 
IP Logged
 
PDM.
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 256
Joined: Dec 2nd, 2010
Re: Errors after update to version3.1
Reply #3 - Jul 14th, 2014 at 8:20pm
Print Post  
Correction to my last post.
I créate container, and i can select.

When is folded i can select too, but the problem is handles are not showed when container is folded.
I using custom ahndles, work correct before update to new diagram.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Errors after update to version3.1
Reply #4 - Jul 15th, 2014 at 7:52am
Print Post  
I cannot see any problem with custom handles, what does your DrawAdjustmentHandles code look like? Check if you haven't detached the event handler inadvertently while moving to the new generic delegates.
  
Back to top
 
IP Logged
 
PDM.
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 256
Joined: Dec 2nd, 2010
Re: Errors after update to version3.1
Reply #5 - Jul 18th, 2014 at 8:14am
Print Post  
Yep you have reason
I change to node.HandlesStyle = HandlesStyle.MoveOnly;  when is folded.

Thanks
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint