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
- CodeDomSerializer.cs
- _UriTypeConverter.cs
- _ConnectStream.cs
- BookmarkTable.cs
- WsatAdminException.cs
- FragmentNavigationEventArgs.cs
- StringConverter.cs
- GeneralTransform3D.cs
- FixedFlowMap.cs
- DbDeleteCommandTree.cs
- PersonalizationProviderHelper.cs
- PackagingUtilities.cs
- NavigationWindowAutomationPeer.cs
- TrackBar.cs
- Panel.cs
- WebPartVerb.cs
- TagPrefixCollection.cs
- SelectionProcessor.cs
- SynchronizedInputPattern.cs
- SQLBinary.cs
- InputReport.cs
- MetabaseServerConfig.cs
- DateTimeStorage.cs
- KeyNotFoundException.cs
- QueryReaderSettings.cs
- ApplicationManager.cs
- ExpandedWrapper.cs
- hresults.cs
- WebEncodingValidatorAttribute.cs
- VirtualizingPanel.cs
- TraceSource.cs
- SpecularMaterial.cs
- GroupQuery.cs
- VersionedStreamOwner.cs
- DataException.cs
- TextServicesDisplayAttributePropertyRanges.cs
- ProfileBuildProvider.cs
- FtpCachePolicyElement.cs
- NameSpaceExtractor.cs
- DataGridColumn.cs
- XmlSchemaObject.cs
- CustomValidator.cs
- precedingquery.cs
- HttpModulesSection.cs
- TypeForwardedFromAttribute.cs
- TabControlAutomationPeer.cs
- ResolveDuplexCD1AsyncResult.cs
- WeakReferenceList.cs
- DebugView.cs
- AssemblyUtil.cs
- DataObjectPastingEventArgs.cs
- MouseGesture.cs
- DataGridViewRowEventArgs.cs
- UrlPropertyAttribute.cs
- GradientStopCollection.cs
- PageContentAsyncResult.cs
- DataViewSettingCollection.cs
- Flowchart.cs
- HttpHostedTransportConfiguration.cs
- WindowsScrollBarBits.cs
- MetadataPropertyAttribute.cs
- DataGridTableCollection.cs
- TextFormatterContext.cs
- WebHttpDispatchOperationSelector.cs
- CodeGenerator.cs
- DBCSCodePageEncoding.cs
- MethodImplAttribute.cs
- WorkflowApplicationTerminatedException.cs
- DynamicResourceExtension.cs
- ListBox.cs
- NotCondition.cs
- ConstNode.cs
- CheckBoxFlatAdapter.cs
- SafeNativeMethods.cs
- DataExchangeServiceBinder.cs
- TransactionManager.cs
- X509SecurityTokenProvider.cs
- CompositionDesigner.cs
- Version.cs
- CategoryValueConverter.cs
- FormsAuthenticationTicket.cs
- SlipBehavior.cs
- RecognizerStateChangedEventArgs.cs
- GlyphRunDrawing.cs
- EventWaitHandleSecurity.cs
- AssertFilter.cs
- OleDbSchemaGuid.cs
- SqlDataSourceSelectingEventArgs.cs
- ListControlConvertEventArgs.cs
- SoapIncludeAttribute.cs
- FlowchartStart.xaml.cs
- SafeViewOfFileHandle.cs
- XamlFigureLengthSerializer.cs
- WorkflowNamespace.cs
- MemberDomainMap.cs
- SettingsPropertyValueCollection.cs
- WorkflowServiceAttributes.cs
- XmlMembersMapping.cs
- SHA1Managed.cs
- MultiBinding.cs