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
- CustomMenuItemCollection.cs
- PermissionSet.cs
- AdapterDictionary.cs
- CursorConverter.cs
- DesigntimeLicenseContextSerializer.cs
- ListMarkerLine.cs
- CryptoApi.cs
- TraceProvider.cs
- LinqDataSourceHelper.cs
- EventlogProvider.cs
- StateDesigner.Layouts.cs
- VSWCFServiceContractGenerator.cs
- ReadOnlyDataSource.cs
- SystemIPInterfaceStatistics.cs
- ResourceIDHelper.cs
- TypeUsage.cs
- StorageComplexPropertyMapping.cs
- ScalarOps.cs
- XhtmlConformanceSection.cs
- ObjectManager.cs
- RowParagraph.cs
- _BasicClient.cs
- InitializingNewItemEventArgs.cs
- ADMembershipUser.cs
- Stack.cs
- X509Utils.cs
- DoubleCollection.cs
- BamlRecordHelper.cs
- JsonClassDataContract.cs
- ErrorFormatter.cs
- InternalConfigConfigurationFactory.cs
- MenuItem.cs
- dsa.cs
- TileModeValidation.cs
- PersonalizationProviderHelper.cs
- PartialCachingControl.cs
- EventMap.cs
- DataSourceXmlAttributeAttribute.cs
- WinInet.cs
- NameValuePermission.cs
- HtmlInputImage.cs
- BasicSecurityProfileVersion.cs
- WindowsToolbarAsMenu.cs
- OrderedEnumerableRowCollection.cs
- CaseExpr.cs
- _NegotiateClient.cs
- Int32AnimationUsingKeyFrames.cs
- OperationGenerator.cs
- ColorConvertedBitmap.cs
- TextServicesProperty.cs
- TypeBrowser.xaml.cs
- WebEncodingValidator.cs
- InputManager.cs
- PermissionSet.cs
- cache.cs
- DataGridViewToolTip.cs
- DirectoryObjectSecurity.cs
- ColorMap.cs
- BookmarkList.cs
- ThrowHelper.cs
- StringHandle.cs
- DecoderReplacementFallback.cs
- errorpatternmatcher.cs
- ColorMap.cs
- DescriptionAttribute.cs
- DbDeleteCommandTree.cs
- ReadOnlyDictionary.cs
- XmlSchemaExporter.cs
- GridItemPatternIdentifiers.cs
- TaiwanCalendar.cs
- XmlObjectSerializerReadContext.cs
- SymbolTable.cs
- DataGridViewHitTestInfo.cs
- OleDbEnumerator.cs
- WsdlBuildProvider.cs
- DynamicValidatorEventArgs.cs
- CqlBlock.cs
- UnionExpr.cs
- FontConverter.cs
- InputBuffer.cs
- _TLSstream.cs
- BoundColumn.cs
- ConnectionStringsSection.cs
- Popup.cs
- RowsCopiedEventArgs.cs
- EventArgs.cs
- RunInstallerAttribute.cs
- WebPartMenu.cs
- SizeFConverter.cs
- TransactionContextManager.cs
- LinkLabel.cs
- PrintController.cs
- PrintPreviewGraphics.cs
- XdrBuilder.cs
- Parser.cs
- EmulateRecognizeCompletedEventArgs.cs
- CodePageUtils.cs
- EntityContainerEntitySet.cs
- XmlSchemaSimpleContentExtension.cs
- WrapPanel.cs