Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- WindowsStatic.cs
- SweepDirectionValidation.cs
- TextContainerChangeEventArgs.cs
- ColumnWidthChangedEvent.cs
- XmlHierarchicalEnumerable.cs
- OleDbRowUpdatingEvent.cs
- ValidatorCompatibilityHelper.cs
- AdRotator.cs
- ContainerActivationHelper.cs
- ItemCollectionEditor.cs
- EditorPart.cs
- RegexCapture.cs
- PerformanceCounterPermissionEntry.cs
- UidPropertyAttribute.cs
- FileUtil.cs
- HtmlInputHidden.cs
- TypeUtil.cs
- DefaultBinder.cs
- ToolStripItemClickedEventArgs.cs
- FixedSOMContainer.cs
- CheckBoxStandardAdapter.cs
- GlyphRun.cs
- TableLayoutPanel.cs
- ISAPIRuntime.cs
- HwndHostAutomationPeer.cs
- SwitchLevelAttribute.cs
- ExpressionBuilder.cs
- RefType.cs
- ResourceDescriptionAttribute.cs
- SafeTimerHandle.cs
- FontStretches.cs
- TabControlToolboxItem.cs
- Memoizer.cs
- TextMetrics.cs
- DbParameterCollectionHelper.cs
- ResumeStoryboard.cs
- AccessedThroughPropertyAttribute.cs
- DesignerAttribute.cs
- _NetworkingPerfCounters.cs
- BindingCompleteEventArgs.cs
- PauseStoryboard.cs
- ConstNode.cs
- newinstructionaction.cs
- QilBinary.cs
- BooleanAnimationBase.cs
- SyndicationDeserializer.cs
- UIElementAutomationPeer.cs
- TargetConverter.cs
- TTSEvent.cs
- ScriptingProfileServiceSection.cs
- ListBoxAutomationPeer.cs
- GridViewSortEventArgs.cs
- ThumbAutomationPeer.cs
- UserPersonalizationStateInfo.cs
- TypeResolvingOptions.cs
- WindowsHyperlink.cs
- ListQueryResults.cs
- TabControl.cs
- EventLogEntryCollection.cs
- __TransparentProxy.cs
- LineServicesRun.cs
- TimelineClockCollection.cs
- SchemaTypeEmitter.cs
- ListViewDataItem.cs
- InvalidProgramException.cs
- WebScriptEndpointElement.cs
- SrgsElementList.cs
- PassportAuthentication.cs
- ActivationServices.cs
- DependencyPropertyKey.cs
- SafeHandle.cs
- behaviorssection.cs
- ContentDisposition.cs
- MetadataPropertyAttribute.cs
- VerticalAlignConverter.cs
- DataSpaceManager.cs
- ObjectIDGenerator.cs
- MatrixValueSerializer.cs
- SqlInternalConnectionTds.cs
- AppManager.cs
- SemaphoreSecurity.cs
- KeyGestureValueSerializer.cs
- RectConverter.cs
- GrammarBuilderPhrase.cs
- ModelTreeEnumerator.cs
- ITreeGenerator.cs
- Double.cs
- PrintDocument.cs
- BitmapData.cs
- IgnoreDeviceFilterElement.cs
- Vector3DIndependentAnimationStorage.cs
- StringPropertyBuilder.cs
- ValueUtilsSmi.cs
- MasterPageCodeDomTreeGenerator.cs
- ListControl.cs
- MenuItemStyleCollection.cs
- ImageFormat.cs
- IndicCharClassifier.cs
- FontUnit.cs
- CodeLabeledStatement.cs