public void SetController(rMindBaseController controller) { if (controller != null && controller.CanvasController == null) { controller.SetParent(this); } if (m_root_controller == null) { m_root_controller = controller; } if (m_bread_crumbs.Contains(controller)) { // Переход по хлебным крошкам. var idx = m_bread_crumbs.IndexOf(controller); m_current_controller?.Unsubscribe(); m_current_controller = controller; if (m_draw) { m_current_controller.Subscribe(m_canvas, m_scroll); } var remove = m_bread_crumbs.Where(x => m_bread_crumbs.IndexOf(x) > idx).ToList(); foreach (var item in remove) { m_bread_crumbs.Remove(item); } return; } m_current_controller?.Unsubscribe(); if (controller == null) { return; } m_current_controller = controller; if (m_draw) { m_current_controller.Subscribe(m_canvas, m_scroll); } m_bread_crumbs.Add(m_current_controller); }
public void SetController(rMindBaseController controller) { m_current_controller?.Unsubscribe(); }