void PopulateBuildArtifacts(PartialClassGenerationTaskInternal wrapper)
        {
            IList <ITaskItem> applicationMarkup = null;

            if (this.ApplicationMarkup != null)
            {
                applicationMarkup = this.ApplicationMarkup
                                    .Select(i => new DelegatingTaskItem(i) as ITaskItem).ToList();
            }
            wrapper.ApplicationMarkup = applicationMarkup;

            wrapper.BuildLogger = this.Log;

            wrapper.References = this.References
                                 .Select(i => new DelegatingTaskItem(i) as ITaskItem).ToList();

            IList <string> sourceCodeFiles = null;

            if (this.SourceCodeFiles != null)
            {
                sourceCodeFiles = new List <string>(this.SourceCodeFiles.Length);
                foreach (ITaskItem taskItem in this.SourceCodeFiles)
                {
                    sourceCodeFiles.Add(taskItem.ItemSpec);
                }
            }
            wrapper.SourceCodeFiles = sourceCodeFiles;

            wrapper.Language                     = this.Language;
            wrapper.AssemblyName                 = this.AssemblyName;
            wrapper.OutputPath                   = this.OutputPath;
            wrapper.RootNamespace                = this.RootNamespace;
            wrapper.GeneratedSourceExtension     = this.GeneratedSourceExtension;
            wrapper.IsInProcessXamlMarkupCompile = this.IsInProcessXamlMarkupCompile;
            wrapper.MSBuildProjectDirectory      = this.MSBuildProjectDirectory;
            wrapper.XamlBuildTaskTypeGenerationExtensionNames = XamlBuildTaskServices.GetXamlBuildTaskExtensionNames(this.XamlBuildTypeGenerationExtensionNames);
            if (this.XamlBuildTypeInspectionExtensionNames != null && this.XamlBuildTypeInspectionExtensionNames.Length > 0)
            {
                wrapper.MarkupCompilePass2ExtensionsPresent = true;
            }

            wrapper.SupportExtensions = this.supportExtensions;
        }
Пример #2
0
        void PopulateBuildArtifacts(CompilationPass2TaskInternal wrapper)
        {
            if (!this.supportExtensions)
            {
                IList <string> applicationMarkup = new List <string>(this.ApplicationMarkup.Length);
                foreach (ITaskItem taskItem in this.ApplicationMarkup)
                {
                    applicationMarkup.Add(taskItem.ItemSpec);
                }
                wrapper.ApplicationMarkup = applicationMarkup;
            }

            wrapper.SupportExtensions = this.supportExtensions;

            wrapper.BuildLogger = this.Log;

            wrapper.References = this.References
                                 .Select(i => new DelegatingTaskItem(i) as ITaskItem).ToList();

            wrapper.LocalAssemblyReference = this.LocalAssemblyReference;

            wrapper.AssemblyName = this.AssemblyName;

            wrapper.RootNamespace = this.RootNamespace;

            wrapper.Language = this.Language;

            wrapper.OutputPath = this.OutputPath;

            wrapper.IsInProcessXamlMarkupCompile = this.IsInProcessXamlMarkupCompile;

            wrapper.MSBuildProjectDirectory = this.MSBuildProjectDirectory;

            IList <string> sourceCodeFiles = null;

            if (this.SourceCodeFiles != null)
            {
                sourceCodeFiles = new List <string>(this.SourceCodeFiles.Length);
                foreach (ITaskItem taskItem in this.SourceCodeFiles)
                {
                    sourceCodeFiles.Add(taskItem.ItemSpec);
                }
            }
            wrapper.SourceCodeFiles = sourceCodeFiles;

            if (this.supportExtensions)
            {
                wrapper.XamlBuildTaskTypeInspectionExtensionNames = XamlBuildTaskServices.GetXamlBuildTaskExtensionNames(this.XamlBuildTypeInspectionExtensionNames);

                // Here we create a Dictionary of Type Full Name and corresponding TaskItem
                // This is passed to the extensions which enables them to look up
                // metadata about a type like file name.
                IDictionary <string, ITaskItem> applicationMarkupWithTypeName = null;
                if (this.ApplicationMarkupWithTypeName != null)
                {
                    applicationMarkupWithTypeName = new Dictionary <string, ITaskItem>();
                }
                foreach (ITaskItem taskItem in this.ApplicationMarkupWithTypeName)
                {
                    string typeName = taskItem.GetMetadata("typeName");
                    if (!String.IsNullOrWhiteSpace(typeName))
                    {
                        applicationMarkupWithTypeName.Add(typeName, new DelegatingTaskItem(taskItem));
                    }
                }
                wrapper.ApplicationMarkupWithTypeName = applicationMarkupWithTypeName;
            }
        }