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
- TraceFilter.cs
- DeferredElementTreeState.cs
- AssemblySettingAttributes.cs
- TemplateColumn.cs
- DiscoveryExceptionDictionary.cs
- JsonQNameDataContract.cs
- CoreSwitches.cs
- IgnoreFlushAndCloseStream.cs
- GlobalItem.cs
- SchemaImporterExtension.cs
- recordstatefactory.cs
- MenuItem.cs
- SqlDataSourceDesigner.cs
- UriScheme.cs
- TypeLoadException.cs
- _SslSessionsCache.cs
- GC.cs
- EventProviderWriter.cs
- MdiWindowListItemConverter.cs
- WindowsContainer.cs
- OAVariantLib.cs
- ValidationEventArgs.cs
- validation.cs
- SendMailErrorEventArgs.cs
- InstanceContext.cs
- ElementHostAutomationPeer.cs
- UIElementCollection.cs
- FixedSOMPageConstructor.cs
- XslCompiledTransform.cs
- WorkflowViewStateService.cs
- PropertyItemInternal.cs
- StaticContext.cs
- DispatcherObject.cs
- ExceptionHelpers.cs
- CorrelationValidator.cs
- DBConcurrencyException.cs
- MarkupExtensionParser.cs
- DummyDataSource.cs
- TypeReference.cs
- ObjectCache.cs
- FileRegion.cs
- OdbcConnection.cs
- infer.cs
- DiffuseMaterial.cs
- MetadataCache.cs
- CaseStatement.cs
- SQLBytesStorage.cs
- CrossSiteScriptingValidation.cs
- WebServiceErrorEvent.cs
- ArrayExtension.cs
- BaseParser.cs
- RC2.cs
- PropVariant.cs
- ConfigurationLocationCollection.cs
- ControlPaint.cs
- HtmlGenericControl.cs
- SafeCoTaskMem.cs
- odbcmetadatafactory.cs
- LayoutEvent.cs
- SplitContainer.cs
- EventLogConfiguration.cs
- BufferedOutputStream.cs
- WebMessageFormatHelper.cs
- ModuleBuilder.cs
- WorkflowIdleBehavior.cs
- InheritanceContextChangedEventManager.cs
- XmlSerializer.cs
- TextLineBreak.cs
- ColumnResult.cs
- SpeechAudioFormatInfo.cs
- DataBindingCollection.cs
- StringHandle.cs
- DbBuffer.cs
- VisualState.cs
- DoubleLinkList.cs
- EntitySqlQueryBuilder.cs
- DataTable.cs
- SqlUtil.cs
- ReadWriteSpinLock.cs
- LowerCaseStringConverter.cs
- Control.cs
- ItemDragEvent.cs
- DbConnectionPoolIdentity.cs
- PersonalizationDictionary.cs
- ConfigXmlAttribute.cs
- FixedHyperLink.cs
- Application.cs
- NoPersistHandle.cs
- DataExpression.cs
- SqlTransaction.cs
- Parser.cs
- DbProviderServices.cs
- TimeSpanStorage.cs
- Size3DConverter.cs
- Misc.cs
- X509ThumbprintKeyIdentifierClause.cs
- WorkflowOperationInvoker.cs
- MoveSizeWinEventHandler.cs
- DbConnectionFactory.cs
- MenuItemStyle.cs