Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / MS / Internal / Resources / ContentFileHelper.cs / 1305600 / 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
- ComPlusAuthorization.cs
- MatrixUtil.cs
- DataPagerFieldItem.cs
- PrintPreviewDialog.cs
- RuntimeConfigurationRecord.cs
- DetailsViewPageEventArgs.cs
- ListCollectionView.cs
- EastAsianLunisolarCalendar.cs
- DataServiceQueryOfT.cs
- PageResolution.cs
- SerializerDescriptor.cs
- MatrixUtil.cs
- SerTrace.cs
- DataGridViewCellStyle.cs
- DataKeyArray.cs
- Metafile.cs
- CompositeTypefaceMetrics.cs
- EmbeddedMailObjectsCollection.cs
- PointLight.cs
- TdsParserSafeHandles.cs
- XmlSchemaExporter.cs
- NumberAction.cs
- MenuBase.cs
- Emitter.cs
- MobileComponentEditorPage.cs
- PiiTraceSource.cs
- DesignerDataColumn.cs
- DataServiceQueryOfT.cs
- UInt64.cs
- LoginName.cs
- StructureChangedEventArgs.cs
- DataGridHelper.cs
- WebBrowsableAttribute.cs
- SystemColors.cs
- ObjectDisposedException.cs
- SmtpLoginAuthenticationModule.cs
- Formatter.cs
- DbProviderFactoriesConfigurationHandler.cs
- StatusBarItem.cs
- XmlnsCache.cs
- TraceEventCache.cs
- RtfToken.cs
- MethodAccessException.cs
- ArrayElementGridEntry.cs
- WebBrowser.cs
- ParallelEnumerable.cs
- datacache.cs
- CodeTypeReferenceExpression.cs
- DateTimeFormat.cs
- _ConnectionGroup.cs
- ConnectionInterfaceCollection.cs
- MatrixKeyFrameCollection.cs
- InstancePersistence.cs
- StylusPlugin.cs
- CategoryEditor.cs
- SafeTokenHandle.cs
- ContentFileHelper.cs
- Property.cs
- ClickablePoint.cs
- userdatakeys.cs
- BoundingRectTracker.cs
- StringUtil.cs
- AnnotationMap.cs
- SafeRightsManagementQueryHandle.cs
- WrappingXamlSchemaContext.cs
- DesignTimeTemplateParser.cs
- SafeNativeMethodsMilCoreApi.cs
- XsdDateTime.cs
- AdPostCacheSubstitution.cs
- NameValueCollection.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- Configuration.cs
- SystemWebSectionGroup.cs
- BufferModeSettings.cs
- ObjectContext.cs
- AutomationPatternInfo.cs
- ToolStripDesigner.cs
- CodeConditionStatement.cs
- InvokePattern.cs
- RegisterInfo.cs
- MasterPageParser.cs
- ThicknessKeyFrameCollection.cs
- MetabaseReader.cs
- XmlCountingReader.cs
- _IPv4Address.cs
- HtmlCommandAdapter.cs
- TransformerTypeCollection.cs
- BinaryParser.cs
- SqlConnectionPoolGroupProviderInfo.cs
- FillBehavior.cs
- Image.cs
- SqlFlattener.cs
- AsyncCodeActivity.cs
- PcmConverter.cs
- SpecialNameAttribute.cs
- GridViewColumnCollectionChangedEventArgs.cs
- XsltSettings.cs
- JournalEntryStack.cs
- Path.cs
- ChangeDirector.cs