示例#1
0
 private void RemoveGraph_Unsynchronized(IGraphController ctrl)
 {
     if (ctrl is IViewContent content)
     {
         Current.Workbench.CloseContent(content);
     }
 }
示例#2
0
        internal PropertyNode(IGraphController graphController, string assembly, string qualifiedName, string argumentTypes)
            : base(graphController, NodeType.Property)
        {
            this.Caption = qualifiedName;
            string[] splitQualifiedName = qualifiedName.Split('.');
            if (null != splitQualifiedName && (splitQualifiedName.Length >= 1))
            {
                this.Caption = splitQualifiedName[1];
            }
            this.Text = this.graphController.GetRuntimeStates().GenerateTempVariable(this.nodeId);

            this.Assembly      = assembly;
            this.QualifiedName = qualifiedName;
            this.ArgumentTypes = argumentTypes;
            this.ReturnType    = string.Empty;
            this.UpdateReturnTypeAndMemberType();
            this.UpdateInputSlot();

            //Output slot
            Slot outputSlot = new Slot(graphController, SlotType.Output, this);

            this.graphController.AddSlot(outputSlot);
            this.outputSlots.Add(outputSlot.SlotId);
            this.CheckDots();
        }
示例#3
0
        public IGraphController GetController(uint identifier)
        {
            if (uint.MaxValue == identifier) // Get the current controller.
            {
                if (null == graphCanvases || (graphCanvases.Count <= 0))
                {
                    return(null);
                }

                GraphCanvas graphCanvas = graphCanvases[currentGraphCanvas];
                if (null == graphCanvas.VisualHost) // When file first loaded.
                {
                    return(null);
                }

                return(graphCanvases[currentGraphCanvas].Controller);
            }

            foreach (GraphCanvas canvas in graphCanvases)
            {
                IGraphController controller = canvas.Controller;
                if (controller.Identifier == identifier)
                {
                    return(controller);
                }
            }

            return(null);
        }
示例#4
0
        internal InfoBubble(IGraphController controller, uint nodeId)
        {
            this.graphController = controller as GraphController;
            this.nodeId          = nodeId;
            IdGenerator idGenerator = this.graphController.GetIdGenerator();

            this.bubbleId = idGenerator.GetNextId(ComponentType.Bubble);
            this.graphController.AddBubble(this);
        }
示例#5
0
        protected override void OnControllerChanged(IGraphController oldController, IGraphController newController)
        {
            base.OnControllerChanged(oldController, newController);

            if (newController != null)
            {
                newController.RequestVirtualRangeChange();
            }
        }
示例#6
0
 /// <summary>
 /// Plots the currently selected data columns of a worksheet.
 /// </summary>
 /// <param name="dg">The worksheet controller where the columns are selected in.</param>
 public static void PlotLinePolar(GUI.WorksheetController dg)
 {
     Altaxo.Graph.Gdi.GraphDocument graph = new Altaxo.Graph.Gdi.GraphDocument();
     Altaxo.Graph.Gdi.XYPlotLayer   layer = new Altaxo.Graph.Gdi.XYPlotLayer(graph.DefaultLayerPosition, graph.DefaultLayerSize, new Altaxo.Graph.Gdi.CS.G2DPolarCoordinateSystem());
     layer.CreateDefaultAxes();
     graph.Layers.Add(layer);
     Current.Project.GraphDocumentCollection.Add(graph);
     IGraphController gc = Plot(dg.DataTable, dg.SelectedDataColumns, graph, PlotStyle_Line, GroupStyle_Color_Line);
 }
示例#7
0
 internal CodeBlockNode(IGraphController graphController, SnapshotNode snapshotNode)
     : base(graphController, NodeType.CodeBlock)
 {
     this.Caption = string.Empty;
     this.Text = snapshotNode.Content;
     string error;
     ErrorType errorType;
     AmendInputOutputSlots(out error, out errorType);
 }
