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
- DiscoveryOperationContextExtension.cs
- ActivityTypeResolver.xaml.cs
- Message.cs
- PackageFilter.cs
- QilInvoke.cs
- SqlSelectStatement.cs
- CodePrimitiveExpression.cs
- ToolStripItemEventArgs.cs
- NullableBoolConverter.cs
- ApplicationTrust.cs
- Main.cs
- ZipIORawDataFileBlock.cs
- NoneExcludedImageIndexConverter.cs
- ToolboxItemFilterAttribute.cs
- MSAAWinEventWrap.cs
- BufferedResponseStream.cs
- COM2FontConverter.cs
- WorkflowWebHostingModule.cs
- WebSysDefaultValueAttribute.cs
- _ConnectStream.cs
- DoubleAnimationUsingPath.cs
- ViewStateException.cs
- NameValueConfigurationCollection.cs
- Hex.cs
- StrokeCollection2.cs
- RelationshipConverter.cs
- ReadContentAsBinaryHelper.cs
- ObjectDisposedException.cs
- EraserBehavior.cs
- EnumerationRangeValidationUtil.cs
- BindingElementExtensionElement.cs
- FtpWebRequest.cs
- ConfigurationElement.cs
- SystemDropShadowChrome.cs
- XamlSerializer.cs
- DesignRelation.cs
- SeparatorAutomationPeer.cs
- GlyphTypeface.cs
- SecurityUtils.cs
- Rijndael.cs
- ZipIOFileItemStream.cs
- HttpHeaderCollection.cs
- Light.cs
- MailMessageEventArgs.cs
- FacetValues.cs
- PointHitTestParameters.cs
- TargetParameterCountException.cs
- Number.cs
- TextSegment.cs
- IndexerNameAttribute.cs
- Opcode.cs
- TransactionScope.cs
- ProfileParameter.cs
- CommandBinding.cs
- DeclaredTypeElementCollection.cs
- MarkupCompiler.cs
- ResourceBinder.cs
- HyperLinkDesigner.cs
- ClientRolePrincipal.cs
- MemoryResponseElement.cs
- UserControlDesigner.cs
- DataTablePropertyDescriptor.cs
- DefaultPrintController.cs
- xsdvalidator.cs
- HtmlInputReset.cs
- DataTablePropertyDescriptor.cs
- URLString.cs
- ListParagraph.cs
- TrackingQuery.cs
- ListViewItemCollectionEditor.cs
- CellPartitioner.cs
- ClientTargetSection.cs
- AssemblyCollection.cs
- FunctionDescription.cs
- SoapFormatter.cs
- ViewManager.cs
- WebInvokeAttribute.cs
- SQLRoleProvider.cs
- DesignerFrame.cs
- HttpVersion.cs
- ManipulationLogic.cs
- SiteOfOriginContainer.cs
- StylusTip.cs
- XmlAtomicValue.cs
- MemberDescriptor.cs
- IPAddress.cs
- SiteMapDataSourceView.cs
- BamlRecordHelper.cs
- TextBox.cs
- SimpleWorkerRequest.cs
- WebResourceUtil.cs
- DesignerTransaction.cs
- HtmlImage.cs
- ElementUtil.cs
- unitconverter.cs
- __Filters.cs
- EncryptedKeyIdentifierClause.cs
- Compilation.cs
- ContentHostHelper.cs
- PrefixHandle.cs