Ejemplo n.º 1
0
        /// <summary>
        /// Create a new instance of <seealso cref="AutoReferenceFilesCompilerStep"/>
        /// </summary>
        /// <param name="baseDirectory">The base directory to resolve files from</param>
        /// <param name="urlResolver">The url resolver to use</param>
        public AutoReferenceFilesCompilerStep(string baseDirectory, UrlResolverDelegate urlResolver)
        {
            if (urlResolver == null)
            {
                throw new ArgumentNullException("urlResolver");
            }

            this.baseDirectory = baseDirectory;
            this.urlResolver   = urlResolver;
        }
Ejemplo n.º 2
0
 protected override IServiceClient CreateClient(string baseUrl, UrlResolverDelegate urlResolver = null,
                                                TypedUrlResolverDelegate typedUrlResolver       = null)
 {
     return(new JsonHttpClient(baseUrl)
     {
         UrlResolver = urlResolver,
         TypedUrlResolver = typedUrlResolver,
         ResultsFilter = (type, method, uri, request) =>
                         new MockResponse {
             Url = uri
         }
     });
 }
Ejemplo n.º 3
0
        public static AbstractConfigurationRunner GetConfigurationInstanceFromStream(
            string name, string environment, IWindsorContainer container, Stream stream,
            GenerationOptions generationOptions, params string[] namespaces)
        {
            UrlResolverDelegate urlResolver = CreateWindorUrlResolver(container);

            using (StreamReader reader = new StreamReader(stream))
            {
                return(GetConfigurationInstance(
                           name, environment, new ReaderInput(name, reader),
                           generationOptions, new AutoReferenceFilesCompilerStep(urlResolver),
                           namespaces));
            }
        }
Ejemplo n.º 4
0
        public static AbstractConfigurationRunner GetConfigurationInstanceFromResource(
            string name, string environment, IWindsorContainer container, CustomUri uri,
            GenerationOptions generationOptions, params string[] namespaces)
        {
            IResourceSubSystem system =
                (IResourceSubSystem)container.Kernel.GetSubSystem(SubSystemConstants.ResourceKey);
            IResource           resource      = system.CreateResource(uri);
            string              baseDirectory = Path.GetDirectoryName(uri.Path);
            UrlResolverDelegate urlResolver   = CreateWindorUrlResolver(container);

            return(GetConfigurationInstance(
                       name, environment, new ReaderInput(name, resource.GetStreamReader()),
                       generationOptions, new AutoReferenceFilesCompilerStep(baseDirectory, urlResolver),
                       namespaces));
        }
Ejemplo n.º 5
0
        public static AbstractConfigurationRunner GetConfigurationInstanceFromFile(
            string fileName, string environment, IWindsorContainer container,
            GenerationOptions generationOptions, params string[] namespaces)
        {
            string baseDirectory            = Path.GetDirectoryName(fileName);
            UrlResolverDelegate urlResolver = CreateWindorUrlResolver(container);

            using (TextReader reader = urlResolver(fileName, null))
            {
                return(GetConfigurationInstance(
                           Path.GetFileNameWithoutExtension(fileName), environment,
                           new ReaderInput(Path.GetFileNameWithoutExtension(fileName), reader),
                           generationOptions,
                           new AutoReferenceFilesCompilerStep(baseDirectory, urlResolver),
                           namespaces));
            }
        }
Ejemplo n.º 6
0
 protected abstract IServiceClient CreateClient(string baseUrl,
                                                UrlResolverDelegate urlResolver = null, TypedUrlResolverDelegate typedUrlResolver = null);
 /// <summary>
 /// Create a new instance of <seealso cref="AutoReferenceFilesCompilerStep"/>
 /// </summary>
 /// <param name="urlResolver">The url resolver to use</param>
 public AutoReferenceFilesCompilerStep(UrlResolverDelegate urlResolver)
     : this(null, urlResolver)
 {
 }
        /// <summary>
        /// Create a new instance of <seealso cref="AutoReferenceFilesCompilerStep"/>
        /// </summary>
        /// <param name="baseDirectory">The base directory to resolve files from</param>
        /// <param name="urlResolver">The url resolver to use</param>
        public AutoReferenceFilesCompilerStep(string baseDirectory, UrlResolverDelegate urlResolver)
        {
            if (urlResolver == null)
            {
                throw new ArgumentNullException("urlResolver");
            }

            this.baseDirectory = baseDirectory;
            this.urlResolver = urlResolver;
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Create a new instance of <seealso cref="AutoReferenceFilesCompilerStep"/>
 /// </summary>
 /// <param name="urlResolver">The url resolver to use</param>
 public AutoReferenceFilesCompilerStep(UrlResolverDelegate urlResolver)
     : this(null, urlResolver)
 {
 }