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
- MLangCodePageEncoding.cs
- AtomParser.cs
- PageAction.cs
- SpotLight.cs
- RootBuilder.cs
- LexicalChunk.cs
- SqlNotificationEventArgs.cs
- HtmlForm.cs
- ListViewTableRow.cs
- GreenMethods.cs
- ApplicationDirectoryMembershipCondition.cs
- AuthenticationServiceManager.cs
- CategoryAttribute.cs
- controlskin.cs
- OverlappedAsyncResult.cs
- LogLogRecord.cs
- ProfileBuildProvider.cs
- CodeCatchClause.cs
- CodeSnippetExpression.cs
- TextRunTypographyProperties.cs
- SpellerInterop.cs
- RevocationPoint.cs
- Table.cs
- ProjectionPath.cs
- SingleKeyFrameCollection.cs
- WindowsIdentity.cs
- XmlEntityReference.cs
- Column.cs
- UndirectedGraph.cs
- StringWriter.cs
- PrimaryKeyTypeConverter.cs
- SByte.cs
- NameTable.cs
- DeviceContext2.cs
- CodeAccessSecurityEngine.cs
- Bold.cs
- ExpressionNode.cs
- AttributeQuery.cs
- SymbolDocumentInfo.cs
- MarkupWriter.cs
- EnglishPluralizationService.cs
- TextLine.cs
- StylusPointPropertyUnit.cs
- LabelEditEvent.cs
- StrokeCollectionDefaultValueFactory.cs
- ProcessModelInfo.cs
- WebControlAdapter.cs
- TableLayoutSettingsTypeConverter.cs
- SmtpNtlmAuthenticationModule.cs
- IsolatedStoragePermission.cs
- Classification.cs
- Section.cs
- XmlUTF8TextReader.cs
- PageOutputColor.cs
- WebScriptServiceHostFactory.cs
- BaseParagraph.cs
- SurrogateSelector.cs
- TimeSpanOrInfiniteValidator.cs
- VirtualDirectoryMappingCollection.cs
- RotateTransform.cs
- FixedSOMPageConstructor.cs
- StackSpiller.Temps.cs
- DirectionalLight.cs
- BasicExpressionVisitor.cs
- MailDefinition.cs
- DataGridViewCellStyle.cs
- Ticks.cs
- __Error.cs
- PagerSettings.cs
- ScriptControlDescriptor.cs
- GenericAuthenticationEventArgs.cs
- SchemaLookupTable.cs
- BaseTemplateBuildProvider.cs
- ChannelSinkStacks.cs
- FontClient.cs
- DbDataReader.cs
- ButtonFieldBase.cs
- NetTcpSectionData.cs
- XslAst.cs
- UserControlDocumentDesigner.cs
- SafePEFileHandle.cs
- ParagraphResult.cs
- RuleInfoComparer.cs
- ReadOnlyCollection.cs
- MultilineStringEditor.cs
- PreviewPageInfo.cs
- ConstructorArgumentAttribute.cs
- NativeMethods.cs
- MappingModelBuildProvider.cs
- SafeUserTokenHandle.cs
- VScrollProperties.cs
- ValueOfAction.cs
- SiteMapProvider.cs
- HandlerBase.cs
- ToolStripSystemRenderer.cs
- TransactedBatchingElement.cs
- FixedSOMPageConstructor.cs
- UndirectedGraph.cs
- DesignerProperties.cs
- BinaryFormatter.cs