static void DeleteElementsFromGraph(State previousState, IReadOnlyCollection <IGTFGraphElementModel> elementsToRemove, GraphModel graphModel)
        {
            IGTFGraphElementModel[] deletables = elementsToRemove.Where(x => x is IDeletable).Distinct().ToArray();

            var vsGraphModel = (VSGraphModel)graphModel;

            IStickyNoteModel[] stickyNotesToDelete         = GetStickyNotesToDelete(deletables);
            IPlacematModel[]   placematsToDelete           = GetPlacematsToDelete(deletables);
            IReadOnlyCollection <INodeModel> nodesToDelete = GetNodesToDelete(vsGraphModel, deletables);
            IReadOnlyCollection <IEdgeModel> edgesToDelete = GetEdgesToDelete(graphModel, deletables, nodesToDelete);

            VariableDeclarationModel[] declarationModelsToDelete = GetDeclarationModelsToDelete(deletables, nodesToDelete);

            if (declarationModelsToDelete.Any())
            {
                previousState.MarkForUpdate(UpdateFlags.RequestRebuild);
            }

            graphModel.DeleteStickyNotes(stickyNotesToDelete);
            graphModel.DeletePlacemats(placematsToDelete);
            graphModel.DeleteEdges(edgesToDelete);
            graphModel.DeleteNodes(nodesToDelete, GraphModel.DeleteConnections.False);
            vsGraphModel.DeleteVariableDeclarations(declarationModelsToDelete, false);
        }