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
- HiddenField.cs
- AccessDataSource.cs
- ReaderWriterLockWrapper.cs
- ApplicationBuildProvider.cs
- InfoCardSymmetricAlgorithm.cs
- LogSwitch.cs
- IWorkflowDebuggerService.cs
- UInt64Storage.cs
- ObjectListTitleAttribute.cs
- GenericWebPart.cs
- InputManager.cs
- ConsoleTraceListener.cs
- IxmlLineInfo.cs
- DependencyObject.cs
- MissingSatelliteAssemblyException.cs
- ToolBarPanel.cs
- ExecutionContext.cs
- MsmqInputSessionChannelListener.cs
- CheckedPointers.cs
- TypeInitializationException.cs
- OuterGlowBitmapEffect.cs
- NonVisualControlAttribute.cs
- SymDocumentType.cs
- GifBitmapEncoder.cs
- SqlUserDefinedAggregateAttribute.cs
- SigningCredentials.cs
- ImageUrlEditor.cs
- XmlCDATASection.cs
- XmlAttributeOverrides.cs
- XmlSchemaProviderAttribute.cs
- AppDomainFactory.cs
- RtfControls.cs
- TypeUnloadedException.cs
- Ops.cs
- CssTextWriter.cs
- MailDefinitionBodyFileNameEditor.cs
- ModelChangedEventArgsImpl.cs
- SqlUtils.cs
- RetriableClipboard.cs
- XmlCharacterData.cs
- IndexedString.cs
- WrappedOptions.cs
- DispatcherEventArgs.cs
- ExitEventArgs.cs
- StreamUpgradeAcceptor.cs
- WebContext.cs
- ConfigurationPropertyAttribute.cs
- PenThread.cs
- StateDesigner.LayoutSelectionGlyph.cs
- TcpHostedTransportConfiguration.cs
- XmlReaderSettings.cs
- CompilerState.cs
- TriggerActionCollection.cs
- Object.cs
- CodeParameterDeclarationExpressionCollection.cs
- BreakRecordTable.cs
- OptionalColumn.cs
- DataGridViewControlCollection.cs
- Completion.cs
- NetworkStream.cs
- _LocalDataStoreMgr.cs
- DesignTimeTemplateParser.cs
- ScriptControlDescriptor.cs
- SemanticResolver.cs
- CultureMapper.cs
- UserControlParser.cs
- MenuStrip.cs
- FunctionImportMapping.cs
- MailWebEventProvider.cs
- XmlDataSourceNodeDescriptor.cs
- DataServiceQueryProvider.cs
- ResXResourceSet.cs
- SettingsContext.cs
- CaretElement.cs
- bindurihelper.cs
- SchemaMerger.cs
- CommandTreeTypeHelper.cs
- RelationalExpressions.cs
- CompressEmulationStream.cs
- MenuItem.cs
- RegexCapture.cs
- ViewStateModeByIdAttribute.cs
- TextEffectResolver.cs
- PermissionAttributes.cs
- FileDialog_Vista_Interop.cs
- TreeNodeCollection.cs
- ContextMarshalException.cs
- TextProperties.cs
- SkinBuilder.cs
- AppDomainProtocolHandler.cs
- WhitespaceRuleReader.cs
- AstTree.cs
- EUCJPEncoding.cs
- CompModSwitches.cs
- TypedOperationInfo.cs
- TreeViewDesigner.cs
- validation.cs
- ClientTargetCollection.cs
- ConstraintConverter.cs
- DecoderNLS.cs