Exemplo n.º 1
0
 public override void RegisterPort()
 {
     input = new FlowInput("In", () => {
         if (open)
         {
             Finish(onOpen);
         }
         else
         {
             Finish(onClosed);
         }
     });
     toggle = new FlowInput("Toggle", () => {
         open = !open;
     });
     if (CodeGenerator.isGenerating)
     {
         CodeGenerator.RegisterFlowNode(this);
         string varName = CodeGenerator.AddVariable(new VariableData("open", typeof(bool), open));
         input.codeGeneration = () => {
             return(CodeGenerator.GenerateIfStatement(varName,
                                                      CodeGenerator.GetFinishCode(this, true, onOpen),
                                                      CodeGenerator.GetFinishCode(this, true, onClosed)));
         };
         toggle.codeGeneration = () => {
             return(CodeGenerator.GenerateSetCode(varName, "!" + varName));
         };
     }
 }
Exemplo n.º 2
0
        protected override void RegisterPorts()
        {
            // FlowInput
            _flowIn = AddFlowInput("In", (Flow f) =>
            {
                BeginAction();
            });


            //_flowOut = AddFlowOutput("Out");
            ResetFlowOutList();

            // valueInput
            _targetValueIn = AddValueInput <string>("Targets");

            AutoGeneratePort();
        }
Exemplo n.º 3
0
 public HierarchyPortTree(Node node, FlowInput port, int id, int depth, string displayName) : base(id, depth, displayName)
 {
     this.node = node;
     this.port = port;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Drawing ports
 /// </summary>
 protected override void RegisterPorts()
 {
     input  = AddFlowInput("Input", delegate(Flow flow) { });
     output = AddFlowOutput("Output");
 }