public void ReceiveFrom(INewComponent comp) { if (mainExprFunc == null) { throw new Exception("main expr cannot be null"); } comp.Attach(mainExprFunc); }
public void SetFunction(Action <DataType> func, INewComponent comp) { RecvFunction = func; if (mainExprFunc == null) { mainExprFunc = Yolo.Express <DataType>().Name("OutputAdapterFunc").Perform(x => func(x)); } else { mainExprFunc.Perform(x => func(x)); } comp.Attach(mainExprFunc); }
public static void CreateComponent(INewComponent component, AbstractBlock baseBlock) { lock (tree) { if (baseBlock.ComponentID == 0) { component.ID = NextComponentID; component.InputBlock = baseBlock; baseBlock.ComponentID = component.ID; tree.AddVertex(baseBlock); if (!inputBlocks.Where(x => x.UniqueID == baseBlock.UniqueID).Any()) { inputBlocks.Add(baseBlock); } } else { component.ID = baseBlock.ComponentID; } } }
public void Attach(INewComponent component) { OutputBlock.AddChild(component.InputBlock, new Filter <object>(null)); }
public void Detach(INewComponent component) { throw new NotImplementedException(); }
public void Detach(INewComponent component) { //exprblock.RemoveChild(component.InputBlock); }
public void Attach(INewComponent component) { //exprblock.AddChild<object>(component.InputBlock, null); }
public BaseOutputAdapter(Action <DataType> func, INewComponent fromComp, string name = "CompactOutputAdapter") { SetFunction(func, fromComp); }
public static void QuickSendData(object data, INewComponent comp) { comp.Send(data); }
public void Detach(INewComponent component) { node.Attach(component); }
public INewComponent Get(INewComponent comp) { return(comp); }
public static void Branch <FilterType>(AbstractBlock block, Filter <FilterType> filter, INewComponent component) { component.ID = 0; CreateComponent(component, block); Attach(block, filter, component); }
private static void Attach <FilterType>(AbstractBlock block, Filter <FilterType> filter, INewComponent component) { if (component.ID == 0) { throw new Exception("Tried to add child to a component with no ID"); } if (block.ComponentID == null || block.ComponentID == 0) { block.ComponentID = component.ID; } Connection conn = component.OutputBlock.AddChild(block, filter); }