void OnRightMenuSelected(string selected, int index) { Logger.Info("Right Menu Select. Name:" + selected + ", ID:" + index); if (NodeGraph == null) { return; } System.Type type = m_SelectDict[selected]; INode nodeView = (INode)ClassTools.CallConstructor(type, NodeGraph); AddNode(nodeView); }
public void TryAddConvertNdoe(INodeGraph nodeGraph, INodeInput inCom, INodeOutput outCom, Type outValueType) { foreach (var nodePair in ConvertNdoeDict) { AConvertNode aConvert = (AConvertNode)nodePair.Value; if (aConvert.ConvertType.Equals(AcceptType)) { IConvertNode convertNode = (IConvertNode)ClassTools.CallConstructor(nodePair.Key, nodeGraph); AddNodeBetween(nodeGraph, inCom.ParentNode, outCom.ParentNode, convertNode); convertNode.InputConnect(outCom); convertNode.OutputConnect(inCom); } } }
public static List <T> GetCustomAttributeClassList <T>(Type attributeType) { List <T> classList = new List <T>(); var attrList = GetNamespaceCustomAttributes(attributeType); foreach (var pair in attrList) { Caller.Try(() => { Type type = pair.Key; T containerClass = (T)ClassTools.CallDefaultConstructor(type); classList.Add(containerClass); }); } return(classList); }