Inheritance: CanvasObject, ICanvasSelectableObject
Exemplo n.º 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);
 }
Exemplo n.º 2
0
 public DashboardButtonObject(DashboardButton tagger)
 {
     Button              = tagger;
     SupportsLinks       = true;
     anchor              = new LinkAnchorObject(this, null, new Point(0, 0));
     anchor.RedrawEvent += (co, area) => {
         EmitRedrawEvent(anchor, area);
     };
 }
Exemplo n.º 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;
        }
Exemplo n.º 4
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;
 }
Exemplo n.º 5
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);
        }
Exemplo n.º 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;
        }
Exemplo n.º 7
0
 void RemoveAnchor(LinkAnchorObject anchor)
 {
     anchor.Dispose();
     subcatAnchors.RemoveKeysByValue(anchor);
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
        }
Exemplo n.º 10
0
 void RemoveAnchor(LinkAnchorObject anchor)
 {
     anchor.Dispose ();
     subcatAnchors.RemoveKeysByValue (anchor);
 }
Exemplo n.º 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;
        }