示例#1
0
        public override bool TryCreate(ScriptBindingContext context, out ScriptBinding binding)
        {
            binding = null;

            if (string.Equals(context.Type, "table", StringComparison.OrdinalIgnoreCase))
            {
                binding = new TableScriptBinding(context);
            }
            else if (string.Compare(context.Type, "queueTrigger", StringComparison.OrdinalIgnoreCase) == 0 ||
                     string.Compare(context.Type, "queue", StringComparison.OrdinalIgnoreCase) == 0)
            {
                binding = new QueueScriptBinding(context);
            }
            else if (string.Compare(context.Type, "blobTrigger", StringComparison.OrdinalIgnoreCase) == 0 ||
                     string.Compare(context.Type, "blob", StringComparison.OrdinalIgnoreCase) == 0)
            {
                binding = new BlobScriptBinding(context);
            }
            else if (string.Compare(context.Type, "httpTrigger", StringComparison.OrdinalIgnoreCase) == 0)
            {
                binding = new HttpScriptBinding(context);
            }
            else if (string.Compare(context.Type, "manualTrigger", StringComparison.OrdinalIgnoreCase) == 0)
            {
                binding = new ManualScriptBinding(context);
            }

            return(binding != null);
        }
        public override bool TryCreate(ScriptBindingContext context, out ScriptBinding binding)
        {
            binding = null;

            if (string.Equals(context.Type, "table", StringComparison.OrdinalIgnoreCase))
            {
                binding = new TableScriptBinding(context);
            }
            else if (string.Compare(context.Type, "queueTrigger", StringComparison.OrdinalIgnoreCase) == 0 ||
                string.Compare(context.Type, "queue", StringComparison.OrdinalIgnoreCase) == 0)
            {
                binding = new QueueScriptBinding(context);
            }
            else if (string.Compare(context.Type, "blobTrigger", StringComparison.OrdinalIgnoreCase) == 0 ||
                     string.Compare(context.Type, "blob", StringComparison.OrdinalIgnoreCase) == 0)
            {
                binding = new BlobScriptBinding(context);
            }
            else if (string.Compare(context.Type, "httpTrigger", StringComparison.OrdinalIgnoreCase) == 0)
            {
                binding = new HttpScriptBinding(context);
            }
            else if (string.Compare(context.Type, "manualTrigger", StringComparison.OrdinalIgnoreCase) == 0)
            {
                binding = new ManualScriptBinding(context);
            }

            return binding != null;
        }