Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of TypeProxyFactory.
        /// </summary>
        /// <param name="privateBinPath">A list of directories that are probed for private assemblies. Each directory should be separated by semicolon [;].</param>
        /// <param name="preloadAssemblyFilenames">A list of assembly filenames that will be loaded before the proxy is instantiated.</param>
        public TypeProxyFactory(string privateBinPath,
                                IEnumerable <string> preloadAssemblyFilenames)
        {
            var t                   = typeof(T);
            var typeName            = t.FullName;
            var assemblyFilename    = System.Reflection.Assembly.GetAssembly(t).Location;
            var applicationBasePath = System.IO.Path.GetDirectoryName(assemblyFilename);

            _Settings = new TypeProxySettings(typeName, assemblyFilename, preloadAssemblyFilenames, applicationBasePath, privateBinPath);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of TypeProxyFactory2.
 /// </summary>
 /// <param name="settings">The settings required to properly create and maintain the type in a separate <see cref="System.AppDomain"/>.</param>
 public TypeProxyFactory(TypeProxySettings settings) => _Settings = settings ?? throw new ArgumentNullException(nameof(settings));