示例#8
0
        public static IVisualNode Create(IGraphController graphController, IStorage storage)
        {
            if (graphController == null || storage == null)
            {
                throw new ArgumentNullException("graphcontroller, storage");
            }

            storage.Seek(12, SeekOrigin.Current); //Skip NodeSignature
            NodeType type = (NodeType)storage.ReadInteger(FieldCode.NodeType);

            storage.Seek(-24, SeekOrigin.Current); //Shift cursor back to the start point of reading NodeSignature
            VisualNode node = null;

            switch (type)
            {
            case NodeType.CodeBlock:
                node = new CodeBlockNode(graphController);
                node.Deserialize(storage);
                break;

            case NodeType.Condensed:
                node = new CondensedNode(graphController);
                node.Deserialize(storage);
                break;

            case NodeType.Driver:
                node = new DriverNode(graphController);
                node.Deserialize(storage);
                break;

            case NodeType.Function:
                node = new FunctionNode(graphController);
                node.Deserialize(storage);
                break;

            case NodeType.Identifier:
                node = new IdentifierNode(graphController);
                node.Deserialize(storage);
                break;

            case NodeType.Property:
                node = new PropertyNode(graphController);
                node.Deserialize(storage);
                break;

            case NodeType.Render:
                node = new RenderNode(graphController);
                node.Deserialize(storage);
                break;

            default:
                throw new ArgumentException("Invalid 'nodeType'");
            }

            return(node);
        }
示例#9
0
        internal FunctionNode(IGraphController graphController, string assembly, string qualifiedName, string argumentTypes)
            : base(graphController, NodeType.Function)
        {
            this.Text = this.graphController.GetRuntimeStates().GenerateTempVariable(this.nodeId);
            this.Assembly = assembly;
            this.QualifiedName = qualifiedName;
            this.ArgumentTypes = argumentTypes;
            this.argumentNames = CoreComponent.Instance.GetArgumentNames(this.Assembly, this.QualifiedName, this.ArgumentTypes);
            this.UpdateReturnTypeAndMemberType();

            int lastDot = 0;
            string className = string.Empty;
            switch (this.MemberType)
            {
                case LibraryItem.MemberType.Constructor:
                    lastDot = qualifiedName.LastIndexOf('.');
                    if (-1 == lastDot)
                        this.Caption = qualifiedName;
                    else
                        this.Caption = qualifiedName.Substring(0, lastDot);
                    break;
                case LibraryItem.MemberType.StaticMethod:
                    lastDot = qualifiedName.LastIndexOf('.');
                    if (-1 == lastDot)
                        this.Caption = qualifiedName;
                    else
                        this.Caption = qualifiedName.Substring(lastDot + 1);
                    break;
                case LibraryItem.MemberType.InstanceMethod:
                case LibraryItem.MemberType.InstanceProperty:
                    lastDot = qualifiedName.LastIndexOf('.');
                    this.Caption = qualifiedName.Substring(lastDot + 1);
                    break;
                default:
                    this.Caption = qualifiedName;
                    break;
            }

            //Input slot
            this.CreateInputSlotsFromArgumentTypes(this.ArgumentTypes);

            //Output slot
            Slot outputSlot = new Slot(graphController, SlotType.Output, this);
            this.graphController.AddSlot(outputSlot);
            this.outputSlots.Add(outputSlot.SlotId);

            this.replicationGuideStrings.Clear();
            this.replicationGuides.Clear();
            foreach (uint slot in this.inputSlots)
            {
                this.replicationGuides.Add(new List<int>());
                this.replicationGuideStrings.Add(string.Empty);
            }

            this.CheckDots();
        }
示例#10
0
        public void TestCreate00()
        {
            IGraphController graphController = null;
            IStorage         storage         = new BinaryStorage();

            Assert.Throws <ArgumentNullException>(() =>
            {
                ISlot slot = Slot.Create(graphController, storage);
            });
        }
