Esempio n. 1
0
        public void Dispose()
        {
            if (IsDisposed == false)
            {
                IsDisposed = true;
                MinusZero mz = MinusZero.Instance;

                //GraphUtil.DeleteEdgeByToVertex(mz.Root.Get(@"System\Session\Visualisers"), Vertex);

                foreach (UIElement e in DisplayedVertexesUIElements.Values)
                {
                    if (e is IDisposable)
                    {
                        ((IDisposable)e).Dispose();
                    }
                }

                PlatformClass.RemoveVertexChangeListeners(this.Vertex, new VertexChange(VertexChange));

                if (Vertex is IDisposable)
                {
                    ((IDisposable)Vertex).Dispose();
                }
            }
        }
Esempio n. 2
0
        public void Dispose()
        {
            if (IsDisposed == false)
            {
                IsDisposed = true;
                PlatformClass.RemoveVertexChangeListeners(this.Vertex, new VertexChange(VertexChange));

                if (Vertex is IDisposable)
                    ((IDisposable)Vertex).Dispose();
            }
        }
Esempio n. 3
0
        public void Dispose()
        {
            foreach (DiagramLineBase e in DiagramLines)
            {
                if (e is IDisposable)
                {
                    ((IDisposable)e).Dispose();
                }
            }

            PlatformClass.RemoveVertexChangeListeners(this.Vertex, new VertexChange(VertexChange));
        }
Esempio n. 4
0
        public void Dispose()
        {
            if (this.Child is IDisposable)
            {
                ((IDisposable)(this.Child)).Dispose();
            }

            if (baseVertex != null)
            {
                PlatformClass.RemoveVertexChangeListeners(baseVertex, new VertexChange(VertexChange));
            }
        }
Esempio n. 5
0
        public void Dispose()
        {
            if (IsDisposed == false)
            {
                IsDisposed = true;
                PlatformClass.RemoveVertexChangeListeners(this.Vertex, new VertexChange(VertexChange));

                if (Vertex is IDisposable)
                {
                    ((IDisposable)Vertex).Dispose();
                }

                foreach (IVertex v in manuallyAddedVertexChangeListeners)
                {
                    v.Change -= new VertexChange(VertexChange);
                }
            }
        }
Esempio n. 6
0
        public void SynchronisedVisualiserChange(object sender, VertexChangeEventArgs e)
        {
            if (
                ((sender == selectSynchronisedVisualiser) && (e.Type == VertexChangeType.EdgeAdded) && (GeneralUtil.CompareStrings(e.Edge.Meta.Value, "SelectedEdges")))
                ||
                (sender is IVertex && GraphUtil.FindEdgeByToVertex(selectSynchronisedVisualiser.GetAll(@"SelectedEdges:\"), (IVertex)sender) != null && ((e.Type == VertexChangeType.EdgeAdded) || (e.Type == VertexChangeType.EdgeRemoved)))
                ||
                (sender is IVertex && selectSynchronisedVisualiser.Get(@"SelectedEdges:") == (IVertex)sender && ((e.Type == VertexChangeType.EdgeAdded) || (e.Type == VertexChangeType.EdgeRemoved)))
                )
            {
                if (baseSynchronisedVertex.Get(@"BaseEdge:\To:") == null)     // if Disposed
                {
                    PlatformClass.RemoveVertexChangeListeners(selectSynchronisedVisualiser, new VertexChange(this.SynchronisedVisualiserChange));
                }
                else
                {
                    IVertex selEdgesFirst = selectSynchronisedVisualiser.Get(@"SelectedEdges:\");

                    if (selEdgesFirst != null)
                    {
                        IVertex firstSelectedVertexEdgeTo = selEdgesFirst.Get("To:");

                        if (firstSelectedVertexEdgeTo != null)
                        {
                            GraphUtil.ReplaceEdge(baseSynchronisedVertex.Get("BaseEdge:"), "To", firstSelectedVertexEdgeTo);
                        }

                        IVertex firstSelectedVertexEdgeMeta = selEdgesFirst.Get("Meta:");

                        if (firstSelectedVertexEdgeMeta != null)
                        {
                            GraphUtil.ReplaceEdge(baseSynchronisedVertex.Get("BaseEdge:"), "Meta", firstSelectedVertexEdgeMeta);
                        }
                    }
                }
            }
        }
Esempio n. 7
0
        public void PaintGraph()
        {
            if (ActualHeight != 0)
            {
                //MinusZero.Instance.Log(1, "PaintGraph", "");

                // turn off Vertex.Change listener

                PlatformClass.RemoveVertexChangeListeners(this.Vertex, new VertexChange(VertexChange));

                //

                IsPaiting = true;

                if (GeneralUtil.CompareStrings(Vertex.Get("FastMode:"), "True"))
                {
                    FastMode = true;
                }
                else
                {
                    FastMode = false;
                }

                if (GeneralUtil.CompareStrings(Vertex.Get("MetaLabels:"), "True"))
                {
                    MetaLabels = true;
                }
                else
                {
                    MetaLabels = false;
                }

                if (GeneralUtil.CompareStrings(Vertex.Get("ShowInEdges:"), "True"))
                {
                    ShowInEdges = true;
                }
                else
                {
                    ShowInEdges = false;
                }

                this.Children.Clear();

                foreach (UIElement e in DisplayedVertexesUIElements.Values)
                {
                    if (e is IDisposable)
                    {
                        ((IDisposable)e).Dispose();
                    }
                }

                DisplayedVertexesUIElements.Clear();

                //GraphUtil.RemoveAllEdges(Vertex.Get("DisplayedEdges:"));

                Width  = GraphUtil.GetIntegerValue(Vertex.Get("NumberOfCircles:")) * GraphUtil.GetIntegerValue(Vertex.Get("VisualiserCircleSize:")) * 2;
                Height = Width;

                AddCircle(0, null);

                SelectWrappersForSelectedVertexes();

                IsFirstPainted = true;

                IsPaiting = false;

                // turn on Vertex.Change listener

                PlatformClass.RegisterVertexChangeListeners(this.Vertex, new VertexChange(VertexChange), new string[] { "BaseEdge", "SelectedEdges" });

                //
            }
        }
Esempio n. 8
0
        private void VertexChangeListenOff()
        {
            ((EasyVertex)Vertex).CanFireChangeEvent = false;

            PlatformClass.RemoveVertexChangeListeners(this.Vertex, new VertexChange(VertexChange));
        }