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
- ManifestResourceInfo.cs
- SmiSettersStream.cs
- CryptoStream.cs
- RectAnimationClockResource.cs
- ProfileProvider.cs
- newinstructionaction.cs
- DataRecordInternal.cs
- hresults.cs
- ImageListUtils.cs
- PageFunction.cs
- EpmContentDeSerializer.cs
- StyleReferenceConverter.cs
- QilChoice.cs
- PrivilegedConfigurationManager.cs
- SmiSettersStream.cs
- EpmHelper.cs
- XmlParserContext.cs
- AutomationAttributeInfo.cs
- AsyncMethodInvoker.cs
- NativeMethods.cs
- ICollection.cs
- XmlTextReaderImpl.cs
- MetadataPropertyvalue.cs
- UserControlAutomationPeer.cs
- SelectedDatesCollection.cs
- ComponentEditorPage.cs
- BinHexEncoder.cs
- GlyphElement.cs
- TextParagraphView.cs
- BuildProvidersCompiler.cs
- PrePrepareMethodAttribute.cs
- SByte.cs
- DetailsViewPageEventArgs.cs
- ConfigurationElementCollection.cs
- ResourceCategoryAttribute.cs
- InvalidCastException.cs
- XmlFormatReaderGenerator.cs
- XamlBuildTaskServices.cs
- ProcessInfo.cs
- sqlmetadatafactory.cs
- BridgeDataRecord.cs
- CodeMemberEvent.cs
- TabControl.cs
- StateDesigner.cs
- ColumnTypeConverter.cs
- DefaultTraceListener.cs
- ConfigurationManagerInternal.cs
- odbcmetadatafactory.cs
- DbConnectionPoolCounters.cs
- TraceSwitch.cs
- LZCodec.cs
- BrowserCapabilitiesFactory.cs
- DiagnosticTraceSource.cs
- basevalidator.cs
- ScrollChrome.cs
- HoistedLocals.cs
- CultureInfoConverter.cs
- UIElement.cs
- TimeoutStream.cs
- HandlerMappingMemo.cs
- BindableAttribute.cs
- Helper.cs
- EdmEntityTypeAttribute.cs
- RubberbandSelector.cs
- SlotInfo.cs
- SecurityKeyIdentifierClause.cs
- MethodBuilderInstantiation.cs
- PrePostDescendentsWalker.cs
- EditableRegion.cs
- ErrorFormatter.cs
- Graph.cs
- XmlBoundElement.cs
- ZoneIdentityPermission.cs
- JapaneseLunisolarCalendar.cs
- ToolStripSeparator.cs
- AutomationPatternInfo.cs
- Int32AnimationBase.cs
- StringValueSerializer.cs
- MetaModel.cs
- ApplicationId.cs
- Pointer.cs
- Base64Encoder.cs
- MenuEventArgs.cs
- StyleSheetDesigner.cs
- ParallelEnumerable.cs
- BrowserCapabilitiesFactoryBase.cs
- HeaderFilter.cs
- StretchValidation.cs
- TdsValueSetter.cs
- Hash.cs
- AppDomainProtocolHandler.cs
- InputLanguageSource.cs
- WebChannelFactory.cs
- SpeakProgressEventArgs.cs
- ListViewUpdateEventArgs.cs
- ClaimSet.cs
- EncodingDataItem.cs
- TextRangeEdit.cs
- TypeViewSchema.cs
- DataContractSerializer.cs