Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / XamlBuildTask / Microsoft / Build / Tasks / Xaml / CompilationPass2Task.cs / 1305376 / CompilationPass2Task.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace Microsoft.Build.Tasks.Xaml { using System; using System.Collections.Generic; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using System.Reflection; using System.Runtime; [Fx.Tag.XamlVisible(true)] public class CompilationPass2Task : Task { public CompilationPass2Task() { } [Fx.Tag.KnownXamlExternal] public ITaskItem[] ApplicationMarkup { get; set; } public string AssemblyName { get; set; } [Fx.Tag.KnownXamlExternal] public ITaskItem[] References { get; set; } public string LocalAssemblyReference { get; set; } public string RootNamespace { get; set; } public string BuildTaskPath { get; set; } public override bool Execute() { AppDomain appDomain = null; try { appDomain = XamlBuildTaskServices.CreateAppDomain("CompilationPass2AppDomain_" + Guid.NewGuid(), BuildTaskPath); CompilationPass2TaskInternal wrapper = (CompilationPass2TaskInternal)appDomain.CreateInstanceAndUnwrap( Assembly.GetExecutingAssembly().FullName, typeof(CompilationPass2TaskInternal).FullName); PopulateBuildArtifacts(wrapper); bool ret = wrapper.Execute(); if (!ret) { foreach (LogData logData in wrapper.LogData) { XamlBuildTaskServices.LogException( this, logData.Message, logData.FileName, logData.LineNumber, logData.LinePosition); } } return ret; } catch (Exception e) { if (Fx.IsFatal(e)) { throw; } XamlBuildTaskServices.LogException(this, e.Message); return false; } finally { if (appDomain != null) { AppDomain.Unload(appDomain); } } } void PopulateBuildArtifacts(CompilationPass2TaskInternal wrapper) { IListapplicationMarkup = new List (this.ApplicationMarkup.Length); foreach (ITaskItem taskItem in this.ApplicationMarkup) { applicationMarkup.Add(taskItem.ItemSpec); } wrapper.ApplicationMarkup = applicationMarkup; IList references = new List (this.References.Length); foreach (ITaskItem reference in this.References) { references.Add(reference.ItemSpec); } wrapper.References = references; wrapper.LocalAssemblyReference = this.LocalAssemblyReference; wrapper.AssemblyName = this.AssemblyName; wrapper.RootNamespace = this.RootNamespace; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace Microsoft.Build.Tasks.Xaml { using System; using System.Collections.Generic; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using System.Reflection; using System.Runtime; [Fx.Tag.XamlVisible(true)] public class CompilationPass2Task : Task { public CompilationPass2Task() { } [Fx.Tag.KnownXamlExternal] public ITaskItem[] ApplicationMarkup { get; set; } public string AssemblyName { get; set; } [Fx.Tag.KnownXamlExternal] public ITaskItem[] References { get; set; } public string LocalAssemblyReference { get; set; } public string RootNamespace { get; set; } public string BuildTaskPath { get; set; } public override bool Execute() { AppDomain appDomain = null; try { appDomain = XamlBuildTaskServices.CreateAppDomain("CompilationPass2AppDomain_" + Guid.NewGuid(), BuildTaskPath); CompilationPass2TaskInternal wrapper = (CompilationPass2TaskInternal)appDomain.CreateInstanceAndUnwrap( Assembly.GetExecutingAssembly().FullName, typeof(CompilationPass2TaskInternal).FullName); PopulateBuildArtifacts(wrapper); bool ret = wrapper.Execute(); if (!ret) { foreach (LogData logData in wrapper.LogData) { XamlBuildTaskServices.LogException( this, logData.Message, logData.FileName, logData.LineNumber, logData.LinePosition); } } return ret; } catch (Exception e) { if (Fx.IsFatal(e)) { throw; } XamlBuildTaskServices.LogException(this, e.Message); return false; } finally { if (appDomain != null) { AppDomain.Unload(appDomain); } } } void PopulateBuildArtifacts(CompilationPass2TaskInternal wrapper) { IList applicationMarkup = new List (this.ApplicationMarkup.Length); foreach (ITaskItem taskItem in this.ApplicationMarkup) { applicationMarkup.Add(taskItem.ItemSpec); } wrapper.ApplicationMarkup = applicationMarkup; IList references = new List (this.References.Length); foreach (ITaskItem reference in this.References) { references.Add(reference.ItemSpec); } wrapper.References = references; wrapper.LocalAssemblyReference = this.LocalAssemblyReference; wrapper.AssemblyName = this.AssemblyName; wrapper.RootNamespace = this.RootNamespace; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ParentUndoUnit.cs
- AtomicFile.cs
- GregorianCalendar.cs
- PeerMaintainer.cs
- ProtectedConfiguration.cs
- ProgressBarAutomationPeer.cs
- ClickablePoint.cs
- ResumeStoryboard.cs
- SimpleWorkerRequest.cs
- Options.cs
- ServiceParser.cs
- UIAgentAsyncParams.cs
- ToolStripSplitStackLayout.cs
- ApplicationHost.cs
- TextDecorations.cs
- CustomErrorsSectionWrapper.cs
- VectorCollectionConverter.cs
- Wildcard.cs
- SyndicationSerializer.cs
- WinOEToolBoxItem.cs
- XPathPatternBuilder.cs
- cryptoapiTransform.cs
- StringReader.cs
- CodeIdentifier.cs
- InputScopeManager.cs
- ToolStripContainer.cs
- ConfigXmlText.cs
- MatcherBuilder.cs
- ReadingWritingEntityEventArgs.cs
- MessageQueueInstaller.cs
- SqlClientWrapperSmiStream.cs
- TextParagraphProperties.cs
- SHA512CryptoServiceProvider.cs
- BinaryWriter.cs
- ListControlConvertEventArgs.cs
- RadioButton.cs
- ReachDocumentSequenceSerializerAsync.cs
- RequestQueue.cs
- ExpressionConverter.cs
- Marshal.cs
- recordstatescratchpad.cs
- SafeNativeMethods.cs
- LocalTransaction.cs
- DefaultHttpHandler.cs
- Focus.cs
- SmtpException.cs
- CellIdBoolean.cs
- PartialCachingControl.cs
- SqlParameterizer.cs
- SQLDateTime.cs
- XmlnsCache.cs
- FormViewRow.cs
- SettingsBindableAttribute.cs
- MenuScrollingVisibilityConverter.cs
- SiteMapNodeItem.cs
- XmlBinaryReader.cs
- EmissiveMaterial.cs
- WaveHeader.cs
- SystemDiagnosticsSection.cs
- ParallelTimeline.cs
- Ticks.cs
- PathGradientBrush.cs
- RemoteWebConfigurationHost.cs
- EndPoint.cs
- EncryptedXml.cs
- CodeAccessPermission.cs
- HwndHost.cs
- AlignmentXValidation.cs
- AsyncPostBackTrigger.cs
- IxmlLineInfo.cs
- CallbackTimeoutsBehavior.cs
- SimpleBitVector32.cs
- Avt.cs
- DataObjectFieldAttribute.cs
- BrushConverter.cs
- CodeCompiler.cs
- XmlFormatReaderGenerator.cs
- QueryStringParameter.cs
- DefaultBindingPropertyAttribute.cs
- Query.cs
- ItemCollection.cs
- SigningCredentials.cs
- RewritingValidator.cs
- Paragraph.cs
- ListItemCollection.cs
- ComplexObject.cs
- PropertySourceInfo.cs
- PlatformCulture.cs
- MarkerProperties.cs
- UnsafeNativeMethods.cs
- __ConsoleStream.cs
- HtmlImage.cs
- DownloadProgressEventArgs.cs
- HtmlImage.cs
- _IPv6Address.cs
- MediaPlayerState.cs
- ArrayTypeMismatchException.cs
- MultiView.cs
- SettingsPropertyIsReadOnlyException.cs
- CommandDevice.cs