Beispiel #1
0
            public ICSharpAssembly New(string name)
            {
                var result = new CSharpAssembly(name, this.Provider, this.Provider.IdentityManager.RuntimeEnvironment);

                this.Provider.IdentityManager.AssemblyCreated(result);
                return(result);
            }
Beispiel #2
0
        /// <summary>
        /// Creates a new <see cref="IIntermediateAssembly"/> with the <paramref name="name"/> and
        /// <paramref name="version"/> provided.
        /// </summary>
        /// <param name="name">The <see cref="String"/> value representing part of the identity of the assembly.</param>
        /// <param name="identityManager">The <see cref="IIntermediateCliManager"/> which is used to marshal type identities
        /// in the current type model.</param>
        /// <param name="version">The <see cref="CSharpLanguageVersion"/> to which the <see cref="ICSharpAssembly"/>
        /// is built against.</param>
        /// <returns>A new <see cref="ICSharpAssembly"/>
        /// with the <paramref name="name"/> and <paramref name="version"/> provided.</returns>
        /// <exception cref="System.ArgumentNullException">thrown when <paramref name="name"/> is null.</exception>
        /// <exception cref="System.ArgumentException">thrown when <paramref name="name"/> is <see cref="String.Empty"/>
        /// or <paramref name="version"/> is not one of <see cref="CSharpLanguageVersion"/>.</exception>
        public ICSharpAssembly CreateAssembly(string name, IIntermediateCliManager identityManager, CSharpLanguageVersion version)
        {
            var provider = this.GetProvider(version);
            IIntermediateAssemblyCtorLanguageService <ICSharpProvider, ICSharpLanguage, ICSharpAssembly> creatorService;

            if (provider.TryGetService <IIntermediateAssemblyCtorLanguageService <ICSharpProvider, ICSharpLanguage, ICSharpAssembly> >(LanguageGuids.Services.IntermediateAssemblyCreatorService, out creatorService))
            {
                return(creatorService.New(name));
            }
            var resultAssembly = new CSharpAssembly(name, provider, provider.IdentityManager.RuntimeEnvironment);

            provider.IdentityManager.AssemblyCreated(resultAssembly);
            return(resultAssembly);
        }