protected override void _PreRender(CancellationTokenSource cancellationToken = null) { _elementData = new EffectIntents(); var targetNodes = TargetNodes.AsParallel(); if (cancellationToken != null) { targetNodes = targetNodes.WithCancellation(cancellationToken.Token); } targetNodes.ForAll(node => { if (node != null) { RenderNode(node); } }); }
protected override void _PreRender(CancellationTokenSource cancellationToken = null) { _elementData = new EffectIntents(); var value = new CommandValue(new StringCommand(string.Format("{0}|{1},{2}", "Launcher", _data.Executable, _data.Arguments))); var targetNodes = TargetNodes.AsParallel(); if (cancellationToken != null) { targetNodes = targetNodes.WithCancellation(cancellationToken.Token); } targetNodes.ForAll(node => { IIntent i = new CommandIntent(value, TimeSpan); _elementData.AddIntentForElement(node.Element.Id, i, TimeSpan.Zero); }); }