示例#11
0
        private void OnCanvasModified(object sender, EventArgs e)
        {
            IGraphController graphController = (IGraphController)sender;

            if (graphController == null)
            {
                return;
            }

            tabControl.UpdateTabText(graphController.Identifier);
        }
示例#12
0
        internal DriverNode(IGraphController graphController, string text)
            : base(graphController, NodeType.Driver)
        {
            this.centerLine = Configurations.DriverNodeCenterLine;
            this.Caption = this.graphController.GetRuntimeStates().GenerateTempVariable(this.nodeId);
            this.Text = Configurations.DriverInitialTextValue;

            Slot outputSlot = new Slot(graphController, SlotType.Output, this);
            this.graphController.AddSlot(outputSlot);
            this.outputSlots.Add(outputSlot.SlotId);
        }
示例#13
0
        public void Setup(IGraphController controller)
        {
            Console.WriteLine("Welcome\nDo you wish to log in? Y/N");
            var consoleAction = Console.ReadLine();

            if (consoleAction.ToLower() == "y")
            {
                controller.SignOut();
            }

            controller.SignIn();
        }
示例#14
0
        protected VisualNode(IGraphController graphController, NodeType nodeType)
        {
            this.graphController = graphController as GraphController;
            IdGenerator idGenerator = this.graphController.GetIdGenerator();

            this.nodeType  = nodeType;
            this.version   = VisualNode.Version.Current;
            this.nodeId    = idGenerator.GetNextId(ComponentType.Node);
            this.nodeState = States.Visible;
            this.Dirty     = true;
            this.graphController.AddVisualNode(this);
        }
        /// <summary>
        /// Called when the controller has changed.
        /// </summary>
        /// <param name="oldController">The old controller.</param>
        /// <param name="newController">The new controller.</param>
        protected virtual void OnControllerChanged(IGraphController oldController, IGraphController newController)
        {
            if (oldController != null)
            {
                oldController.VirtualRangeChanged -= OnVirtualRangeChanged;
            }

            if (newController != null)
            {
                newController.VirtualRangeChanged += OnVirtualRangeChanged;
            }
        }
        /// <summary>
        /// Called when the <see cref="Controller"/> property has changed.
        /// </summary>
        /// <param name="oldController">The old controller.</param>
        /// <param name="newController">The new controller.</param>
        protected virtual void OnControllerChanged(IGraphController <WpfGraphDataSeries> oldController, IGraphController <WpfGraphDataSeries> newController)
        {
            if (oldController != null)
            {
                oldController.Surface = null;
            }

            if (newController != null)
            {
                newController.Surface = this;
            }
        }
示例#17
0
        /// <summary>
        /// Create an instance of a slot given storage
        /// </summary>
        /// <param name="graphController"></param>
        /// <param name="storage"></param>
        /// <returns></returns>
        internal static ISlot Create(IGraphController graphController, IStorage storage)
        {
            if (graphController == null || storage == null)
            {
                throw new ArgumentNullException("graphController, storage");
            }

            ISlot slot = new Slot(graphController);

            slot.Deserialize(storage);
            return(slot);
        }
示例#18
0
        protected VisualNode(IGraphController graphController, NodeType nodeType)
        {
            this.graphController = graphController as GraphController;
            IdGenerator idGenerator = this.graphController.GetIdGenerator();

            this.nodeType = nodeType;
            this.version = VisualNode.Version.Current;
            this.nodeId = idGenerator.GetNextId(ComponentType.Node);
            this.nodeState = States.Visible;
            this.Dirty = true;
            this.graphController.AddVisualNode(this);
        }
示例#19
0
        internal DriverNode(IGraphController graphController, string text)
            : base(graphController, NodeType.Driver)
        {
            this.centerLine = Configurations.DriverNodeCenterLine;
            this.Caption    = this.graphController.GetRuntimeStates().GenerateTempVariable(this.nodeId);
            this.Text       = Configurations.DriverInitialTextValue;

            Slot outputSlot = new Slot(graphController, SlotType.Output, this);

            this.graphController.AddSlot(outputSlot);
            this.outputSlots.Add(outputSlot.SlotId);
        }
