Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- XmlAttributeProperties.cs
- LambdaCompiler.cs
- ListViewInsertionMark.cs
- Bitmap.cs
- InheritanceContextChangedEventManager.cs
- GlyphInfoList.cs
- MouseCaptureWithinProperty.cs
- infer.cs
- ellipse.cs
- RuleInfoComparer.cs
- ColumnWidthChangingEvent.cs
- MD5CryptoServiceProvider.cs
- ILGenerator.cs
- BuildResult.cs
- StorageBasedPackageProperties.cs
- CompatibleIComparer.cs
- DocumentXPathNavigator.cs
- ProfileService.cs
- QueuePropertyVariants.cs
- TextFormatterContext.cs
- SyndicationElementExtensionCollection.cs
- SqlRetyper.cs
- UpdateManifestForBrowserApplication.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- DispatcherExceptionFilterEventArgs.cs
- LayoutSettings.cs
- RadioButtonRenderer.cs
- XmlReader.cs
- NavigatingCancelEventArgs.cs
- MimeFormatter.cs
- ResourceSetExpression.cs
- DbConvert.cs
- PrimitiveXmlSerializers.cs
- HorizontalAlignConverter.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- DbParameterCollection.cs
- ArraySubsetEnumerator.cs
- BaseDataList.cs
- DesignerOptionService.cs
- FieldInfo.cs
- Trace.cs
- WebReferenceOptions.cs
- BitmapEffectCollection.cs
- AutomationIdentifier.cs
- EntityDataSourceDesignerHelper.cs
- AxisAngleRotation3D.cs
- DESCryptoServiceProvider.cs
- Site.cs
- ImageCodecInfoPrivate.cs
- FormattedText.cs
- HttpRuntime.cs
- CmsInterop.cs
- SQLBinaryStorage.cs
- FloaterParaClient.cs
- DataBoundLiteralControl.cs
- Path.cs
- CLRBindingWorker.cs
- CmsUtils.cs
- RegistryConfigurationProvider.cs
- DiscoveryClientRequestChannel.cs
- ToolboxCategoryItems.cs
- EventEntry.cs
- VisualProxy.cs
- BamlLocalizableResourceKey.cs
- XPathSelectionIterator.cs
- EntityClassGenerator.cs
- FormViewDeletedEventArgs.cs
- ImageCodecInfoPrivate.cs
- SqlBuilder.cs
- EntityContainer.cs
- PageRequestManager.cs
- DataPagerFieldCommandEventArgs.cs
- PrincipalPermission.cs
- SdlChannelSink.cs
- EntityDataSourceDesignerHelper.cs
- TypedTableBaseExtensions.cs
- FrameDimension.cs
- FileSystemEventArgs.cs
- PlainXmlWriter.cs
- SplitterCancelEvent.cs
- AnnotationObservableCollection.cs
- AnnotationResourceChangedEventArgs.cs
- TextTreeObjectNode.cs
- _SingleItemRequestCache.cs
- FilteredXmlReader.cs
- EmptyReadOnlyDictionaryInternal.cs
- Buffer.cs
- PropertyDescriptorComparer.cs
- MouseEventArgs.cs
- RequestQueue.cs
- AutoScrollHelper.cs
- ZipIOBlockManager.cs
- ScriptManagerProxy.cs
- OutKeywords.cs
- IdlingCommunicationPool.cs
- FormsAuthenticationEventArgs.cs
- BinaryReader.cs
- Panel.cs
- UserMapPath.cs
- XmlSchemaElement.cs