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
- MsmqInputChannelListener.cs
- BoolLiteral.cs
- StaticFileHandler.cs
- StringUtil.cs
- RadialGradientBrush.cs
- ListMarkerLine.cs
- PartEditor.cs
- XmlDataSourceView.cs
- ServiceHostingEnvironment.cs
- SHA384.cs
- DateTimeParse.cs
- LongPath.cs
- IfAction.cs
- CustomCredentialPolicy.cs
- Bitmap.cs
- EntryWrittenEventArgs.cs
- MarkupExtensionParser.cs
- WrappingXamlSchemaContext.cs
- DateTimeUtil.cs
- CqlIdentifiers.cs
- SafeIUnknown.cs
- TableParagraph.cs
- MediaTimeline.cs
- ProviderBase.cs
- StringValidator.cs
- XamlToRtfWriter.cs
- TextServicesCompartmentContext.cs
- GridViewItemAutomationPeer.cs
- XmlSchemaInferenceException.cs
- ChtmlImageAdapter.cs
- ContainerParagraph.cs
- SearchForVirtualItemEventArgs.cs
- DecodeHelper.cs
- TextBreakpoint.cs
- Pkcs7Recipient.cs
- SQLBinaryStorage.cs
- InputProcessorProfilesLoader.cs
- EtwTrace.cs
- ConfigurationSettings.cs
- PropertyIdentifier.cs
- CngAlgorithm.cs
- Model3DGroup.cs
- PrintPreviewDialog.cs
- ConfigXmlAttribute.cs
- HuffModule.cs
- RowParagraph.cs
- ProfileManager.cs
- InvalidStoreProtectionKeyException.cs
- PaintEvent.cs
- ListControl.cs
- EntityProviderFactory.cs
- ClonableStack.cs
- NotifyInputEventArgs.cs
- SafeNativeMemoryHandle.cs
- PolyBezierSegment.cs
- InputScope.cs
- ThaiBuddhistCalendar.cs
- Light.cs
- GridViewColumnCollectionChangedEventArgs.cs
- SourceLineInfo.cs
- MsmqVerifier.cs
- FileUtil.cs
- GB18030Encoding.cs
- DependentTransaction.cs
- DbDataSourceEnumerator.cs
- RoutedPropertyChangedEventArgs.cs
- AstNode.cs
- SimpleBitVector32.cs
- SymbolDocumentGenerator.cs
- _DynamicWinsockMethods.cs
- CodeCatchClause.cs
- StringCollectionMarkupSerializer.cs
- WebPageTraceListener.cs
- ValidationSummary.cs
- NetTcpSection.cs
- NameValuePair.cs
- ProcessModelInfo.cs
- SqlDataRecord.cs
- SettingsBase.cs
- SamlAudienceRestrictionCondition.cs
- SplitterEvent.cs
- DispatcherExceptionFilterEventArgs.cs
- EmbeddedMailObjectsCollection.cs
- TemplatePropertyEntry.cs
- Transform.cs
- SpeechEvent.cs
- ExpressionContext.cs
- NextPreviousPagerField.cs
- RijndaelCryptoServiceProvider.cs
- XNodeSchemaApplier.cs
- GridPattern.cs
- XmlSchema.cs
- SimpleTextLine.cs
- BuildManager.cs
- MessageBodyDescription.cs
- ConfigurationFileMap.cs
- DataGridViewImageCell.cs
- PackagingUtilities.cs
- StaticResourceExtension.cs
- PartialTrustVisibleAssembly.cs