示例#20
0
        private GraphCanvas GetCanvas(uint identifier)
        {
            IGraphController controller = GetController(identifier);

            foreach (GraphCanvas canvas in graphCanvases)
            {
                if (canvas.Controller == controller)
                {
                    return(canvas);
                }
            }
            return(null);
        }
示例#21
0
        /// <summary>
        /// Create a new slot
        /// </summary>
        /// <param name="gc">Owning graph controller</param>
        /// <param name="type">Input/Output slot</param>
        /// <param name="firstOwner">Node where there slot resides</param>
        internal Slot(IGraphController gc, SlotType type, IVisualNode firstOwner)
        {
            if (gc == null || firstOwner == null)
                throw new ArgumentNullException();

            this.graphController = gc as GraphController;
            Validity.Assert(this.graphController != null);
            IdGenerator idGenerator = this.graphController.GetIdGenerator();

            this.slotType = type;
            this.version = Slot.Version.Current;
            this.slotId = idGenerator.GetNextId(ComponentType.Slot);
            this.slotState = SlotStates.Visible;
            this.owners.Add(firstOwner.NodeId);
        }
示例#22
0
        /// <summary>
        /// Create a new slot
        /// </summary>
        /// <param name="gc">Owning graph controller</param>
        /// <param name="type">Input/Output slot</param>
        /// <param name="firstOwner">Node where there slot resides</param>
        internal Slot(IGraphController gc, SlotType type, IVisualNode firstOwner)
        {
            if (gc == null || firstOwner == null)
            {
                throw new ArgumentNullException();
            }

            this.graphController = gc as GraphController;
            Validity.Assert(this.graphController != null);
            IdGenerator idGenerator = this.graphController.GetIdGenerator();

            this.slotType  = type;
            this.version   = Slot.Version.Current;
            this.slotId    = idGenerator.GetNextId(ComponentType.Slot);
            this.slotState = SlotStates.Visible;
            this.owners.Add(firstOwner.NodeId);
        }
示例#23
0
        internal IdentifierNode(IGraphController graphController, string caption)
            : base(graphController, NodeType.Identifier)
        {
            this.Assembly   = string.Empty;
            this.ReturnType = string.Empty;
            this.Caption    = this.graphController.GetRuntimeStates().GenerateTempVariable(this.nodeId);
            this.Text       = string.Empty;
            this.UpdateInternalData(true);

            //1 input slot
            Slot newSlot = new Slot(graphController, SlotType.Input, this);

            this.graphController.AddSlot(newSlot);
            this.inputSlots.Add(newSlot.SlotId);

            //1 output slot
            newSlot = new Slot(graphController, SlotType.Output, this);
            this.graphController.AddSlot(newSlot);
            this.outputSlots.Add(newSlot.SlotId);
        }
示例#24
0
        internal void GraphControllerLoaded(uint identifier)
        {
            IGraphController graphController = GetController(identifier);

            if (graphController == null)
            {
                return;
            }

            // update the libraryView if there is any script need to be imported
            // the actuall importing is in the GraphControl::LoadFileInternal()
            List <string> importedScripts = graphController.GetImportedScripts();

            if (importedScripts != null && importedScripts.Count > 0)
            {
                this.libraryView.FinishLoadingLibrary();
            }

            graphController.Modified += new CanvasModifiedHandler(OnCanvasModified);
        }
