public static BlockEditorControlBase GetGraphView(this ICoreObject block, IWorkingContext ViewWorkingContext = null, ISynchronizeInvoke synchronizer = null) { ISynchronizeInvoke UsingSynchronizer; if (synchronizer == null) { UsingSynchronizer = block.GetSynchronizer(); } else { UsingSynchronizer = synchronizer; } return(TiaStarter.RunInSynchronizer(UsingSynchronizer, () => { GraphBlockEditorControl pl = new GraphBlockEditorControl(); IWorkingContext iwc = block.GetWorkingContext(); pl.Attach(iwc); BlockEditorLogicBase logic = block.GetGraphBlockEditorLogic(); pl.SetDomainLogic(logic); pl.SetPayload(block); pl.InitializationFinished(); pl.CreateVisuals(); return pl; }) as BlockEditorControlBase); }
public static BlockEditorControlBase GetGraphView(this ICoreObject block, IWorkingContext ViewWorkingContext = null, ISynchronizeInvoke synchronizer = null) { ISynchronizeInvoke UsingSynchronizer; if (synchronizer == null) { UsingSynchronizer = block.GetSynchronizer(); } else { UsingSynchronizer = synchronizer; } if (UsingSynchronizer.InvokeRequired) { return(UnifiedSynchronizerAccess.Invoke(UsingSynchronizer, new GetGraphViewDelegate(GetGraphView), new object[3] { block, ViewWorkingContext, synchronizer }).InvokeResult as BlockEditorControlBase); } GraphBlockEditorControl pl = new GraphBlockEditorControl(); IWorkingContext iwc = block.GetWorkingContext(); pl.Attach(iwc); BlockEditorLogicBase logic = block.GetGraphBlockEditorLogic(); pl.SetDomainLogic(logic); pl.SetPayload(block); pl.InitializationFinished(); pl.CreateVisuals(); return(pl); }