Beispiel #1
0
        public void NewGraph_ClickOnExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            var canvas = TemplatePickerWindow.ShowWindowDialog();

            if (canvas == null)
            {
                canvas = new CanvasProperty();
            }
            var gW = new graphWindow(canvas);

            windowsMgr.AddandShowWindow(gW);
        }
Beispiel #2
0
        public void addAndShowGraphWindow(object obj, string title = null)
        {
            var    dG       = new designGraph();
            var    canvas   = SeedCanvas;
            string filename = null;

            if (obj == null)
            {
                dG = null;
            }
            else if (obj is designGraph)
            {
                dG = (designGraph)obj;
            }
            else if (obj is object[])
            {
                var objArray = (object[])obj;
                if (objArray.GetLength(0) > 0)
                {
                    if (objArray[0] is designGraph)
                    {
                        dG = (designGraph)objArray[0];
                    }
                    else if (objArray[0] is CanvasProperty)
                    {
                        canvas = (CanvasProperty)objArray[0];
                    }
                    else if (objArray[0] is string)
                    {
                        filename = (string)objArray[0];
                    }
                }
                if (objArray.GetLength(0) > 1)
                {
                    if (objArray[1] is designGraph)
                    {
                        dG = (designGraph)objArray[1];
                    }
                    else if (objArray[1] is CanvasProperty)
                    {
                        canvas = (CanvasProperty)objArray[1];
                    }
                    else if (objArray[1] is string)
                    {
                        filename = (string)objArray[1];
                    }
                }
                if (objArray.GetLength(0) > 2)
                {
                    if (objArray[2] is designGraph)
                    {
                        dG = (designGraph)objArray[2];
                    }
                    else if (objArray[2] is CanvasProperty)
                    {
                        canvas = (CanvasProperty)objArray[2];
                    }
                    else if (objArray[2] is string)
                    {
                        filename = (string)objArray[2];
                    }
                }
            }
            if (title != null && title.StartsWith("SEED"))
            {
                SeedCanvas = canvas;
            }
            if (!windowsMgr.FindAndFocusFileInCollection(filename, WindowType.Graph))
            {
                var gW = new graphWindow(dG, canvas, filename, title);
                windowsMgr.AddandShowWindow(gW);
            }
        }
Beispiel #3
0
 internal void Update(designGraph graph, graphWindow gW)
 {
     selectedGraph = graph;
     graphWin      = gW;
     Update();
 }