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
- InvokerUtil.cs
- ProcessHostFactoryHelper.cs
- SamlSerializer.cs
- SourceLineInfo.cs
- Errors.cs
- PageParser.cs
- ScrollChrome.cs
- ImageMap.cs
- ConfigUtil.cs
- OdbcEnvironmentHandle.cs
- ServicePoint.cs
- VirtualizingStackPanel.cs
- EntityTemplateUserControl.cs
- SmiEventSink.cs
- WebPartTransformerCollection.cs
- GridViewHeaderRowPresenter.cs
- AssemblyFilter.cs
- UnsafeNativeMethods.cs
- PageRanges.cs
- ComboBoxRenderer.cs
- IPAddressCollection.cs
- WS2007HttpBindingCollectionElement.cs
- ConfigXmlCDataSection.cs
- MailAddressCollection.cs
- SQLDecimalStorage.cs
- AutoGeneratedFieldProperties.cs
- OrthographicCamera.cs
- TextDpi.cs
- BlobPersonalizationState.cs
- Typeface.cs
- EdmScalarPropertyAttribute.cs
- UniqueEventHelper.cs
- ToolStripItem.cs
- Graphics.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- RoleManagerSection.cs
- XmlSchemaComplexContentExtension.cs
- WorkflowOperationContext.cs
- WindowClosedEventArgs.cs
- PointCollection.cs
- SqlDataSourceCommandEventArgs.cs
- OutputCache.cs
- HeaderedItemsControl.cs
- ObjectStateManagerMetadata.cs
- CompositeCollection.cs
- ViewCellSlot.cs
- AppModelKnownContentFactory.cs
- ItemsControlAutomationPeer.cs
- RotateTransform3D.cs
- EditingCommands.cs
- NetworkInterface.cs
- ListControlConvertEventArgs.cs
- Line.cs
- DependencyPropertyHelper.cs
- unitconverter.cs
- WindowsSecurityTokenAuthenticator.cs
- LocalizedNameDescriptionPair.cs
- ControlsConfig.cs
- MultipleViewProviderWrapper.cs
- GlyphCache.cs
- AdapterUtil.cs
- CustomBinding.cs
- PersonalizationStateInfoCollection.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- XamlStream.cs
- MessageFormatterConverter.cs
- PermissionSet.cs
- WebConfigurationManager.cs
- DispatcherObject.cs
- SymmetricAlgorithm.cs
- ControlSerializer.cs
- DataGridViewColumnConverter.cs
- Timer.cs
- WindowInteropHelper.cs
- _ConnectStream.cs
- EntityCodeGenerator.cs
- LineUtil.cs
- WebPartHelpVerb.cs
- HostedBindingBehavior.cs
- VisualBasicDesignerHelper.cs
- TreePrinter.cs
- InvalidCastException.cs
- CategoryGridEntry.cs
- ReadContentAsBinaryHelper.cs
- ValidationHelper.cs
- ParserHooks.cs
- FileDialogCustomPlace.cs
- OpCopier.cs
- CannotUnloadAppDomainException.cs
- PeerEndPoint.cs
- FindCriteria11.cs
- TaiwanLunisolarCalendar.cs
- HijriCalendar.cs
- DocumentScope.cs
- MatrixTransform3D.cs
- VirtualPathUtility.cs
- TreeNodeConverter.cs
- SafePEFileHandle.cs
- HttpResponse.cs
- List.cs