Пример #1
0
		protected override void _PreRender(CancellationTokenSource tokenSource = null)
		{
			_elementData = new EffectIntents();

			CommandValue value = new CommandValue(new StringCommand(string.Format("{0}|{1}", "RDS", _data.Title)));

			foreach (ElementNode node in TargetNodes) {
				if (tokenSource != null && tokenSource.IsCancellationRequested)
					return;
				 

				IIntent i = new CommandIntent(value, TimeSpan);
				_elementData.AddIntentForElement(node.Element.Id, i, TimeSpan.Zero);
			}
		}
Пример #2
0
		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)));

			foreach (var node in TargetNodes)
			{
				foreach (var elementNode in node.GetLeafEnumerator())
				{
					IIntent i = new CommandIntent(value, TimeSpan);
					_elementData.AddIntentForElement(elementNode.Element.Id, i, TimeSpan.Zero);	
				}
			}
				
		}
Пример #3
0
        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);
            });
        }
Пример #4
0
        protected override void _PreRender(CancellationTokenSource tokenSource = null)
        {
            _elementData = new EffectIntents();

            if (_data == null)
                return;

            ICommand command = null;

            switch (ValueType) {
                case CustomValueType._8Bit:
                    command = new _8BitCommand(Value8Bit);
                    break;
                case CustomValueType._16Bit:
                    command = new _16BitCommand(Value16Bit);
                    break;
                case CustomValueType._32Bit:
                    command = new _32BitCommand(Value32Bit);
                    break;
                case CustomValueType._64Bit:
                    command = new _64BitCommand(Value64Bit);
                    break;
                case CustomValueType.Color:
                    command = new ColorCommand(ColorValue);
                    break;
                case CustomValueType.String:
                    command = new StringCommand(StringValue);
                    break;
            }

            CommandValue value = new CommandValue(command);

            foreach (ElementNode node in TargetNodes)
            {
                foreach (var leafNode in node.GetLeafEnumerator())
                {
                    if (tokenSource != null && tokenSource.IsCancellationRequested)
                        return;

                    IIntent intent = new CommandIntent(value, TimeSpan);
                    _elementData.AddIntentForElement(leafNode.Element.Id, intent, TimeSpan.Zero);
                }

            }
        }