コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: ComAttrs.cs プロジェクト: code2X/dniPrints
 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);
         }
     }
 }
コード例 #3
0
    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);
    }