Esempio n. 1
0
        public Task Custom(IData[] customList, IReceivesBrightness device, int durationMs, int?loop = null, int priority = 1)
        {
            var controlToken = device.TakeControl(priority);

            return(Custom(customList, device.GetDataObserver(controlToken), durationMs, loop)
                   .ContinueWith(x =>
            {
                controlToken.Dispose();
            }));
        }
Esempio n. 2
0
        public Task Custom(double[] customList, IReceivesBrightness device, int durationMs, int? loop = null, int priority = 1)
        {
            var controlToken = device.TakeControl(priority);

            return Custom(customList, device.GetDataObserver(controlToken), durationMs, loop)
                .ContinueWith(x =>
                {
                    controlToken.Dispose();
                });
        }
Esempio n. 3
0
        public Task Shimmer(IReceivesBrightness device, double minBrightness, double maxBrightness, int durationMs, int priority = 1, IControlToken token = null)
        {
            if (token != null)
            {
                return(Shimmer(device.GetDataObserver(token), minBrightness, maxBrightness, durationMs));
            }

            var controlToken = device.TakeControl(priority);

            return(Shimmer(device.GetDataObserver(controlToken), minBrightness, maxBrightness, durationMs)
                   .ContinueWith(x =>
            {
                controlToken.Dispose();
            }));
        }
Esempio n. 4
0
        public Task Fade(
            IReceivesBrightness device,
            double start,
            double end,
            int durationMs,
            int priority             = 1,
            ITransformer transformer = null,
            IControlToken token      = null,
            params Tuple <DataElements, object>[] additionalData)
        {
            if (token != null)
            {
                return(Fade(device.GetDataObserver(token), start, end, durationMs, transformer, additionalData));
            }

            var controlToken = device.TakeControl(priority);

            return(Fade(device.GetDataObserver(controlToken), start, end, durationMs, transformer, additionalData)
                   .ContinueWith(x =>
            {
                controlToken.Dispose();
            }));
        }
Esempio n. 5
0
        public Task Shimmer(IReceivesBrightness device, double minBrightness, double maxBrightness, int durationMs, int priority = 1, IControlToken token = null)
        {
            if (token != null)
                return Shimmer(device.GetDataObserver(token), minBrightness, maxBrightness, durationMs);

            var controlToken = device.TakeControl(priority);

            return Shimmer(device.GetDataObserver(controlToken), minBrightness, maxBrightness, durationMs)
                .ContinueWith(x =>
                {
                    controlToken.Dispose();
                });
        }
Esempio n. 6
0
        public Task Fade(
            IReceivesBrightness device,
            double start,
            double end,
            int durationMs,
            int priority = 1,
            ITransformer transformer = null,
            IControlToken token = null,
            params Tuple<DataElements, object>[] additionalData)
        {
            if (token != null)
                return Fade(device.GetDataObserver(token), start, end, durationMs, transformer, additionalData);

            var controlToken = device.TakeControl(priority);

            return Fade(device.GetDataObserver(controlToken), start, end, durationMs, transformer, additionalData)
                .ContinueWith(x =>
                {
                    controlToken.Dispose();
                });
        }