Example #1
0
 public KeyValuePair <SubControlType, object> GetSubControl(Point point)
 {
     if (RecText.Contains(point))
     {
         return(new KeyValuePair <SubControlType, object>(SubControlType.Text, node.Text));
     }
     if (node.HasImage && ImageView.Contains(point))
     {
         return(new KeyValuePair <SubControlType, object>(SubControlType.Image, node.Image));
     }
     if (node.HasLink && Link.Contains(point))
     {
         return(new KeyValuePair <SubControlType, object>(SubControlType.Link, node.Link));
     }
     if (node.HasNoteText && NoteIcon.Contains(point))
     {
         return(new KeyValuePair <SubControlType, object>(SubControlType.Note, node.NoteText));
     }
     foreach (var i in RecIcons)
     {
         if (i.Contains(point))
         {
             return(new KeyValuePair <SubControlType, object>(SubControlType.Icon, i.Name));
         }
     }
     return(new KeyValuePair <SubControlType, object>(SubControlType.None, null));
 }
Example #2
0
        private void CreateNodeViewContent()
        {
            if (node.Link != null)
            {
                this.link = new Link(node.Link, node.GetLinkType());
                width    += (link.Size.Width + INTER_CONTROL_PADDING);
            }

            if (node.HasNoteText)
            {
                this.noteIcon = new NoteIcon();
                width        += (noteIcon.Size.Width + INTER_CONTROL_PADDING);
            }

            for (int i = 0; i < MetaModel.MetaModel.Instance.SystemIconList.Count; i++)
            {
                var systemIcon = MetaModel.MetaModel.Instance.SystemIconList[i];
                if (systemIcon.ShowIcon(node))
                {
                    recIcons.Add(new IconView(systemIcon));
                }
            }

            for (int i = 0; i < node.Icons.Count; i++)
            {
                IconView icon = new IconView(node.Icons[i]);
                this.recIcons.Add(icon);
                width += (icon.Size.Width + INTER_CONTROL_PADDING);
            }

            RefreshFont();
        }
Example #3
0
 public void RefreshNoteIcon()
 {
     if (node.HasNoteText && this.noteIcon == null)
     {
         this.noteIcon = new NoteIcon();
         this.RefreshNodeViewSize();
     }
     else if (!node.HasNoteText && this.noteIcon != null)
     {
         this.noteIcon = null;
         this.RefreshNodeViewSize();
     }
 }
Example #4
0
        private void CreateNodeViewContent()
        {
            if (node.Link != null)
            {
                this.link = new Link(node.Link, node.GetLinkType());
                width += (link.Size.Width + INTER_CONTROL_PADDING);
            }

            if (node.HasNoteText)
            {
                this.noteIcon = new NoteIcon();
                width += (noteIcon.Size.Width + INTER_CONTROL_PADDING);
            }

            for (int i = 0; i < MetaModel.MetaModel.Instance.SystemIconList.Count; i++)
            {
                var systemIcon = MetaModel.MetaModel.Instance.SystemIconList[i];
                if(systemIcon.ShowIcon(node))
                {
                    recIcons.Add(new IconView(systemIcon));
                }
            }

            for (int i = 0; i < node.Icons.Count; i++)
            {
                IconView icon = new IconView(node.Icons[i]);
                this.recIcons.Add(icon);
                width += (icon.Size.Width + INTER_CONTROL_PADDING);
            }

            RefreshFont();
        }
Example #5
0
 public void RefreshNoteIcon()
 {
     if(node.HasNoteText && this.noteIcon == null)
     {
         this.noteIcon = new NoteIcon();
         this.RefreshNodeViewSize();
     }
     else if(!node.HasNoteText && this.noteIcon != null)
     {
         this.noteIcon = null;
         this.RefreshNodeViewSize();
     }
 }