public static ISystemConstantNodeModel CreateSystemConstantNode(this IGraphNodeCreationData data, Type declaringType, Type constantType, string constantName)
        {
            void Setup(SystemConstantNodeModel n)
            {
                n.ReturnType    = constantType.GenerateTypeHandle(data.GraphModel.Stencil);
                n.DeclaringType = declaringType.GenerateTypeHandle(data.GraphModel.Stencil);
                n.Identifier    = constantName;
            }

            var name = $"{declaringType.FriendlyName(false)} > {constantName}";

            return(data.GraphModel.CreateNode <SystemConstantNodeModel>(name, data.Position, data.SpawnFlags, Setup, data.Guid));
        }
        public static ISystemConstantNodeModel CreateSystemConstantNode(this IGraphNodeCreationData data, Type type, PropertyInfo propertyInfo)
        {
            void Setup(SystemConstantNodeModel n)
            {
                n.ReturnType    = propertyInfo.PropertyType.GenerateTypeHandle(data.GraphModel.Stencil);
                n.DeclaringType = propertyInfo.DeclaringType.GenerateTypeHandle(data.GraphModel.Stencil);
                n.Identifier    = propertyInfo.Name;
            }

            var name = $"{type.FriendlyName(false)} > {propertyInfo.Name}";

            return(data.GraphModel.CreateNode <SystemConstantNodeModel>(name, data.Position, data.SpawnFlags, Setup, data.Guid));
        }
 public static MacroRefNodeModel CreateMacroRefNode(this IGraphNodeCreationData data, GraphModel macroGraphModel)
 {
     return(data.GraphModel.CreateMacroRefNode(macroGraphModel, data.Position, data.SpawnFlags, data.Guid));
 }
 public static GetPropertyGroupNodeModel CreateGetPropertyGroupNode(this IGraphNodeCreationData data)
 {
     return(data.GraphModel.CreateGetPropertyGroupNode(data.Position, data.SpawnFlags, data.Guid));
 }
 public static IConstantNodeModel CreateConstantNode(this IGraphNodeCreationData data, string constantName, TypeHandle typeHandle)
 {
     return(data.GraphModel.CreateConstantNode(constantName, typeHandle, data.Position, data.SpawnFlags, data.Guid));
 }
 public static IVariableModel CreateVariableNode(this IGraphNodeCreationData data, IVariableDeclarationModel declarationModel)
 {
     return(data.GraphModel.CreateVariableNode(declarationModel, data.Position, data.SpawnFlags, data.Guid));
 }
 public static BinaryOperatorNodeModel CreateBinaryOperatorNode(this IGraphNodeCreationData data, BinaryOperatorKind kind)
 {
     return(data.GraphModel.CreateBinaryOperatorNode(kind, data.Position, data.SpawnFlags, data.Guid));
 }
 public static InlineExpressionNodeModel CreateInlineExpressionNode(this IGraphNodeCreationData data, string expression)
 {
     return(data.GraphModel.CreateInlineExpressionNode(expression, data.Position, data.SpawnFlags, data.Guid));
 }
 public static FunctionCallNodeModel CreateFunctionCallNode(this IGraphNodeCreationData data, MethodBase methodInfo)
 {
     return(data.GraphModel.CreateFunctionCallNode(methodInfo, data.Position, data.SpawnFlags, data.Guid));
 }
 public static FunctionRefCallNodeModel CreateFunctionRefCallNode(this IGraphNodeCreationData data, FunctionModel methodInfo)
 {
     return(data.CreateNode <FunctionRefCallNodeModel>(methodInfo.Title, n => n.Function = methodInfo));
 }
 public static FunctionModel CreateFunction(this IGraphNodeCreationData data, string methodName)
 {
     return(data.GraphModel.CreateFunction(methodName, data.Position, data.SpawnFlags, data.Guid));
 }
 public static T CreateNode <T>(this IGraphNodeCreationData data, string name = null, Action <T> preDefineSetup = null) where T : NodeModel
 {
     return(data.GraphModel.CreateNode(name, data.Position, data.SpawnFlags, preDefineSetup, data.Guid));
 }
 public static INodeModel CreateNode(this IGraphNodeCreationData data, Type nodeType, string name = null, Action <NodeModel> preDefineSetup = null)
 {
     return(data.GraphModel.CreateNode(nodeType, name, data.Position, data.SpawnFlags, preDefineSetup, data.Guid));
 }
 public static StackBaseModel CreateStack(this IGraphNodeCreationData data, string name)
 {
     return(data.GraphModel.CreateStack(name, data.Position, data.SpawnFlags, data.Guid));
 }
示例#15
0
 /// <summary>
 /// Creates a new node in the graph referenced in <paramref name="data"/>.
 /// </summary>
 /// <param name="data">Data containing some of the required information to create a node.</param>
 /// <param name="nodeName">The name of the node to create.</param>
 /// <param name="initializationCallback">An initialization method to be called right after the node is created.</param>
 /// <typeparam name="T">The type of the new node to create.</typeparam>
 /// <returns>The newly created node.</returns>
 public static T CreateNode <T>(this IGraphNodeCreationData data, string nodeName = null, Action <T> initializationCallback = null) where T : class, INodeModel
 {
     return(data.GraphModel?.CreateNode(nodeName, data.Position, data.Guid, initializationCallback, data.SpawnFlags));
 }
示例#16
0
 /// <summary>
 /// Creates a new node in the graph referenced in <paramref name="data"/>.
 /// </summary>
 /// <param name="data">Data containing some of the required information to create a node.</param>
 /// <param name="nodeTypeToCreate">The type of the new node to create.</param>
 /// <param name="nodeName">The name of the node to create.</param>
 /// <param name="initializationCallback">An initialization method to be called right after the node is created.</param>
 /// <returns>The newly created node.</returns>
 public static INodeModel CreateNode(this IGraphNodeCreationData data, Type nodeTypeToCreate, string nodeName = null, Action <INodeModel> initializationCallback = null)
 {
     return(data.GraphModel.CreateNode(nodeTypeToCreate, nodeName, data.Position, data.Guid, initializationCallback, data.SpawnFlags));
 }