Inheritance: System.Windows.Controls.UserControl, IArrowControl
コード例 #1
0
 public ArrowCreationSet(NodeControl nodeControl, Point location)
 {
     IsAdded = false;
     NodeControl = nodeControl;
     ArrowControl = new ArrowControl(nodeControl, null);
     From = new ArrowNodeSurrogate {Centre = location};
     To = new ArrowNodeSurrogate {Centre = location};
     Controller = new ArrowController(null, From, To);
     ArrowControl.DataContext = Controller.ViewModel;
 }
コード例 #2
0
 public ArrowCreationSet(NodeControl nodeControl, Point location)
 {
     IsAdded      = false;
     NodeControl  = nodeControl;
     ArrowControl = new ArrowControl(nodeControl, null);
     From         = new ArrowNodeSurrogate {
         Centre = location
     };
     To = new ArrowNodeSurrogate {
         Centre = location
     };
     Controller = new ArrowController(null, From, To);
     ArrowControl.DataContext = Controller.ViewModel;
 }
コード例 #3
0
        private ArrowControlFactorySet CreateSet(ViewModel.Relationship viewModelRelationship, NodeControl fromControl, NodeControl toControl)
        {
            ArrowController arrowController = new ArrowController(viewModelRelationship, fromControl, toControl);
            
            arrowController.ViewModel.Id = viewModelRelationship.Id;
            if (toControl != null)
            {
                toControl.LinkFromNode(fromControl);
            }
            ArrowControl arrowControl = new ArrowControl(fromControl, toControl);
            Canvas.SetZIndex(arrowControl, 40);
            arrowControl.DataContext = arrowController.ViewModel;
            if (toControl != null && toControl.ViewModelNode.State == CollapseState.None)
            {
                toControl.ViewModelNode.State = CollapseState.Expanded;
            }
            ArrowControlFactorySet set = new ArrowControlFactorySet();
            set.Relationship = viewModelRelationship;
            set.Control = arrowControl;
            set.Controller = arrowController;

            return set;
        }
コード例 #4
0
        public ArrowControlFactorySet RemoveArrow(ArrowControl arrowControl)
        {
            ViewModel.ArrowViewModel viewModelArrow = arrowControl.DataContext as ViewModel.ArrowViewModel;

            if (viewModelArrow != null)
            {
                return RemoveArrow(viewModelArrow);
            }
            else
            {
                IEnumerable<Guid> arrowSetIds = from arrowSet in Arrows
                                                where arrowSet.Value.Control == arrowControl
                                                select arrowSet.Key;

                if (arrowSetIds.Any())
                {
                    return RemoveArrow(arrowSetIds.First());
                }
            }

            return null;
        }
コード例 #5
0
 public void Remove(ArrowControl arrowControl)
 {
     NodeContainer.Children.Remove(arrowControl);
 }
コード例 #6
0
 public void Add(ArrowControl arrowControl)
 {
     NodeContainer.Children.Add(arrowControl);
 }
コード例 #7
0
ファイル: NodesSelector.cs プロジェクト: chris-tomich/Glyma
 public bool HasArrow(ArrowControl arrowControl)
 {
     return ArrowControls.Contains(arrowControl);
 }
コード例 #8
0
ファイル: NodesSelector.cs プロジェクト: chris-tomich/Glyma
 //Remove node from selection
 public void RemoveArrow(ArrowControl arrowControl)
 {
     if (HasArrow(arrowControl))
     {
         ArrowControls.Remove(arrowControl);
         arrowControl.DeSelect();
     }
 }
コード例 #9
0
ファイル: NodesSelector.cs プロジェクト: chris-tomich/Glyma
 //Add node to selection
 public void AddArrow(ArrowControl arrowControl)
 {
     if (!HasArrow(arrowControl))
     {
         ArrowControls.Add(arrowControl);
         arrowControl.Select();
     }
 }