示例#25
0
        internal PropertyNode(IGraphController graphController, string assembly, string qualifiedName, string argumentTypes)
            : base(graphController, NodeType.Property)
        {
            this.Caption = qualifiedName;
            string[] splitQualifiedName = qualifiedName.Split('.');
            if (null != splitQualifiedName && (splitQualifiedName.Length >= 1))
                this.Caption = splitQualifiedName[1];
            this.Text = this.graphController.GetRuntimeStates().GenerateTempVariable(this.nodeId);

            this.Assembly = assembly;
            this.QualifiedName = qualifiedName;
            this.ArgumentTypes = argumentTypes;
            this.ReturnType = string.Empty;
            this.UpdateReturnTypeAndMemberType();
            this.UpdateInputSlot();

            //Output slot
            Slot outputSlot = new Slot(graphController, SlotType.Output, this);
            this.graphController.AddSlot(outputSlot);
            this.outputSlots.Add(outputSlot.SlotId);
            this.CheckDots();
        }
示例#26
0
 internal UndoRedoRecorder(IGraphController graphController)
 {
     this.graphController = graphController as GraphController;
     this.actionCount = -1;
 }
示例#27
0
 internal CondensedNode(IGraphController graphController, string text)
     : base(graphController, NodeType.Condensed)
 {
     this.Text    = text;
     this.Caption = string.Empty;
 }
示例#28
0
 internal CondensedNode(IGraphController graphController, string text)
     : base(graphController, NodeType.Condensed)
 {
     this.Text = text;
     this.Caption = string.Empty;
 }
示例#29
0
		/// <summary>This will remove the GraphController <paramref>ctrl</paramref> from the graph forms collection.</summary>
		/// <param name="ctrl">The GraphController to remove.</param>
		/// <remarks>No exception is thrown if the Form frm is not a member of the graph forms collection.</remarks>
		public void RemoveGraph(IGraphController ctrl)
		{
			Current.Gui.Execute(RemoveGraph_Unsynchronized, ctrl);
		}
示例#30
0
 public SelectionBox(IGraphController graphController, IGraphVisualHost visualHost)
 {
     this.graphController = graphController;
     this.visualHost      = visualHost;
     InitializeSelectionBox();
 }
示例#31
0
 internal CodeBlockNode(IGraphController graphController, string text)
     : base(graphController, NodeType.CodeBlock)
 {
     this.Caption = string.Empty;
     this.Text = text;
 }
示例#32
0
 private Slot(IGraphController graphController)
 {
     this.graphController = graphController as GraphController;
 }
示例#33
0
 internal IdentifierNode(IGraphController graphController) : base(graphController)
 {
 }
示例#34
0
 internal RenderNode(IGraphController graphController, int inputSlotCount)
     : base(graphController, NodeType.Render)
 {
     this.Text = string.Empty;
     this.Caption = string.Empty;
 }
示例#35
0
 public SelectionBox(IGraphController graphController, IGraphVisualHost visualHost)
 {
     this.graphController = graphController;
     this.visualHost = visualHost;
     InitializeSelectionBox();
 }
示例#36
0
 internal RenderNode(IGraphController graphController, int inputSlotCount)
     : base(graphController, NodeType.Render)
 {
     this.Text    = string.Empty;
     this.Caption = string.Empty;
 }
示例#37
0
 internal DriverNode(IGraphController graphController)
     : base(graphController)
 {
 }
示例#38
0
 internal RenderNode(IGraphController graphController) : base(graphController)
 {
 }
示例#39
0
 internal FunctionNode(IGraphController graphController)
     : base(graphController)
 {
 }
示例#40
0
		private void RemoveGraph_Unsynchronized(IGraphController ctrl)
		{
			foreach (IViewContent content in WorkbenchSingleton.Workbench.ViewContentCollection)
			{
				if ((content is Altaxo.Gui.IMVCControllerWrapper) &&
						object.ReferenceEquals(((Altaxo.Gui.IMVCControllerWrapper)content).MVCController, ctrl))
				{
					content.WorkbenchWindow.CloseWindow(true);
					break;
				}
			}
		}
示例#41
0
 protected VisualNode(IGraphController graphController)
 {
     this.graphController = graphController as GraphController;
     IdGenerator idGenerator = this.graphController.GetIdGenerator();
 }
示例#42
0
 internal CodeBlockNode(IGraphController graphController)
     : base(graphController)
 {
 }
