/// <summary> /// XML CONSTRUCTOR: Should not be called by API Users, used for deserialization /// </summary> /// <param name="p_TreeNode">XmlTreeNode used for Deserialization</param> /// <param name="p_View">NodeGraphView Object that will contain the node</param> public IfNode(XmlTreeNode p_TreeNode, NodeGraphView p_View) : base(p_TreeNode, p_View) { this.m_sName = "If condition"; this.m_Connectors.Add(new NodeGraphConnector("A", this, ConnectorType.InputConnector, 0)); this.m_Connectors.Add(new NodeGraphConnector("B", this, ConnectorType.InputConnector, 1)); this.m_Connectors.Add(new NodeGraphConnector("A>B", this, ConnectorType.InputConnector, 2)); this.m_Connectors.Add(new NodeGraphConnector("A=B", this, ConnectorType.InputConnector, 3)); this.m_Connectors.Add(new NodeGraphConnector("A<B", this, ConnectorType.InputConnector, 4)); this.m_Connectors.Add(new NodeGraphConnector("Value", this, ConnectorType.OutputConnector, 0)); this.Height = 110; // Parses XML to get back our values. // Since m_eBehavior is an enum, i've stocked it as a string, then use it to compare if (p_TreeNode.m_attributes["Behavior"] == "ErrorOnMissingInput") { this.m_eBehavior = IfNodeBehavior.ErrorOnMissingInput; } else { this.m_eBehavior = IfNodeBehavior.ReturnDefaultValue; } // Float values can be a pain because of the type of the dot. It's always encoded as en-us CultureInfo this.m_fDefaultValue = float.Parse(p_TreeNode.m_attributes["DefaultValue"], System.Globalization.CultureInfo.GetCultureInfo("en-us")); }
private void OnPasteNodes(object argument) { if (ScriptGraph == null) { return; } if (Clipboard.ContainsData("KlaxScriptNodes")) { string nodeData = (string)Clipboard.GetData("KlaxScriptNodes"); List <CNode> newNodes = CScriptSerializer.Instance.DeserializeObject <List <CNode> >(nodeData); ScriptGraph.ResolveNodesForPaste(newNodes); NodeGraphView graphView = (NodeGraphView)Content; AddNodesToGraph(newNodes, graphView.GetPasteReferenceLocation(), true); } else if (Clipboard.ContainsData(DataFormats.UnicodeText)) { string data = (string)Clipboard.GetData(DataFormats.UnicodeText); try { List <CNode> newNodes = CScriptSerializer.Instance.DeserializeObject <List <CNode> >(data); ScriptGraph.ResolveNodesForPaste(newNodes); NodeGraphView graphView = (NodeGraphView)Content; AddNodesToGraph(newNodes, graphView.GetPasteReferenceLocation(), true); } catch { LogUtility.Log("Paste failed, input text was not in the correct format"); } } }
private void OnEnable() { resizerStyle = new GUIStyle(); resizerStyle.normal.background = EditorGUIUtility.Load("icons/d_AvatarBlendBackground.png") as Texture2D; m_nodeGraphView = new NodeGraphView(); m_nodePropertiesView = new NodePropertiesView(); }
public CNodeGraphViewModel() : base("NodeGraph") { SetIconSourcePath("Resources/Images/Tabs/assetbrowser.png"); Content = new NodeGraphView(); MouseDownCommand = new CRelayCommand(OnMouseDown); PreviewMouseDownCommand = new CRelayCommand(OnPreviewMouseDown); PreviewMouseUpCommand = new CRelayCommand(OnPreviewMouseUp); StartDragContentCommand = new CRelayCommand(OnStartDragContent); DeleteNodesCommand = new CRelayCommand(OnDeleteCommand); CopyNodesCommand = new CRelayCommand(OnCopyNodes); PasteNodesCommand = new CRelayCommand(OnPasteNodes); CutNodesCommand = new CRelayCommand(OnCutNodes); DuplicateNodesCommand = new CRelayCommand(OnDuplicateNodes); DragEnterCommand = new CRelayCommand(OnDragEnter); DragOverCommand = new CRelayCommand(OnDragOver); DropCommand = new CRelayCommand(OnDrop); CreateNewGraph(); m_lodLevels.Add(1.0); m_lodLevels.Add(0.7); m_lodLevels.Add(0.5); m_lodLevels.Add(0.3); m_lodLevels.Add(0.1); AddNodeViewModel = new CAddNodeViewModel(CKlaxScriptNodeQueryContext.Empty); AddNodeViewModel.NodeSelected += OnNodeAddNodePopupSelected; VariablePopup = new CVariableDragPopupViewModel(this); }
public static GraphSaveUtility GetInstance(NodeGraphView graphView) { return(new GraphSaveUtility { targetGraphView = graphView }); }
protected override void RegisterCallbacksOnTarget() { m_nodeGraphView = target as NodeGraphView; target.RegisterCallback <MouseDownEvent>(OnMouseDown); target.RegisterCallback <MouseMoveEvent>(OnMouseMove); target.RegisterCallback <MouseUpEvent>(OnMouseUp); }
public AbsNode(int p_X, int p_Y, NodeGraphView p_View, bool p_CanBeSelected) : base(p_X, p_Y, p_View, p_CanBeSelected) { this.m_sName = "Abs(A)"; this.m_Connectors.Add(new NodeGraphConnector("A", this, ConnectorType.InputConnector, 0, "Float")); this.m_Connectors.Add(new NodeGraphConnector("Result", this, ConnectorType.OutputConnector, 0, "Float")); this.Height = 45; }
public AbsNode(XmlTreeNode p_TreeNode, NodeGraphView p_View) : base(p_TreeNode, p_View) { this.m_sName = "Abs(A)"; this.m_Connectors.Add(new NodeGraphConnector("A", this, ConnectorType.InputConnector, 0, "Float")); this.m_Connectors.Add(new NodeGraphConnector("Result", this, ConnectorType.OutputConnector, 0, "Float")); this.Height = 45; }
public MultiplyNode(XmlTreeNode p_TreeNode, NodeGraphView p_View) : base(p_TreeNode, p_View) { this.m_sName = "A*B"; this.m_Connectors.Add(new NodeGraphConnector("A", this, ConnectorType.InputConnector, 0, "Float")); this.m_Connectors.Add(new NodeGraphConnector("B", this, ConnectorType.InputConnector, 1, "Float")); this.m_Connectors.Add(new NodeGraphConnector("Result (A*B)", this, ConnectorType.OutputConnector, 0, "Float")); this.Height = 64; }
public MultiplyNode(int p_X, int p_Y, NodeGraphView p_View, bool p_CanBeSelected) : base(p_X, p_Y, p_View, p_CanBeSelected) { this.m_sName = "A*B"; this.m_Connectors.Add(new NodeGraphConnector("A", this, ConnectorType.InputConnector, 0, "Float")); this.m_Connectors.Add(new NodeGraphConnector("B", this, ConnectorType.InputConnector, 1, "Float")); this.m_Connectors.Add(new NodeGraphConnector("Result (A*B)", this, ConnectorType.OutputConnector, 0, "Float")); this.Height = 64; }
public BoolConstNode(XmlTreeNode p_TreeNode, NodeGraphView p_View) : base(p_TreeNode, p_View) { this.m_sName = "Bool: NAN"; this.m_Connectors.Add(new NodeGraphConnector("Value", this, ConnectorType.OutputConnector, 0, "Boolean")); this.Width = 80; this.Height = 45; this.Value = false; }
public DivideNode(XmlTreeNode p_TreeNode, NodeGraphView p_View) : base(p_TreeNode, p_View) { this.m_sName = "A/B"; this.m_Connectors.Add(new NodeGraphConnector("A", this, ConnectorType.InputConnector, 0)); this.m_Connectors.Add(new NodeGraphConnector("B", this, ConnectorType.InputConnector, 1)); this.m_Connectors.Add(new NodeGraphConnector("Result (A/B)", this, ConnectorType.OutputConnector, 0)); this.Height = 64; }
public ReferenceRoot(XmlTreeNode p_TreeNode, NodeGraphView p_View) : base(p_TreeNode, p_View) { this.m_sName = "Output"; this.m_Connectors.Add(new NodeGraphConnector("Result 1", this, ConnectorType.InputConnector, 0)); this.m_Connectors.Add(new NodeGraphConnector("Result 2", this, ConnectorType.InputConnector, 1)); this.m_Connectors.Add(new NodeGraphConnector("Result 3", this, ConnectorType.InputConnector, 2)); this.Height = 86; }
public FloatConstNode(int p_X, int p_Y, NodeGraphView p_View, bool p_CanBeSelected) : base(p_X, p_Y, p_View, p_CanBeSelected) { this.m_sName = "Float: NAN"; this.m_Connectors.Add(new NodeGraphConnector("Value", this, ConnectorType.OutputConnector, 0, "Float")); this.Width = 80; this.Height = 45; this.Value = 0.0f; }
public ReferenceRoot(int p_X, int p_Y, NodeGraphView p_View) : base(p_X, p_Y, p_View, false) { this.m_sName = "Output"; this.m_Connectors.Add(new NodeGraphConnector("Result 1", this, ConnectorType.InputConnector, 0)); this.m_Connectors.Add(new NodeGraphConnector("Result 2", this, ConnectorType.InputConnector, 1)); this.m_Connectors.Add(new NodeGraphConnector("Result 3", this, ConnectorType.InputConnector, 2)); this.Height = 86; }
public FloatConstNode(XmlTreeNode p_TreeNode, NodeGraphView p_View) : base(p_TreeNode, p_View) { this.m_sName = "Float: NAN"; this.m_Connectors.Add(new NodeGraphConnector("Value", this, ConnectorType.OutputConnector, 0, "Float")); this.Width = 80; this.Height = 45; this.Value = 0.0f; }
public DivideNode(int p_X, int p_Y, NodeGraphView p_View, bool p_CanBeSelected) : base(p_X, p_Y, p_View, p_CanBeSelected) { this.m_sName = "A/B"; this.m_Connectors.Add(new NodeGraphConnector("A", this, ConnectorType.InputConnector, 0)); this.m_Connectors.Add(new NodeGraphConnector("B", this, ConnectorType.InputConnector, 1)); this.m_Connectors.Add(new NodeGraphConnector("Result (A/B)", this, ConnectorType.OutputConnector, 0)); this.Height = 64; }
private void OnEnable() { //AssemblyReloadEvents.beforeAssemblyReload += OnBeforeAssemblyReload; //AssemblyReloadEvents.afterAssemblyReload += OnAfterAssemblyReload; resizerStyle = new GUIStyle(); resizerStyle.normal.background = EditorGUIUtility.Load("icons/d_AvatarBlendBackground.png") as Texture2D; m_nodeGraphView = new NodeGraphView(); m_nodePropertiesView = new NodePropertiesView(); }
public TemplateModule(XmlTreeNode p_TreeNode, NodeGraphView p_View) : base(p_TreeNode, p_View) { this.m_sName = "TemplateModule"; this.m_Connectors.Add(new NodeGraphConnector("Input 0", this, ConnectorType.InputConnector, 0)); this.m_Connectors.Add(new NodeGraphConnector("Input 1", this, ConnectorType.InputConnector, 1)); this.m_Connectors.Add(new NodeGraphConnector("Output 0", this, ConnectorType.OutputConnector, 0)); this.m_Connectors.Add(new NodeGraphConnector("Output 1", this, ConnectorType.OutputConnector, 1)); this.Height = 100; }
public FloatSwitchNode(XmlTreeNode p_TreeNode, NodeGraphView p_View) : base(p_TreeNode, p_View) { this.m_sName = "Float switch (switch?A:B)"; this.m_Connectors.Add(new NodeGraphConnector("A (true)", this, ConnectorType.InputConnector, 0, "Float")); this.m_Connectors.Add(new NodeGraphConnector("B (false)", this, ConnectorType.InputConnector, 1, "Float")); this.m_Connectors.Add(new NodeGraphConnector("Switch", this, ConnectorType.InputConnector, 2, "Boolean")); this.m_Connectors.Add(new NodeGraphConnector("Result", this, ConnectorType.OutputConnector, 0, "Float")); this.Height = 80; }
public FloatSwitchNode(int p_X, int p_Y, NodeGraphView p_View, bool p_CanBeSelected) : base(p_X, p_Y, p_View, p_CanBeSelected) { this.m_sName = "Float switch (switch?A:B)"; this.m_Connectors.Add(new NodeGraphConnector("A (true)", this, ConnectorType.InputConnector, 0, "Float")); this.m_Connectors.Add(new NodeGraphConnector("B (false)", this, ConnectorType.InputConnector, 1, "Float")); this.m_Connectors.Add(new NodeGraphConnector("Switch", this, ConnectorType.InputConnector, 2, "Boolean")); this.m_Connectors.Add(new NodeGraphConnector("Result", this, ConnectorType.OutputConnector, 0, "Float")); this.Height = 80; }
public TemplateModule(int p_X, int p_Y, NodeGraphView p_View, bool p_CanBeSelected) : base(p_X, p_Y, p_View, p_CanBeSelected) { this.m_sName = "TemplateModule"; this.m_Connectors.Add(new NodeGraphConnector("Input 0", this, ConnectorType.InputConnector, 0)); this.m_Connectors.Add(new NodeGraphConnector("Input 1", this, ConnectorType.InputConnector, 1)); this.m_Connectors.Add(new NodeGraphConnector("Output 0", this, ConnectorType.OutputConnector, 0)); this.m_Connectors.Add(new NodeGraphConnector("Output 1", this, ConnectorType.OutputConnector, 1)); this.Height = 100; }
void ConstructNodeGraph() { graph = new NodeGraphView() { name = "UI nodes" }; graph.EditorData = this; graph.StretchToParentSize(); rootVisualElement.Add(graph); }
private void OnPreviewMouseDown(object e) { MouseButtonEventArgs args = (MouseButtonEventArgs)e; if (args.ChangedButton == MouseButton.Right) { m_mouseDownPoint = args.GetPosition(null); NodeGraphView graphView = (NodeGraphView)Content; m_addNodePoint = graphView.GetMouseEventPosInNodeCanvas(args); } }
private void OnDrop(object e) { if (ScriptGraph == null) { return; } DragEventArgs args = (DragEventArgs)e; args.Effects = DragDropEffects.None; List <CNode> newNodes = new List <CNode>(); if (args.Data.GetDataPresent("klaxVariableEntry")) { CEntityVariableViewModel variableEntry = (CEntityVariableViewModel)args.Data.GetData("klaxVariableEntry"); NodeGraphView graphView = (NodeGraphView)Content; if (Keyboard.Modifiers.HasFlag(ModifierKeys.Control)) { newNodes.Add(new CGetKlaxVariableNode(variableEntry.Variable)); } else if (Keyboard.Modifiers.HasFlag(ModifierKeys.Alt)) { newNodes.Add(new CSetKlaxVariableNode(variableEntry.Variable)); } else { VariablePopup.IsVisible = true; VariablePopup.Position = graphView.GetPasteReferenceLocation(); VariablePopup.Variable = variableEntry; } } else if (args.Data.GetDataPresent("builderSceneComponent")) { CInspectorSceneComponentViewModel sceneComponentViewModel = (CInspectorSceneComponentViewModel)args.Data.GetData("builderSceneComponent"); newNodes.Add(new CComponentVariableNode(sceneComponentViewModel.ComponentId.GetComponent())); } else if (args.Data.GetDataPresent("builderEntityComponent")) { CInspectorEntityComponentViewModel entityComponentViewModel = (CInspectorEntityComponentViewModel)args.Data.GetData("builderEntityComponent"); newNodes.Add(new CComponentVariableNode(entityComponentViewModel.ComponentId.GetComponent())); } if (newNodes.Count > 0) { NodeGraphView graphView = (NodeGraphView)Content; AddNodesToGraph(newNodes, graphView.GetPasteReferenceLocation(), true); } args.Handled = true; }
/// <summary> /// EDITOR CONSTRUCTOR: Builds the node. /// </summary> /// <param name="p_X">X Position (in the view)</param> /// <param name="p_Y">Y Position (in the view)</param> /// <param name="p_View">NodeGraphView Object that will contain the node</param> /// <param name="p_CanBeSelected">if the node can be selected</param> public IfNode(int p_X, int p_Y, NodeGraphView p_View, bool p_CanBeSelected) : base(p_X, p_Y, p_View, p_CanBeSelected) { this.m_sName = "If condition"; this.m_Connectors.Add(new NodeGraphConnector("A", this, ConnectorType.InputConnector, 0)); this.m_Connectors.Add(new NodeGraphConnector("B", this, ConnectorType.InputConnector, 1)); this.m_Connectors.Add(new NodeGraphConnector("A>B", this, ConnectorType.InputConnector, 2)); this.m_Connectors.Add(new NodeGraphConnector("A=B", this, ConnectorType.InputConnector, 3)); this.m_Connectors.Add(new NodeGraphConnector("A<B", this, ConnectorType.InputConnector, 4)); this.m_Connectors.Add(new NodeGraphConnector("Value", this, ConnectorType.OutputConnector, 0)); this.Height = 110; // Sets our members to default values this.m_eBehavior = IfNodeBehavior.ErrorOnMissingInput; this.m_fDefaultValue = 0.0f; }
public void Dispose() { if (m_GraphView != null) { saveRequested = null; showInProjectRequested = null; foreach (var node in m_GraphView.Children().OfType <NodeView>()) { node.Dispose(); } m_GraphView = null; } if (m_SearchWindowProvider != null) { Object.DestroyImmediate(m_SearchWindowProvider); m_SearchWindowProvider = null; } }
public GraphAxesController(NodeGraphView nodeGraphView, CustomContentDragger contentDragger, SecondarySelectionDragger secondarySelectionDragger) { this.name = "graph-axes-controller"; m_nodeGraphView = nodeGraphView; m_customContentDragger = contentDragger; m_secondarySelectionDragger = secondarySelectionDragger; m_xAxis = new GraphAxis(); m_yAxis = new GraphAxis(); VisualElement graphViewContent = m_nodeGraphView.Q <VisualElement>("contentViewContainer"); Add(m_xAxis); Add(m_yAxis); RefreshPositions(); m_nodeGraphView.RegisterCallback <GeometryChangedEvent>(RefreshSizes); m_nodeGraphView.viewTransformChanged += RefreshPositions; m_customContentDragger.PositionChanged += RefreshPositions; m_secondarySelectionDragger.OnDragging += RefreshPositions; // TODO: This is a hack to get the axes to update when moving nodes around. But it still doesn't work perfectly. }
public override void InitState() { GameGlobal.ContentPath = ContentPath; base.InitState(); var split1 = new HorizontalSplitterForm().Set(0, 0, AppInfo.W, AppInfo.H) as HorizontalSplitterForm; split1.SetSplit(AppInfo.H - AppInfo.H / 4); var tileBrowse = new TileBrowser().Set(0, 0, split1.BotDock.W, split1.BotDock.H) as TileBrowser;; split1.SetBottom(tileBrowse); var split2 = new HorizontalSplitterForm().Set(0, 0, split1.TopDock.W, split1.TopDock.H) as HorizontalSplitterForm; var menu = new MenuForm().Set(0, 0, AppInfo.W, 20) as MenuForm; UI.Menu = menu; var menu_map = menu.AddItem("Map"); menu_map.Menu.AddItem("Load Map"); menu_map.Menu.AddItem("Save Map"); menu_map.Menu.AddItem("New Map"); menu_map.Menu.AddItem("Exit", (b) => { Environment.Exit(1); }); var menu_tiles = menu.AddItem("Tiles"); var tiles_newSet = menu_tiles.Menu.AddItem("New Set"); var tiles_addSet = menu_tiles.Menu.AddItem("Add set"); tiles_newSet.Click = (b) => { tileBrowse.newSet(); }; tiles_addSet.Click = (b) => { var reqs = new RequestFileForm("Load tileset .ts..", ContentPath); SUI.Top = reqs; reqs.Selected = (path) => { var ts = new TileSet(path); ts.Load(path); SUI.Top = null; tileBrowse.AddTileSet(ts); }; }; menu.AddItem("Edit"); //menu.AddItem("") split1.SetTop(split2); UIForm topForm = new UIForm().Set(0, 0, split2.TopDock.W, split2.TopDock.H); //topForm.Add(menu); //split2.SetTop(topForm); //split1.SetTop(split2); split2.SetSplit(50); var split3 = new VerticalSplitterForm().Set(0, 0, split2.BotDock.W, split2.BotDock.H) as VerticalSplitterForm; var toolRoot = new UIForm().Set(0, 0, split2.TopDock.W, split2.TopDock.H); split2.SetTop(toolRoot); split2.SetBottom(split3); split3.SetSplit(150); var nodeTree = new NodeGraphView().Set(0, 0, split3.LeftDock.W, split3.LeftDock.H, "Scene Nodes") as NodeGraphView; split3.SetLeft(nodeTree); var nodeBrowse = new NodeBrowser().Set(0, 0, split3.LeftDock.W, split3.LeftDock.H) as NodeBrowser; //split3.SetLeft(nodeBrowse); var mapEdit = new MapEditForm().Set(0, 0, split3.RightDock.W, split3.RightDock.H) as MapEditForm; nodeTree.SetMap(mapEdit.CurMap); split3.SetRight(mapEdit); SUI = new UI(); SUI.Root = split1; var toolBar = new ToolBarForm().Set(0, 0, toolRoot.W, 25) as ToolBarForm; var tb_paste = toolBar.AddItem("Paste"); var tb_rect = toolBar.AddItem("Rect"); var tb_oval = toolBar.AddItem("Oval"); var tb_fill = toolBar.AddItem("Fill"); var tb_smartfill = toolBar.AddItem("Smart-Fill"); tb_paste.Click = () => { mapEdit.Mode = EditMode.Paste; }; tb_fill.Click = () => { mapEdit.Mode = EditMode.Fill; }; toolRoot.Add(toolBar); var mapMode = new Texture2D("content/edit/mapmode.png", LoadMethod.Single, true); var tileMode = new Texture2D("content/edit/tiles.png", LoadMethod.Single, true); SUI.Dock.AddIcon(mapMode, 64); var mode_Tiles = SUI.Dock.AddIcon(tileMode, 64); mode_Tiles.Click = () => { UI.Menu = null; Vivid.App.VividApp.PushState(new MapViewer.States.TileSetEditor()); }; }
public GraphEditorView(EditorWindow editorWindow, AbstractNodeGraph graph) { m_Graph = graph; styleSheets.Add(Resources.Load <StyleSheet>("Styles/GraphEditorView")); string serializedWindowLayout = EditorUserSettings.GetConfigValue(k_FloatingWindowsLayoutKey); if (!string.IsNullOrEmpty(serializedWindowLayout)) { m_FloatingWindowsLayout = JsonUtility.FromJson <FloatingWindowsLayout>(serializedWindowLayout); } var toolbar = new IMGUIContainer(() => { GUILayout.BeginHorizontal(EditorStyles.toolbar); if (GUILayout.Button("Save Asset", EditorStyles.toolbarButton)) { if (saveRequested != null) { saveRequested(); } } GUILayout.Space(6); if (GUILayout.Button("Show In Project", EditorStyles.toolbarButton)) { if (showInProjectRequested != null) { showInProjectRequested(); } } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); }); Add(toolbar); var content = new VisualElement { name = "content" }; { m_GraphView = new NodeGraphView(m_Graph) { name = "GraphView", viewDataKey = "NodeGraphView" }; m_GraphView.SetupZoom(0.05f, ContentZoomer.DefaultMaxScale); m_GraphView.AddManipulator(new ContentDragger()); m_GraphView.AddManipulator(new SelectionDragger()); m_GraphView.AddManipulator(new RectangleSelector()); m_GraphView.AddManipulator(new ClickSelector()); m_GraphView.RegisterCallback <KeyDownEvent>(OnSpaceDown); content.Add(m_GraphView); m_BlackboardProvider = new BlackboardProvider(graph); m_GraphView.Add(m_BlackboardProvider.blackboard); Rect blackboardLayout = m_BlackboardProvider.blackboard.layout; blackboardLayout.x = 10f; blackboardLayout.y = 10f; m_BlackboardProvider.blackboard.SetPosition(blackboardLayout); m_GraphView.graphViewChanged = GraphViewChanged; RegisterCallback <GeometryChangedEvent>(ApplySerializewindowLayouts); } m_SearchWindowProvider = ScriptableObject.CreateInstance <SearchWindowProvider>(); m_SearchWindowProvider.Initialize(editorWindow, m_Graph, m_GraphView); m_GraphView.nodeCreationRequest = (c) => { m_SearchWindowProvider.connectedPort = null; SearchWindow.Open(new SearchWindowContext(c.screenMousePosition), m_SearchWindowProvider); }; m_EdgeConnectorListener = new EdgeConnectorListener(m_Graph, m_SearchWindowProvider); foreach (var node in graph.GetNodes <INode>()) { AddNode(node); } foreach (var edge in graph.GetEdges()) { AddEdge(edge); } Add(content); }