Inheritance: CanvasObject, ICanvasSelectableObject
Exemple #1
0
 public bool CanLink(LinkAnchorObject anchor)
 {
     if (anchor == null)
     {
         return(false);
     }
     else if (this == anchor)
     {
         return(false);
     }
     else if (Button == anchor.Button)
     {
         return(false);
     }
     else if (Button is TimerObject && anchor.Button is TimerObject)
     {
         return(true);
     }
     else if (Button is TagObject && anchor.Button is TagObject)
     {
         return(true);
     }
     else if (Button.Button is EventButton && anchor.Button.Button is EventButton)
     {
         return(true);
     }
     return(false);
 }
 public DashboardButtonObject(DashboardButton tagger)
 {
     Button              = tagger;
     SupportsLinks       = true;
     anchor              = new LinkAnchorObject(this, null, new Point(0, 0));
     anchor.RedrawEvent += (co, area) => {
         EmitRedrawEvent(anchor, area);
     };
 }
Exemple #3
0
        public ActionLinkObject(LinkAnchorObject source,
		                         LinkAnchorObject destination,
		                         ActionLink link)
        {
            Link = link;
            Source = source;
            Destination = destination;
            if (destination == null) {
                stop = source.Out;
            } else {
                stop = destination.In;
            }
            line = new Line ();
            line.Start = source.Out;
            line.Stop = stop;
        }
 public ActionLinkObject(LinkAnchorObject source,
                         LinkAnchorObject destination,
                         ActionLink link)
 {
     Link        = link;
     Source      = source;
     Destination = destination;
     if (destination == null)
     {
         stop = source.Out;
     }
     else
     {
         stop = destination.In;
     }
     line       = new Line();
     line.Start = source.Out;
     line.Stop  = stop;
 }
        public bool CanLink(LinkAnchorObject dest)
        {
            /* Check if the link is possible between the 2 types of anchors */
            if (!Source.CanLink(dest))
            {
                return(false);
            }

            /* Check if this link will result into a duplicated link */
            foreach (ActionLink link in Source.Button.Button.ActionLinks)
            {
                if (link.DestinationButton == dest.Button.Button &&
                    link.SourceTags.SequenceEqualSafe(Source.Tags) &&
                    link.DestinationTags.SequenceEqualSafe(dest.Tags))
                {
                    return(false);
                }
            }
            return(true);
        }
Exemple #6
0
        void AddSubcatAnchor(Tag tag, Point point, double width, double height)
        {
            LinkAnchorObject anchor;

            if (subcatAnchors.ContainsKey(tag))
            {
                anchor = subcatAnchors [tag];
                anchor.RelativePosition = point;
            }
            else
            {
                anchor = new LinkAnchorObject(this, new List <Tag> {
                    tag
                }, point);
                anchor.RedrawEvent += (co, area) => {
                    EmitRedrawEvent(anchor, area);
                };
                subcatAnchors.Add(tag, anchor);
            }
            anchor.Width  = width;
            anchor.Height = height;
        }
Exemple #7
0
 void RemoveAnchor(LinkAnchorObject anchor)
 {
     anchor.Dispose();
     subcatAnchors.RemoveKeysByValue(anchor);
 }
Exemple #8
0
 public bool CanLink(LinkAnchorObject anchor)
 {
     if (anchor == null)
         return false;
     else if (this == anchor)
         return false;
     else if (Button == anchor.Button)
         return false;
     else if (Button is TimerObject && anchor.Button is TimerObject)
         return true;
     else if (Button is TagObject && anchor.Button is TagObject)
         return true;
     else if (Button.Button is EventButton && anchor.Button.Button is EventButton)
         return true;
     return false;
 }
Exemple #9
0
        public bool CanLink(LinkAnchorObject dest)
        {
            /* Check if the link is possible between the 2 types of anchors */
            if (!Source.CanLink (dest)) {
                return false;
            }

            /* Check if this link will result into a duplicated link */
            foreach (ActionLink link in Source.Button.Button.ActionLinks) {
                if (link.DestinationButton == dest.Button.Button &&
                    link.SourceTags.SequenceEqualSafe (Source.Tags) &&
                    link.DestinationTags.SequenceEqualSafe (dest.Tags)) {
                    return false;
                }
            }
            return true;
        }
Exemple #10
0
 void RemoveAnchor(LinkAnchorObject anchor)
 {
     anchor.Dispose ();
     subcatAnchors.RemoveKeysByValue (anchor);
 }
Exemple #11
0
        void AddSubcatAnchor(Tag tag, Point point, double width, double height)
        {
            LinkAnchorObject anchor;

            if (subcatAnchors.ContainsKey (tag)) {
                anchor = subcatAnchors [tag];
                anchor.RelativePosition = point;
            } else {
                anchor = new LinkAnchorObject (this, new List<Tag> { tag }, point);
                anchor.RedrawEvent += (co, area) => {
                    EmitRedrawEvent (anchor, area);
                };
                subcatAnchors.Add (tag, anchor);
            }
            anchor.Width = width;
            anchor.Height = height;
        }