Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- Trigger.cs
- ProxyWebPartConnectionCollection.cs
- Size.cs
- ToolBarOverflowPanel.cs
- NavigationProperty.cs
- TcpHostedTransportConfiguration.cs
- SchemaNamespaceManager.cs
- Point3DAnimationUsingKeyFrames.cs
- Cell.cs
- ConfigXmlWhitespace.cs
- KnownAssembliesSet.cs
- IIS7WorkerRequest.cs
- Coordinator.cs
- EventWaitHandleSecurity.cs
- GACIdentityPermission.cs
- arabicshape.cs
- TraceFilter.cs
- SharedPerformanceCounter.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- Propagator.ExtentPlaceholderCreator.cs
- XmlSchemaRedefine.cs
- Function.cs
- WebPartsPersonalizationAuthorization.cs
- StackSpiller.Bindings.cs
- ISCIIEncoding.cs
- CreateUserWizard.cs
- UpdateCompiler.cs
- ServicePoint.cs
- BitmapInitialize.cs
- _BaseOverlappedAsyncResult.cs
- LocatorManager.cs
- EnumType.cs
- NativeWindow.cs
- ZipIOLocalFileDataDescriptor.cs
- Validator.cs
- MailSettingsSection.cs
- DefaultTraceListener.cs
- SortAction.cs
- NamespaceList.cs
- Transform.cs
- BuildResult.cs
- SettingsProperty.cs
- ToolZone.cs
- FilterElement.cs
- XmlSchemaSimpleTypeRestriction.cs
- LayoutEvent.cs
- BitmapMetadataBlob.cs
- XhtmlCssHandler.cs
- TreeNode.cs
- XMLSchema.cs
- RadioButtonStandardAdapter.cs
- TypographyProperties.cs
- DecimalConstantAttribute.cs
- MailMessageEventArgs.cs
- InsufficientExecutionStackException.cs
- CultureTable.cs
- ComplexTypeEmitter.cs
- DataError.cs
- XamlStream.cs
- UnhandledExceptionEventArgs.cs
- IntegerValidator.cs
- DataStreamFromComStream.cs
- BitmapCacheBrush.cs
- UnaryNode.cs
- SqlVisitor.cs
- KnownBoxes.cs
- WindowProviderWrapper.cs
- WmfPlaceableFileHeader.cs
- CallSiteOps.cs
- CmsInterop.cs
- ChannelCacheSettings.cs
- StandardCommandToolStripMenuItem.cs
- HttpDictionary.cs
- AttributeProviderAttribute.cs
- regiisutil.cs
- SqlNotificationEventArgs.cs
- XsdBuildProvider.cs
- ToolStripActionList.cs
- CqlParserHelpers.cs
- Normalization.cs
- Command.cs
- AuthorizationSection.cs
- ProcessProtocolHandler.cs
- GeometryConverter.cs
- ObjectDataSource.cs
- Panel.cs
- ThreadStartException.cs
- XmlNamespaceManager.cs
- DbProviderConfigurationHandler.cs
- DataGridSortCommandEventArgs.cs
- ConsoleEntryPoint.cs
- PassportIdentity.cs
- AdornerLayer.cs
- TrackingQueryElement.cs
- SqlMetaData.cs
- XmlILIndex.cs
- StrokeCollectionDefaultValueFactory.cs
- AnimatedTypeHelpers.cs
- WindowsIdentity.cs
- MarkupCompiler.cs