private void Reset() { mShouldRedraw = true; mModel?.Dispose(); mModel = null; ResetCamera(); }
/// <summary> /// Removes vertex and all its edges from graph /// </summary> /// <param name="vertex">Vertex to remove</param> /// <param name="removeRecursive">Flag if vertex dependencies should be removed too</param> public void RemoveVertex(IDrawable vertex, bool removeRecursive = false) { if (!this.Graph.ContainsKey(vertex)) { return; } if (vertex is NounSet ns) { ns.Nouns.ForEach(n => this.RemoveVertex(n, removeRecursive)); } if (removeRecursive) { var vertices = this.Graph[vertex].Select(edge => edge.Right).ToList(); for (int i = 0; i < vertices.Count(); i++) { this.RemoveVertex(vertices[i], true); } } this.Graph.Remove(vertex); foreach (var edges in this.Graph.Values) { edges.RemoveAll(edge => edge.Right == vertex); } vertex.Dispose(); }
public override void Dispose() { if (_drawable != null) { _drawable.Dispose(); _drawable = null; } base.Dispose(); }
public void Dispose() { if (_top != null) { _top.Dispose(); _top = null; } if (_bottom != null) { _bottom.Dispose(); _bottom = null; } }