Exemple #1
0
        public bool TryGetChainedResource(string propertyName, ChildObjectScopeBinding bindingType, out IApiChildResourceHandler childHandler)
        {
            var retVal = this.m_propertyProviders.TryGetValue(propertyName, out childHandler) &&
                         childHandler.ScopeBinding.HasFlag(bindingType);

            if (!retVal)
            {
                childHandler = null;//clear in case of lazy programmers like me
            }
            return(retVal);
        }
 /// <inheritdoc/>
 public bool TryGetOperation(string propertyName, ChildObjectScopeBinding bindingType, out IApiChildOperation operationHandler)
 {
     if (this.m_operationHandlers.TryGetValue(propertyName, out operationHandler))
     {
         return(operationHandler.ScopeBinding.HasFlag(bindingType));
     }
     else
     {
         return(false);
     }
 }
        /// <summary>
        /// Try to get operation
        /// </summary>
        public bool TryGetOperation(string propertyName, ChildObjectScopeBinding bindingType, out IApiChildOperation operationHandler)
        {
            var retVal = this.m_operationProviders.TryGetValue(propertyName, out operationHandler) &&
                         operationHandler.ScopeBinding.HasFlag(bindingType);

            if (!retVal)
            {
                operationHandler = null;//clear in case of lazy programmers like me
            }
            return(retVal);
        }
Exemple #4
0
 /// <inheritdoc/>
 public bool TryGetOperation(string propertyName, ChildObjectScopeBinding bindingType, out IApiChildOperation operationHandler)
 {
     return(this.m_operations.TryGetValue(propertyName, out operationHandler));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ServiceResourceOptions"/> class
 /// with a specific resource name, and verbs.
 /// </summary>
 /// <param name="resourceName">The name of the resource of the service resource options.</param>
 /// <param name="operations">The list of HTTP verbs of the resource option.</param>
 /// <param name="resourceType">The type of resource which options are being fetched for</param>
 /// <param name="classification">The scope of the child oject (if it applies to class or instance)</param>
 /// <param name="scope">The scope of the child resource</param>
 public ChildServiceResourceOptions(string resourceName, Type resourceType, List <ServiceResourceCapability> operations, ChildObjectScopeBinding scope, ChildObjectClassification classification)
     : base(resourceName, resourceType, operations, null)
 {
     this.Scope          = scope;
     this.Classification = classification;
 }