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
- DispatcherTimer.cs
- WebBrowserBase.cs
- StringWriter.cs
- IDReferencePropertyAttribute.cs
- Filter.cs
- RoleServiceManager.cs
- SelectionUIService.cs
- RoleGroup.cs
- WebServiceData.cs
- SamlSecurityTokenAuthenticator.cs
- InputLanguageSource.cs
- SiteMembershipCondition.cs
- GridViewUpdateEventArgs.cs
- StagingAreaInputItem.cs
- HttpApplication.cs
- FixedSOMContainer.cs
- XmlBaseWriter.cs
- SslStreamSecurityElement.cs
- CssTextWriter.cs
- input.cs
- HScrollBar.cs
- VisualStates.cs
- GridViewCellAutomationPeer.cs
- MyContact.cs
- BuildResult.cs
- XmlDataSourceNodeDescriptor.cs
- ObjectStateEntryDbDataRecord.cs
- PasswordTextContainer.cs
- XmlElementAttribute.cs
- BindableAttribute.cs
- OutputCacheSettings.cs
- TemplatePropertyEntry.cs
- CompressionTransform.cs
- BulletedList.cs
- OleDbInfoMessageEvent.cs
- DesignerActionMethodItem.cs
- MessageQueuePermission.cs
- SpellerInterop.cs
- Rule.cs
- ConcatQueryOperator.cs
- XamlDesignerSerializationManager.cs
- WindowsToolbar.cs
- ProjectionCamera.cs
- CallbackException.cs
- WindowsButton.cs
- XmlAutoDetectWriter.cs
- IISMapPath.cs
- TypeUtil.cs
- XomlSerializationHelpers.cs
- TextReader.cs
- DataServiceRequestOfT.cs
- LineServicesRun.cs
- VectorCollectionConverter.cs
- RegistrationServices.cs
- Compilation.cs
- HtmlButton.cs
- SizeFConverter.cs
- TdsValueSetter.cs
- ResourceManager.cs
- WebPartChrome.cs
- LayoutInformation.cs
- PrimarySelectionGlyph.cs
- FieldNameLookup.cs
- WebContext.cs
- TimeManager.cs
- DynamicAttribute.cs
- ArrayTypeMismatchException.cs
- designeractionbehavior.cs
- AdPostCacheSubstitution.cs
- ComponentResourceKeyConverter.cs
- PrintDialog.cs
- DbConnectionFactory.cs
- RemotingSurrogateSelector.cs
- CollaborationHelperFunctions.cs
- SectionUpdates.cs
- FileCodeGroup.cs
- CustomSignedXml.cs
- HttpClientCertificate.cs
- Transform.cs
- XmlTextWriter.cs
- ExpressionConverter.cs
- ChameleonKey.cs
- ApplyImportsAction.cs
- HybridObjectCache.cs
- CalendarDateRange.cs
- ResXDataNode.cs
- ProviderConnectionPointCollection.cs
- LicenseManager.cs
- ScriptModule.cs
- NonClientArea.cs
- VersionedStream.cs
- MdImport.cs
- ReflectionHelper.cs
- GetPageCompletedEventArgs.cs
- SmtpClient.cs
- SelectQueryOperator.cs
- TypeBuilderInstantiation.cs
- XmlStrings.cs
- ScrollItemPattern.cs
- XamlPathDataSerializer.cs