示例#43
0
 private Slot(IGraphController graphController)
 {
     this.graphController = graphController as GraphController;
 }
示例#44
0
        /// <summary>
        /// Create an instance of a slot given storage
        /// </summary>
        /// <param name="graphController"></param>
        /// <param name="storage"></param>
        /// <returns></returns>
        internal static ISlot Create(IGraphController graphController, IStorage storage)
        {
            if (graphController == null || storage == null)
                throw new ArgumentNullException("graphController, storage");

            ISlot slot = new Slot(graphController);
            slot.Deserialize(storage);
            return slot;
        }
示例#45
0
 internal CondensedNode(IGraphController graphController)
     : base(graphController)
 {
 }
示例#46
0
        public static IVisualNode Create(IGraphController graphController, IStorage storage)
        {
            if (graphController == null || storage == null)
                throw new ArgumentNullException("graphcontroller, storage");

            storage.Seek(12, SeekOrigin.Current); //Skip NodeSignature
            NodeType type = (NodeType)storage.ReadInteger(FieldCode.NodeType);
            storage.Seek(-24, SeekOrigin.Current); //Shift cursor back to the start point of reading NodeSignature
            VisualNode node = null;
            switch (type)
            {
                case NodeType.CodeBlock:
                    node = new CodeBlockNode(graphController);
                    node.Deserialize(storage);
                    break;
                case NodeType.Condensed:
                    node = new CondensedNode(graphController);
                    node.Deserialize(storage);
                    break;
                case NodeType.Driver:
                    node = new DriverNode(graphController);
                    node.Deserialize(storage);
                    break;
                case NodeType.Function:
                    node = new FunctionNode(graphController);
                    node.Deserialize(storage);
                    break;
                case NodeType.Identifier:
                    node = new IdentifierNode(graphController);
                    node.Deserialize(storage);
                    break;
                case NodeType.Property:
                    node = new PropertyNode(graphController);
                    node.Deserialize(storage);
                    break;
                case NodeType.Render:
                    node = new RenderNode(graphController);
                    node.Deserialize(storage);
                    break;
                default:
                    throw new ArgumentException("Invalid 'nodeType'");
            }

            return node;
        }
示例#47
0
 internal CondensedNode(IGraphController graphController) : base(graphController)
 {
 }
示例#48
0
 internal FunctionNode(IGraphController graphController) : base(graphController)
 {
 }
示例#49
0
 internal PropertyNode(IGraphController graphController)
     : base(graphController)
 {
 }
示例#50
0
 internal PreviewBubble(IGraphController graphController, uint nodeId)
     : base(graphController, nodeId)
 {
 }
示例#51
0
        /// <summary>
        /// Plots the currently selected data columns of a worksheet as horzizontal bar diagram.
        /// </summary>
        /// <param name="dg">The worksheet controller where the columns are selected in.</param>
        public static void PlotBarChartRelativeStack(GUI.WorksheetController dg)
        {
            IGraphController gc = Plot(dg.DataTable, dg.SelectedDataColumns, PlotStyle_Bar, GroupStyle_RelativeStack_Bar);

            ((G2DCartesicCoordinateSystem)gc.Doc.Layers[0].CoordinateSystem).IsXYInterchanged = true;
        }
示例#52
0
 internal DriverNode(IGraphController graphController) : base(graphController)
 {
 }
