Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Core / CSharp / MS / Internal / Resources / ContentFileHelper.cs / 1 / ContentFileHelper.cs
// Copyright (c) Microsoft Corporation, 2001
//
// File: ContentFileHelper.cs
//
//------------------------------------------------------------------------------
using System;
using System.Reflection;
using System.Windows.Resources;
using System.Windows.Navigation;
using System.Collections.Generic;
namespace MS.Internal.Resources
{
//
// ContentFileHelper class provides helper method to get assembly
// associated content files.
//
internal static class ContentFileHelper
{
internal static bool IsContentFile(string partName)
{
if (_contentFiles == null)
{
_contentFiles = GetContentFiles(BaseUriHelper.ResourceAssembly);
}
if (_contentFiles != null && _contentFiles.Count > 0)
{
if (_contentFiles.ContainsKey(partName))
{
return true;
}
}
return false;
}
//
// Get a list of Content Files for a given Assembly.
//
static internal Dictionary GetContentFiles(Assembly asm)
{
Dictionary contentFiles = null;
Attribute[] assemblyAttributes;
if (asm == null)
{
asm = BaseUriHelper.ResourceAssembly;
if (asm == null)
{
// If we have no entry assembly return an empty list because
// we can't have any content files.
return new Dictionary();
}
}
assemblyAttributes = Attribute.GetCustomAttributes(
asm,
typeof(AssemblyAssociatedContentFileAttribute));
if (assemblyAttributes != null && assemblyAttributes.Length > 0)
{
contentFiles = new Dictionary(assemblyAttributes.Length, StringComparer.OrdinalIgnoreCase);
for (int i=0; i _contentFiles;
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation, 2001
//
// File: ContentFileHelper.cs
//
//------------------------------------------------------------------------------
using System;
using System.Reflection;
using System.Windows.Resources;
using System.Windows.Navigation;
using System.Collections.Generic;
namespace MS.Internal.Resources
{
//
// ContentFileHelper class provides helper method to get assembly
// associated content files.
//
internal static class ContentFileHelper
{
internal static bool IsContentFile(string partName)
{
if (_contentFiles == null)
{
_contentFiles = GetContentFiles(BaseUriHelper.ResourceAssembly);
}
if (_contentFiles != null && _contentFiles.Count > 0)
{
if (_contentFiles.ContainsKey(partName))
{
return true;
}
}
return false;
}
//
// Get a list of Content Files for a given Assembly.
//
static internal Dictionary GetContentFiles(Assembly asm)
{
Dictionary contentFiles = null;
Attribute[] assemblyAttributes;
if (asm == null)
{
asm = BaseUriHelper.ResourceAssembly;
if (asm == null)
{
// If we have no entry assembly return an empty list because
// we can't have any content files.
return new Dictionary();
}
}
assemblyAttributes = Attribute.GetCustomAttributes(
asm,
typeof(AssemblyAssociatedContentFileAttribute));
if (assemblyAttributes != null && assemblyAttributes.Length > 0)
{
contentFiles = new Dictionary(assemblyAttributes.Length, StringComparer.OrdinalIgnoreCase);
for (int i=0; i _contentFiles;
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ValidatingReaderNodeData.cs
- RichTextBox.cs
- DockPattern.cs
- _LazyAsyncResult.cs
- LeftCellWrapper.cs
- EncryptedXml.cs
- ContentFilePart.cs
- PrintPreviewGraphics.cs
- DispatcherOperation.cs
- PathFigureCollectionConverter.cs
- XmlElementCollection.cs
- XpsImageSerializationService.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- SharedStatics.cs
- ButtonAutomationPeer.cs
- CapabilitiesSection.cs
- LinqDataSourceInsertEventArgs.cs
- ZipFileInfo.cs
- ReplacementText.cs
- JumpItem.cs
- EtwTrace.cs
- IntegrationExceptionEventArgs.cs
- ContractReference.cs
- HttpResponseInternalBase.cs
- DataServiceHost.cs
- GenericEnumerator.cs
- ValidatorCollection.cs
- WFItemsToSpacerVisibility.cs
- BookmarkScope.cs
- _BaseOverlappedAsyncResult.cs
- WebPartConnectionsCloseVerb.cs
- TextRange.cs
- SafeArrayTypeMismatchException.cs
- DynamicResourceExtension.cs
- ContentValidator.cs
- UnsafeNativeMethodsMilCoreApi.cs
- PointConverter.cs
- WebReferencesBuildProvider.cs
- MessageDecoder.cs
- BooleanConverter.cs
- DiscoveryReferences.cs
- XmlNodeChangedEventManager.cs
- IntSecurity.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- UserPersonalizationStateInfo.cs
- NamedPipeTransportSecurityElement.cs
- CodeArrayIndexerExpression.cs
- DrawingDrawingContext.cs
- XsdBuilder.cs
- Variant.cs
- TemplateParser.cs
- RSAPKCS1SignatureDeformatter.cs
- OleDbConnectionFactory.cs
- EntityDataSourceView.cs
- SchemaNotation.cs
- IsolatedStorageFilePermission.cs
- TypeUtil.cs
- QilPatternVisitor.cs
- SafeNativeMethods.cs
- ConfigurationSectionGroupCollection.cs
- NavigatorInput.cs
- Gdiplus.cs
- WebPartsPersonalization.cs
- StateFinalizationActivity.cs
- ProcessStartInfo.cs
- basevalidator.cs
- XmlSchemaAnnotated.cs
- FormViewInsertEventArgs.cs
- SafeHandles.cs
- RSATokenProvider.cs
- MobileControlPersister.cs
- SessionStateModule.cs
- Exceptions.cs
- XmlWriter.cs
- ProviderMetadataCachedInformation.cs
- DescendantBaseQuery.cs
- ExternalCalls.cs
- ConstantExpression.cs
- TableLayout.cs
- AuthenticodeSignatureInformation.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- SoapSchemaExporter.cs
- TextCharacters.cs
- Models.cs
- MonitoringDescriptionAttribute.cs
- RIPEMD160.cs
- GZipDecoder.cs
- TimeSpanStorage.cs
- UnhandledExceptionEventArgs.cs
- ExpressionTextBox.xaml.cs
- DateTimeParse.cs
- SendActivityValidator.cs
- DeclaredTypeElement.cs
- InternalTypeHelper.cs
- CatalogPart.cs
- ListViewDesigner.cs
- ListViewGroupItemCollection.cs
- RefType.cs
- AddressUtility.cs
- BitmapEffectGroup.cs