Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / MS / Internal / Resources / ContentFileHelper.cs / 1305600 / 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
- WorkItem.cs
- OracleRowUpdatedEventArgs.cs
- SafeRightsManagementHandle.cs
- DataShape.cs
- SQLCharsStorage.cs
- CodeGroup.cs
- EntityContainerEntitySet.cs
- SystemIcmpV6Statistics.cs
- NumberFunctions.cs
- PropertiesTab.cs
- ExtenderProvidedPropertyAttribute.cs
- CrossSiteScriptingValidation.cs
- ComplexLine.cs
- CodeTypeDeclarationCollection.cs
- DataContractJsonSerializer.cs
- DbProviderFactories.cs
- BuildTopDownAttribute.cs
- ContextProperty.cs
- LassoHelper.cs
- Messages.cs
- TlsnegoTokenAuthenticator.cs
- PrivilegedConfigurationManager.cs
- RouteData.cs
- DodSequenceMerge.cs
- Point3DAnimationBase.cs
- ScrollableControl.cs
- KeyMatchBuilder.cs
- SystemInformation.cs
- CompiledQuery.cs
- HtmlTernaryTree.cs
- SymmetricCryptoHandle.cs
- RtType.cs
- ClearCollection.cs
- ColumnResult.cs
- WebConfigurationHost.cs
- StreamWriter.cs
- XmlAutoDetectWriter.cs
- FrameworkRichTextComposition.cs
- Encoder.cs
- DataGridColumnHeader.cs
- XmlSchemaResource.cs
- GenerateHelper.cs
- CompositeCollection.cs
- SqlAliaser.cs
- TiffBitmapEncoder.cs
- DbgUtil.cs
- EntityContainerEmitter.cs
- Schema.cs
- Cursor.cs
- ClosableStream.cs
- XmlnsDefinitionAttribute.cs
- ClipboardData.cs
- DataGridRelationshipRow.cs
- RepeaterCommandEventArgs.cs
- OleDbCommandBuilder.cs
- WeakKeyDictionary.cs
- PropertyCondition.cs
- RegionInfo.cs
- SrgsElement.cs
- ActivityStatusChangeEventArgs.cs
- ProtectedConfigurationSection.cs
- ByteStreamGeometryContext.cs
- SqlUDTStorage.cs
- Adorner.cs
- Control.cs
- UpdateProgress.cs
- RoutedUICommand.cs
- DateBoldEvent.cs
- HandledEventArgs.cs
- XNodeNavigator.cs
- Int32Animation.cs
- EntityViewGenerationConstants.cs
- VirtualPathUtility.cs
- DetailsViewPagerRow.cs
- AllMembershipCondition.cs
- WorkflowWebService.cs
- ProxyWebPartManagerDesigner.cs
- WasAdminWrapper.cs
- SqlCachedBuffer.cs
- HttpWriter.cs
- DiscoveryEndpointValidator.cs
- SafeLocalAllocation.cs
- VBCodeProvider.cs
- ParallelTimeline.cs
- BindingValueChangedEventArgs.cs
- FormViewRow.cs
- StackSpiller.Bindings.cs
- RepeaterItem.cs
- CodeDomLocalizationProvider.cs
- SqlRowUpdatingEvent.cs
- GridItem.cs
- MulticastNotSupportedException.cs
- ElapsedEventArgs.cs
- TransactionChannelListener.cs
- _SslStream.cs
- TextElementAutomationPeer.cs
- CodeGenerator.cs
- SafeBitVector32.cs
- SizeValueSerializer.cs
- DateTimeValueSerializerContext.cs