Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntityDesign / Design / System / Data / Entity / Design / AspNet / BuildProviderUtils.cs / 1 / BuildProviderUtils.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; using System.CodeDom; using System.CodeDom.Compiler; using System.Globalization; using System.IO; using System.Resources; using System.Web; using System.Web.Hosting; using System.Web.Compilation; namespace System.Data.Entity.Design.AspNet { ////// A place to put common methods used by our build providers /// /// internal class BuildProviderUtils { ////// Default constructor /// private BuildProviderUtils() { } internal static void AddArtifactReference(AssemblyBuilder assemblyBuilder, BuildProvider prov, string virtualPath) { // add the artifact as a resource to the DLL using (Stream input = VirtualPathProvider.OpenFile(virtualPath)) { // derive the resource name string name = virtualPath.Replace("/", "."); if (name.StartsWith(".", StringComparison.Ordinal)) { name = name.Substring(1); } using (Stream resStream = assemblyBuilder.CreateEmbeddedResource(prov, name)) { int byteRead = input.ReadByte(); while (byteRead != -1) { resStream.WriteByte((byte)byteRead); byteRead = input.ReadByte(); } } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; using System.CodeDom; using System.CodeDom.Compiler; using System.Globalization; using System.IO; using System.Resources; using System.Web; using System.Web.Hosting; using System.Web.Compilation; namespace System.Data.Entity.Design.AspNet { ////// A place to put common methods used by our build providers /// /// internal class BuildProviderUtils { ////// Default constructor /// private BuildProviderUtils() { } internal static void AddArtifactReference(AssemblyBuilder assemblyBuilder, BuildProvider prov, string virtualPath) { // add the artifact as a resource to the DLL using (Stream input = VirtualPathProvider.OpenFile(virtualPath)) { // derive the resource name string name = virtualPath.Replace("/", "."); if (name.StartsWith(".", StringComparison.Ordinal)) { name = name.Substring(1); } using (Stream resStream = assemblyBuilder.CreateEmbeddedResource(prov, name)) { int byteRead = input.ReadByte(); while (byteRead != -1) { resStream.WriteByte((byte)byteRead); byteRead = input.ReadByte(); } } } } } } // 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
- FontFaceLayoutInfo.cs
- HtmlObjectListAdapter.cs
- ISO2022Encoding.cs
- DiscoveryMessageSequence11.cs
- ContentTypeSettingClientMessageFormatter.cs
- AssemblySettingAttributes.cs
- FixedSOMImage.cs
- FormsAuthenticationModule.cs
- PipeStream.cs
- UpdatableGenericsFeature.cs
- SafeBitVector32.cs
- ServiceCredentialsSecurityTokenManager.cs
- BaseComponentEditor.cs
- Set.cs
- UserNamePasswordValidator.cs
- StorageComplexTypeMapping.cs
- WebBrowser.cs
- MatrixValueSerializer.cs
- SpanIndex.cs
- PathStreamGeometryContext.cs
- SoapAttributes.cs
- SpecularMaterial.cs
- EventDescriptorCollection.cs
- ValidatorCollection.cs
- altserialization.cs
- XPathNavigator.cs
- EmissiveMaterial.cs
- ObjectStateManager.cs
- ObjectViewFactory.cs
- BaseValidator.cs
- IdentityNotMappedException.cs
- Keywords.cs
- WebPartConnectionsConfigureVerb.cs
- DataMisalignedException.cs
- ElementsClipboardData.cs
- COAUTHIDENTITY.cs
- DataConnectionHelper.cs
- OdbcInfoMessageEvent.cs
- ImmutableAssemblyCacheEntry.cs
- DispatcherHooks.cs
- RequestCachingSection.cs
- InstanceHandle.cs
- XmlSchemaException.cs
- columnmapkeybuilder.cs
- WebSysDisplayNameAttribute.cs
- DropShadowEffect.cs
- SiteMapSection.cs
- Tile.cs
- TraceSection.cs
- GiveFeedbackEvent.cs
- XmlSerializerNamespaces.cs
- XComponentModel.cs
- SmtpSection.cs
- RoutingSection.cs
- CheckBoxAutomationPeer.cs
- RawKeyboardInputReport.cs
- WasNotInstalledException.cs
- SectionUpdates.cs
- DaylightTime.cs
- tooltip.cs
- RoleServiceManager.cs
- ZoneButton.cs
- WmlSelectionListAdapter.cs
- XPathSelfQuery.cs
- FormatSettings.cs
- TransactionFlowBindingElementImporter.cs
- MarshalByValueComponent.cs
- MimeTypeMapper.cs
- BindingExpression.cs
- GlyphRunDrawing.cs
- AttachmentService.cs
- ISFTagAndGuidCache.cs
- CornerRadiusConverter.cs
- ObjectAssociationEndMapping.cs
- AddInDeploymentState.cs
- ArrayConverter.cs
- FixedDocument.cs
- CustomCredentialPolicy.cs
- PageHandlerFactory.cs
- TextStore.cs
- TableRow.cs
- FastEncoder.cs
- PartialArray.cs
- InstanceLockQueryResult.cs
- OutputWindow.cs
- DPAPIProtectedConfigurationProvider.cs
- DependencyProperty.cs
- SqlNotificationEventArgs.cs
- ReferencedType.cs
- DefaultEventAttribute.cs
- InstanceNameConverter.cs
- StreamGeometryContext.cs
- DataGridHeaderBorder.cs
- OleDbRowUpdatedEvent.cs
- TypeExtensions.cs
- ChangeDirector.cs
- WindowsListView.cs
- WizardStepBase.cs
- TreeNodeBindingCollection.cs
- TemplateAction.cs