private void GetIdentifierNodeMenuItems() { ObservableCollection <LibraryItem> libraryItems = new ObservableCollection <LibraryItem>(); libraryItemCollection = new Dictionary <int, LibraryItem>(); VisualNode node = graphController.GetVisualNode(this.nodeId); if (node.GetAssembly() == null || node.ReturnType == null) { return; } string[] assemblies = (node.GetAssembly()).Split(','); string[] returnTypes = (node.ReturnType.Split(',')); switch (nodePart) { case NodePart.NorthEast: this.GetMethodsAndProperties(assemblies, returnTypes, libraryItems); break; default: break; } this.PopulateItems(libraryItems); return; }
private void GetPropertyNodeMenuItems() { ObservableCollection <LibraryItem> libraryItems = new ObservableCollection <LibraryItem>(); libraryItemCollection = new Dictionary <int, LibraryItem>(); VisualNode node = graphController.GetVisualNode(this.nodeId); PropertyNode pNode = (PropertyNode)node; List <string> parents = GraphToDSCompiler.GraphUtilities.GetParentClasses(pNode.ReturnType); if (node.GetAssembly() == null || node.ReturnType == null) { return; } string[] assemblies = (node.GetAssembly()).Split(','); string[] returnTypes = (node.ReturnType.Split(',')); switch (nodePart) { case NodePart.NorthEast: this.GetMethodsAndProperties(assemblies, returnTypes, libraryItems); //ProtoCore.Mirror.MethodMirror mirror = new ProtoCore.Mirror.MethodMirror(GraphToDSCompiler.GraphUtilities.GetCore(), Name); //mirror.Get //ObservableCollection<LibraryItem> classLibraryItems = CoreComponent.Instance.GetMethodsAndProperties(pNode.Assembly, pNode.ReturnType); //foreach (LibraryItem item in classLibraryItems) // libraryItems.Add(item); //if (parents.Count != 0) //{ // foreach (string parentClass in parents) // { // ObservableCollection<LibraryItem> parentLibraryItems = CoreComponent.Instance.GetMethodsAndProperties(pNode.Assembly, parentClass); // foreach (LibraryItem item in parentLibraryItems) // libraryItems.Add(item); // } //} break; case NodePart.NorthWest: //propertyNodeItems.Add(Configurations.AddReplicationGuides, "Add Replication Guides"); //propertyNodeItems.Add(Configurations.RemoveReplicationGuides, "Remove Replication Guides"); //propertyNodeItems.Add(Configurations.DeleteNode, "Delete Node"); //propertyNodeItems.Add(10, "Close"); break; default: break; } this.PopulateItems(libraryItems); }
private void GetFunctionNodeMenuItems() { ObservableCollection <LibraryItem> libraryItems = new ObservableCollection <LibraryItem>(); libraryItemCollection = new Dictionary <int, LibraryItem>(); VisualNode node = graphController.GetVisualNode(this.nodeId); FunctionNode fNode = (FunctionNode)node; Dictionary <int, string> functionNodeItems = new Dictionary <int, string>(); if (node.GetAssembly() == null || node.ReturnType == null) { return; } string[] assemblies = (node.GetAssembly()).Split(','); string[] returnTypes = (node.ReturnType.Split(',')); switch (nodePart) { case NodePart.NorthEast: //case NodePart.South: this.GetMethodsAndProperties(assemblies, returnTypes, libraryItems); break; case NodePart.North: if (fNode.MemberType == LibraryItem.MemberType.Constructor) { libraryItems = CoreComponent.Instance.GetConstructors(fNode.Assembly, fNode.QualifiedName); } else if (fNode.MemberType == LibraryItem.MemberType.InstanceMethod) { string argumentTypes = fNode.ArgumentTypes; string[] tempArray = argumentTypes.Split(','); string parentReturnType = tempArray[0]; if (parentReturnType == "this") { uint slotId = node.GetInputSlot(0); ISlot slot = graphController.GetSlot(slotId); uint[] connectingSlots = slot.ConnectingSlots; if (connectingSlots != null) { ISlot parentSlot = graphController.GetSlot(connectingSlots[0]); VisualNode visualNode = graphController.GetVisualNode(parentSlot.Owners[0]); parentReturnType = visualNode.ReturnType; string[] tempParent = { parentReturnType }; this.GetMethodsAndProperties(assemblies, tempParent, libraryItems); //libraryItems = CoreComponent.Instance.GetMethodsAndProperties(fNode.Assembly, parentReturnType); } } else { libraryItems = CoreComponent.Instance.GetMethodsAndProperties(fNode.Assembly, parentReturnType); } } break; case NodePart.NorthWest: Dictionary <int, string> temp = new Dictionary <int, string>(); this.GetNodeOptions(this.nodeId, out temp); functionNodeItems = temp; break; default: break; } this.PopulateItems(libraryItems); return; }