示例#53
0
        internal FunctionNode(IGraphController graphController, string assembly, string qualifiedName, string argumentTypes)
            : base(graphController, NodeType.Function)
        {
            this.Text          = this.graphController.GetRuntimeStates().GenerateTempVariable(this.nodeId);
            this.Assembly      = assembly;
            this.QualifiedName = qualifiedName;
            this.ArgumentTypes = argumentTypes;
            this.argumentNames = CoreComponent.Instance.GetArgumentNames(this.Assembly, this.QualifiedName, this.ArgumentTypes);
            this.UpdateReturnTypeAndMemberType();

            int    lastDot   = 0;
            string className = string.Empty;

            switch (this.MemberType)
            {
            case LibraryItem.MemberType.Constructor:
                lastDot = qualifiedName.LastIndexOf('.');
                if (-1 == lastDot)
                {
                    this.Caption = qualifiedName;
                }
                else
                {
                    this.Caption = qualifiedName.Substring(0, lastDot);
                }
                break;

            case LibraryItem.MemberType.StaticMethod:
                lastDot = qualifiedName.LastIndexOf('.');
                if (-1 == lastDot)
                {
                    this.Caption = qualifiedName;
                }
                else
                {
                    this.Caption = qualifiedName.Substring(lastDot + 1);
                }
                break;

            case LibraryItem.MemberType.InstanceMethod:
            case LibraryItem.MemberType.InstanceProperty:
                lastDot      = qualifiedName.LastIndexOf('.');
                this.Caption = qualifiedName.Substring(lastDot + 1);
                break;

            default:
                this.Caption = qualifiedName;
                break;
            }

            //Input slot
            this.CreateInputSlotsFromArgumentTypes(this.ArgumentTypes);

            //Output slot
            Slot outputSlot = new Slot(graphController, SlotType.Output, this);

            this.graphController.AddSlot(outputSlot);
            this.outputSlots.Add(outputSlot.SlotId);


            this.replicationGuideStrings.Clear();
            this.replicationGuides.Clear();
            foreach (uint slot in this.inputSlots)
            {
                this.replicationGuides.Add(new List <int>());
                this.replicationGuideStrings.Add(string.Empty);
            }

            this.CheckDots();
        }
示例#54
0
 internal RenderNode(IGraphController graphController)
     : base(graphController)
 {
 }
示例#55
0
        public GraphVisualHost(GraphCanvas graphCanvas, GraphControl graphControl, string startupFile)
        {
            this.graphCanvas = graphCanvas;
            this.graphControl = graphControl;

            if (children == null)
                children = new VisualCollection(this);

            if (string.IsNullOrEmpty(startupFile))
                this.graphController = ClassFactory.CreateGraphController(this);
            else
            {
                try
                {
                    this.graphController = ClassFactory.CreateGraphController(this, startupFile);
                }
                catch (FileNotFoundException e)
                {
                    MessageBox.Show(string.Format("FileNotFoundException: {0}", e.FileName));
                }
                catch (IOException e)
                {
                    MessageBox.Show(string.Format("IOException: {0}", e.Message));
                }
                catch (InvalidDataException e)
                {
                    MessageBox.Show(string.Format("InvalidDataException: {0}", e.Message));
                }
                catch (FileVersionException e)
                {
                    string message = string.Format(UiStrings.FutureFileVersionFmt, e.RequiredAppVersion);

                    MessageBoxResult result = MessageBoxResult.None;
                    string caption = UiStrings.IncompatibleVersion;
                    result = MessageBox.Show(message, caption, MessageBoxButton.OKCancel);
                    if (result == MessageBoxResult.OK)
                    {
                        System.Diagnostics.Process.Start(CoreStrings.DesignScriptSiteUrl);
                    }
                }
                catch (Exception e)
                {
                    this.graphController = ClassFactory.CreateGraphController(this);
                    this.graphControl.DisplayException(e);
                }
                finally
                {
                    if (null == graphController)
                        this.graphController = ClassFactory.CreateGraphController(this);
                }
            }

            DrawingVisual foregroundVisual = new DrawingVisual();
            edgeVisuals.Add(foregroundVisual, 0);
            this.children.Add(foregroundVisual);

            if (!string.IsNullOrEmpty(startupFile))
                this.ZoomToFit();
        }
示例#56
0
 internal ErrorBubble(IGraphController graphController, uint nodeId)
     : base(graphController, nodeId)
 {
     this.content = (object)string.Empty;
     this.ErrType = ErrorType.None;
 }