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
- _RequestCacheProtocol.cs
- DependencyPropertyConverter.cs
- SHA512Managed.cs
- XmlEncoding.cs
- UserControl.cs
- HelpProvider.cs
- RoutedUICommand.cs
- OdbcInfoMessageEvent.cs
- SqlProcedureAttribute.cs
- Int16Animation.cs
- SQLMoneyStorage.cs
- UserCancellationException.cs
- HttpHandlerAction.cs
- CompiledAction.cs
- ModuleConfigurationInfo.cs
- MetadataItemEmitter.cs
- InvalidEnumArgumentException.cs
- RegionIterator.cs
- ReadOnlyTernaryTree.cs
- FileDialog.cs
- BaseParaClient.cs
- EventDescriptor.cs
- HttpRuntime.cs
- TypeLibraryHelper.cs
- PointKeyFrameCollection.cs
- CornerRadius.cs
- DataSourceCacheDurationConverter.cs
- UInt64Converter.cs
- Int64Storage.cs
- ServerValidateEventArgs.cs
- ChooseAction.cs
- GeneratedCodeAttribute.cs
- OleDbDataReader.cs
- ContainerParaClient.cs
- StorageMappingFragment.cs
- HttpHandlerActionCollection.cs
- HttpResponse.cs
- ItemCheckEvent.cs
- LocatorBase.cs
- RegexCharClass.cs
- COM2IProvidePropertyBuilderHandler.cs
- DataBinding.cs
- DataGridViewLinkCell.cs
- UTF8Encoding.cs
- OdbcRowUpdatingEvent.cs
- CreateParams.cs
- MarkupCompilePass2.cs
- WorkflowRuntime.cs
- GridViewItemAutomationPeer.cs
- MatrixValueSerializer.cs
- XmlTextWriter.cs
- WebAdminConfigurationHelper.cs
- TextSimpleMarkerProperties.cs
- CustomAttributeFormatException.cs
- ObjectDataSourceChooseMethodsPanel.cs
- _AutoWebProxyScriptHelper.cs
- JoinTreeSlot.cs
- Tool.cs
- ContentDisposition.cs
- ValueConversionAttribute.cs
- Dispatcher.cs
- MaskedTextProvider.cs
- DirectoryInfo.cs
- Attachment.cs
- DataGridItemAttachedStorage.cs
- WindowsTooltip.cs
- DataServiceConfiguration.cs
- PathGeometry.cs
- SqlUnionizer.cs
- WindowsSysHeader.cs
- PortCache.cs
- WebPartConnectionsCloseVerb.cs
- CollectionDataContractAttribute.cs
- LinqExpressionNormalizer.cs
- AsymmetricKeyExchangeDeformatter.cs
- sqlcontext.cs
- UserPreferenceChangedEventArgs.cs
- PropertyRecord.cs
- RemotingConfiguration.cs
- CompositeActivityDesigner.cs
- ShapeTypeface.cs
- SqlWriter.cs
- NamespaceMapping.cs
- ButtonRenderer.cs
- RecommendedAsConfigurableAttribute.cs
- DrawListViewItemEventArgs.cs
- Vector.cs
- ClientTargetSection.cs
- SafeEventLogWriteHandle.cs
- MarkupWriter.cs
- DataReaderContainer.cs
- DebugView.cs
- DependencyProperty.cs
- ButtonAutomationPeer.cs
- ZipIOExtraFieldElement.cs
- IssuedTokenClientBehaviorsElementCollection.cs
- Compress.cs
- ZipIOExtraFieldElement.cs
- SecurityElement.cs
- SafeFileMappingHandle.cs