Beispiel #1
0
 private void control_ContextChanged(object sender, EventArgs e)
 {
     m_graph                  = AdaptedControl.ContextAs <IGraph <TNode, TEdge, TEdgeRoute> >();
     m_layoutContext          = AdaptedControl.ContextAs <ILayoutContext>();
     m_editableGraphContainer = AdaptedControl.ContextAs <IEditableGraphContainer <TNode, TEdge, TEdgeRoute> >();
     if (m_layoutContext != null)
     {
         m_selectionContext = AdaptedControl.ContextCast <ISelectionContext>();
     }
 }
        private void control_ContextChanged(object sender, EventArgs e)
        {
            if (m_selectionContext != null)
            {
                m_selectionContext.SelectionChanged -= m_selectionContext_SelectionChanged;
            }

            // mandatory
            m_selectionContext = AdaptedControl.ContextCast <ISelectionContext>();
            m_selectionContext.SelectionChanged += m_selectionContext_SelectionChanged;
            m_graph = AdaptedControl.ContextCast <IGraph <TNode, TEdge, TEdgeRoute> >();
        }
Beispiel #3
0
 private void control_ContextChanged(object sender, EventArgs e)
 {
     if (m_selectionContext != null)
     {
         m_selectionContext.SelectionChanged -= selection_Changed;
     }
     m_selectionContext = AdaptedControl.ContextCast <ISelectionContext>();
     if (m_selectionContext != null)
     {
         m_selectionContext.SelectionChanged += selection_Changed;
     }
     m_selectionPathProviderInfo.SelectionContext = m_selectionContext;
 }
Beispiel #4
0
        private void control_ContextChanged(object sender, EventArgs e)
        {
            IGraph <Element, Wire, ICircuitPin> graph = AdaptedControl.ContextAs <IGraph <Element, Wire, ICircuitPin> >();

            if (graph == null)
            {
                graph = CircuitUtil.EmptyCircuit;
            }

            if (m_graph != graph)
            {
                m_graph = graph;
            }

            m_layoutContext = AdaptedControl.ContextAs <ILayoutContext>();

            if (m_layoutContext != null)
            {
                m_selectionContext = AdaptedControl.ContextCast <ISelectionContext>();
            }
        }
Beispiel #5
0
 private void control_ContextChanged(object sender, EventArgs e)
 {
     // mandatory
     m_selectionContext = AdaptedControl.ContextCast <ISelectionContext>();
     m_graph            = AdaptedControl.ContextCast <IGraph <TNode, TEdge, TEdgeRoute> >();
 }