public IWorkflowBuilder StartWith <TProcedure>(TProcedure procedure) where TProcedure : Procedure { procedure.Context = this.Context; var node = new ProcedureTreeNode(procedure, null, null); this.Workflow.ProcedureTree = node; return(new Builder(node, this.Context)); }
public IWorkflowBuilder <TOutput> StartWith <TProcedure, TOutput>(TProcedure procedure) where TProcedure : Procedure, IProcedureOutput <TOutput> { procedure.Context = this.Context; var node = new ProcedureTreeNode(procedure, null, typeof(TOutput)); this.Workflow.ProcedureTree = node; return(new Builder <TOutput>(node, this.Context)); }
/// <summary> /// Accepts a drop event /// </summary> /// <param name="sourceNode"></param> public override void AcceptDrop(BaseTreeNode sourceNode) { { if (sourceNode is ShortcutTreeNode) { ShortcutTreeNode shortcut = sourceNode as ShortcutTreeNode; if (shortcut.Item.Dictionary == Item.Dictionary) { Shortcut otherShortcut = (Shortcut)shortcut.Item.Duplicate(); Item.appendShortcuts(otherShortcut); shortcut.Delete(); } } else if (sourceNode is ShortcutFolderTreeNode) { ShortcutFolderTreeNode folder = sourceNode as ShortcutFolderTreeNode; if (folder.Item.Dictionary == Item.Dictionary) { ShortcutFolder otherFolder = (ShortcutFolder)folder.Item.Duplicate(); Item.appendFolders(otherFolder); folder.Delete(); } } else if (sourceNode is RuleTreeNode) { RuleTreeNode rule = sourceNode as RuleTreeNode; if (rule.Item.Dictionary == Item.Dictionary) { Shortcut shortcut = (Shortcut)acceptor.getFactory().createShortcut(); shortcut.CopyFrom(rule.Item); Item.appendShortcuts(shortcut); } } else if (sourceNode is FunctionTreeNode) { FunctionTreeNode function = sourceNode as FunctionTreeNode; if (function.Item.Dictionary == Item.Dictionary) { Shortcut shortcut = (Shortcut)acceptor.getFactory().createShortcut(); shortcut.CopyFrom(function.Item); Item.appendShortcuts(shortcut); } } else if (sourceNode is ProcedureTreeNode) { ProcedureTreeNode procedure = sourceNode as ProcedureTreeNode; if (procedure.Item.Dictionary == Item.Dictionary) { Shortcut shortcut = (Shortcut)acceptor.getFactory().createShortcut(); shortcut.CopyFrom(procedure.Item); Item.appendShortcuts(shortcut); } } else if (sourceNode is VariableTreeNode) { VariableTreeNode variable = sourceNode as VariableTreeNode; if (variable.Item.Dictionary == Item.Dictionary) { Shortcut shortcut = (Shortcut)acceptor.getFactory().createShortcut(); shortcut.CopyFrom(variable.Item); Item.appendShortcuts(shortcut); } } } }