CloseObservers() public method

public CloseObservers ( MyNode node ) : void
node MyNode
return void
        private void Desktop_NodeRemoved(object sender, NodeEventArgs e)
        {
            MyNode node = (e.Node as MyNodeView).Node;

            if (node == null)
            {
                return;
            }

            Target.RemoveChild(node);
            if (node is MyNodeGroup)
            {
                m_mainForm.CloseGraphLayout(node as MyNodeGroup);
            }
            else if (node is IScriptableNode)
            {
                m_mainForm.CloseTextEditor(node as IScriptableNode);
            }

            m_mainForm.CloseObservers(node);
            m_mainForm.RemoveFromDashboard(node);

            // End state saving suppression, we'll need to save one state after the node is removed.
            m_mainForm.SuppressStateSaving = false;

            m_mainForm.ProjectStateChanged("Node removed");
        }
        private void propertyGrid_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
        {
            MyNodeView nodeView = null;

            foreach (GraphLayoutForm graphView in m_mainForm.GraphViews.Values)
            {
                if (graphView.Desktop.FocusElement is MyNodeView &&
                    (graphView.Desktop.FocusElement as MyNodeView).Node == propertyGrid.SelectedObject)
                {
                    nodeView = graphView.Desktop.FocusElement as MyNodeView;
                    nodeView.UpdateView();
                }

                if (propertyGrid.SelectedObject is MyNodeGroup && graphView.Target == propertyGrid.SelectedObject)
                {
                    graphView.Text = graphView.Target.Name;
                }

                graphView.Desktop.Invalidate();
            }

            if (nodeView != null)
            {
                if (nodeView.BranchChangeNeeded)
                {
                    if (nodeView.OutputBranchChangeNeeded)
                    {
                        m_mainForm.CloseObservers(nodeView.Node);
                    }

                    if (nodeView.Node is MyNodeGroup)
                    {
                        m_mainForm.ReloadGraphLayout(nodeView.Node as MyNodeGroup);
                    }

                    (nodeView as MyVariableBranchView).UpdateBranches();
                }
            }

            propertyGrid.Refresh();

            if (Target is MyNode)
            {
                UpdateTitleAndButtons();
                m_mainForm.MemoryBlocksView.UpdateView();
            }

            if (Target is MyAbstractObserver && m_mainForm.SimulationHandler.State == MySimulationHandler.SimulationState.PAUSED)
            {
                m_mainForm.UpdateObserverView(Target as MyAbstractObserver);
            }
        }
        private void Desktop_NodeRemoved(object sender, NodeEventArgs e)
        {
            MyNode node = (e.Node as MyNodeView).Node;

            if (node != null)
            {
                Target.RemoveChild(node);
            }

            if (node is MyNodeGroup)
            {
                m_mainForm.CloseGraphLayout(node as MyNodeGroup);
            }

            m_mainForm.CloseObservers(node);
        }