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
- WebBrowserNavigatedEventHandler.cs
- HttpModulesSection.cs
- IsolatedStorageException.cs
- SupportsEventValidationAttribute.cs
- PropertiesTab.cs
- SqlMultiplexer.cs
- ValidationRuleCollection.cs
- ResourceReader.cs
- StringPropertyBuilder.cs
- PerformanceCounterLib.cs
- DialogWindow.cs
- LogStream.cs
- XmlEncodedRawTextWriter.cs
- HttpHandlersSection.cs
- Visitor.cs
- dbdatarecord.cs
- BitmapSource.cs
- ModuleConfigurationInfo.cs
- SmiRequestExecutor.cs
- BrowserInteropHelper.cs
- SecurityContextSecurityToken.cs
- TypeConverterValueSerializer.cs
- DynamicEndpoint.cs
- SqlLiftWhereClauses.cs
- XmlSchemaSimpleContent.cs
- OpCellTreeNode.cs
- PackageRelationshipSelector.cs
- UrlAuthFailureHandler.cs
- SHA1.cs
- CookieParameter.cs
- RsaSecurityTokenAuthenticator.cs
- EndEvent.cs
- StrongName.cs
- OdbcTransaction.cs
- HttpPostClientProtocol.cs
- TCPListener.cs
- Parameter.cs
- InputLanguageProfileNotifySink.cs
- DbgUtil.cs
- RbTree.cs
- PerformanceCounterLib.cs
- TrustManager.cs
- ThreadExceptionEvent.cs
- XmlRawWriter.cs
- DataMisalignedException.cs
- ConfigurationProperty.cs
- __FastResourceComparer.cs
- Rotation3DAnimation.cs
- QueryCursorEventArgs.cs
- DynamicActivityXamlReader.cs
- StorageAssociationSetMapping.cs
- WebConfigurationFileMap.cs
- WebPartCatalogAddVerb.cs
- CodeArrayIndexerExpression.cs
- XmlCharacterData.cs
- ApplicationServiceHelper.cs
- RadioButtonRenderer.cs
- DesignerHelpers.cs
- DataGridState.cs
- StopStoryboard.cs
- DoubleLinkList.cs
- DetailsViewDeleteEventArgs.cs
- PersonalizablePropertyEntry.cs
- ExpandedWrapper.cs
- TreeView.cs
- CanonicalFontFamilyReference.cs
- ComPlusTypeLoader.cs
- TransformedBitmap.cs
- GridViewPageEventArgs.cs
- ZoneLinkButton.cs
- ScrollChrome.cs
- VectorValueSerializer.cs
- SecurityTokenParametersEnumerable.cs
- ThicknessAnimation.cs
- DebugManager.cs
- UIElementHelper.cs
- AppDomainManager.cs
- InputMethodStateChangeEventArgs.cs
- GacUtil.cs
- CopyNodeSetAction.cs
- Parser.cs
- BoundPropertyEntry.cs
- ControlPaint.cs
- XmlSchemaComplexContentRestriction.cs
- DesignerVerb.cs
- XPathNodeIterator.cs
- DataGridColumn.cs
- HyperlinkAutomationPeer.cs
- KeyInterop.cs
- XmlSchemaFacet.cs
- MimeFormReflector.cs
- XmlDictionaryWriter.cs
- DefaultTextStoreTextComposition.cs
- DiscriminatorMap.cs
- BaseComponentEditor.cs
- WindowsToolbarAsMenu.cs
- Propagator.cs
- SmtpClient.cs
- MD5.cs
- Rect3DValueSerializer.cs