Example #1
0
        public Task <ITriggerBinding> TryCreateAsync(TriggerBindingProviderContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            //Retrieve Parameter
            var parameter = context.Parameter;
            AdlsWatcherTriggerAttribute attribute = parameter.GetCustomAttribute <AdlsWatcherTriggerAttribute>(inherit: false);

            if (attribute == null)
            {
                return(Task.FromResult <ITriggerBinding>(null));
            }

            //Validate Trigger
            if (!IsSupportedBindingType(parameter.ParameterType))
            {
                throw new InvalidOperationException($"Can't bind TwitterTriggerAttribute to type '{parameter.ParameterType}'");
            }

            return(Task.FromResult <ITriggerBinding>(new AdlsFileWatcherTriggerBinding(parameter)));
        }
 public AdlsFileWatcherListener(ITriggeredFunctionExecutor executor, AdlsWatcherTriggerAttribute adlsWatcherTriggerAttribute)
 {
     Executor = executor;
     this.adlsWatcherTriggerAttribute = adlsWatcherTriggerAttribute;
 }
 public AdlsFileWatcherTriggerBinding(ParameterInfo parameter)
 {
     _parameter = parameter;
     _attribute = parameter.GetCustomAttribute <AdlsWatcherTriggerAttribute>(inherit: false);
 }