Ejemplo n.º 1
0
        private StrategyScopeLocatorLayerExecutionUnit CreateExecutionUnitForLayerFindAttribute(FindAttribute findAttribute, SearchOptions desiredSearchOptions)
        {
            object strategy = findAttribute.CreateStrategy();

            // TODO: Set Timeout and RetryInterval too.
            SearchOptions searchOptions = new SearchOptions
            {
                IsSafely   = desiredSearchOptions.IsSafely,
                Visibility = findAttribute.Visibility
            };

            ComponentScopeLocateOptions scopeLocateOptions   = ComponentScopeLocateOptions.Create(component, findAttribute.Properties.Metadata, findAttribute);
            ILayerScopeContextResolver  scopeContextResolver = LayerScopeContextResolverFactory.Create(findAttribute.As);

            return(new StrategyScopeLocatorLayerExecutionUnit(strategy, scopeLocateOptions, searchOptions, scopeContextResolver));
        }
        private StrategyScopeLocatorLayerExecutionUnit CreateExecutionUnitForLayerFindAttribute(FindAttribute findAttribute, SearchOptions desiredSearchOptions)
        {
            object strategy = findAttribute.CreateStrategy();

            SearchOptions searchOptions = new SearchOptions
            {
                IsSafely      = desiredSearchOptions.IsSafely,
                Visibility    = findAttribute.Visibility,
                Timeout       = TimeSpan.FromSeconds(findAttribute.Timeout),
                RetryInterval = TimeSpan.FromSeconds(findAttribute.RetryInterval)
            };

            ComponentScopeLocateOptions scopeLocateOptions   = ComponentScopeLocateOptions.Create(_component, findAttribute.Properties.Metadata, findAttribute);
            ILayerScopeContextResolver  scopeContextResolver = LayerScopeContextResolverFactory.Create(findAttribute.As);

            return(new StrategyScopeLocatorLayerExecutionUnit(strategy, scopeLocateOptions, searchOptions, scopeContextResolver));
        }