Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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 DictionaryGetContentFiles(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 DictionaryGetContentFiles(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
- TextureBrush.cs
- PrimitiveXmlSerializers.cs
- BitmapFrameDecode.cs
- ListQueryResults.cs
- UnicodeEncoding.cs
- DetailsViewModeEventArgs.cs
- WebPartsPersonalizationAuthorization.cs
- SoapAttributeOverrides.cs
- PeerCollaboration.cs
- TabControlEvent.cs
- StorageBasedPackageProperties.cs
- FileInfo.cs
- SamlNameIdentifierClaimResource.cs
- AnnotationService.cs
- WindowsNonControl.cs
- CLRBindingWorker.cs
- SHA384Managed.cs
- XmlConvert.cs
- MetadataArtifactLoaderComposite.cs
- AnnotationResourceCollection.cs
- KeyInstance.cs
- EntityViewContainer.cs
- ToolBarTray.cs
- DateTimePicker.cs
- CollaborationHelperFunctions.cs
- DataGrid.cs
- Path.cs
- DbConnectionPoolOptions.cs
- DataRelationPropertyDescriptor.cs
- ScriptServiceAttribute.cs
- Literal.cs
- EventDescriptor.cs
- TiffBitmapEncoder.cs
- DocumentPaginator.cs
- _LocalDataStore.cs
- SID.cs
- InvalidWorkflowException.cs
- TableTextElementCollectionInternal.cs
- CurrentChangedEventManager.cs
- DataProtection.cs
- SrgsItemList.cs
- PersistChildrenAttribute.cs
- Int16AnimationUsingKeyFrames.cs
- SimpleMailWebEventProvider.cs
- TableParagraph.cs
- DocumentSequenceHighlightLayer.cs
- IRCollection.cs
- SHA256.cs
- RadioButtonPopupAdapter.cs
- DocumentViewerAutomationPeer.cs
- EmbeddedMailObjectsCollection.cs
- AnnotationResourceChangedEventArgs.cs
- LocalizationComments.cs
- WebPartAuthorizationEventArgs.cs
- Enum.cs
- SecurityState.cs
- FrameworkObject.cs
- CfgSemanticTag.cs
- InlineCollection.cs
- Span.cs
- ADConnectionHelper.cs
- WS2007HttpBinding.cs
- ExecutionContext.cs
- XmlAutoDetectWriter.cs
- PlanCompilerUtil.cs
- EntityDataSourceContextDisposingEventArgs.cs
- ExpandCollapsePattern.cs
- NavigationPropertyEmitter.cs
- XmlSchemaSet.cs
- XmlSchemaComplexContent.cs
- XmlUtil.cs
- Ops.cs
- XmlSchemaParticle.cs
- IUnknownConstantAttribute.cs
- _Events.cs
- ToolbarAUtomationPeer.cs
- DPTypeDescriptorContext.cs
- WindowsContainer.cs
- GeneralTransform2DTo3D.cs
- SizeF.cs
- InputLanguageSource.cs
- CssStyleCollection.cs
- InputLanguageEventArgs.cs
- DefaultProxySection.cs
- PriorityQueue.cs
- PbrsForward.cs
- TrackingLocationCollection.cs
- AmbientLight.cs
- DocumentCollection.cs
- ProbeMatchesCD1.cs
- AsymmetricSignatureDeformatter.cs
- SqlDataSource.cs
- ComplexPropertyEntry.cs
- AuthenticationConfig.cs
- SkinBuilder.cs
- XmlLanguageConverter.cs
- XmlReturnWriter.cs
- SharedStatics.cs
- DbBuffer.cs
- MemberMemberBinding.cs