Ejemplo n.º 1
0
        private void Reset()
        {
            mShouldRedraw = true;
            mModel?.Dispose();
            mModel = null;

            ResetCamera();
        }
Ejemplo n.º 2
0
        /// <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();
        }
Ejemplo n.º 3
0
        public override void Dispose()
        {
            if (_drawable != null)
            {
                _drawable.Dispose();
                _drawable = null;
            }

            base.Dispose();
        }
Ejemplo n.º 4
0
        public void Dispose()
        {
            if (_top != null)
            {
                _top.Dispose();
                _top = null;
            }

            if (_bottom != null)
            {
                _bottom.Dispose();
                _bottom = null;
            }
        }