Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- SafeProcessHandle.cs
- SiteMapPath.cs
- PerformanceCounterPermissionEntry.cs
- SystemIcons.cs
- CompilerCollection.cs
- CompilerParameters.cs
- RadioButtonAutomationPeer.cs
- WindowsScrollBarBits.cs
- ApplicationDirectoryMembershipCondition.cs
- ManagedWndProcTracker.cs
- OracleCommandSet.cs
- VisualStyleElement.cs
- HtmlEncodedRawTextWriter.cs
- Rotation3DAnimationBase.cs
- DataBoundControlAdapter.cs
- Select.cs
- XhtmlBasicPhoneCallAdapter.cs
- Asn1IntegerConverter.cs
- RightsManagementEncryptedStream.cs
- CodeValidator.cs
- UshortList2.cs
- ReadOnlyCollectionBuilder.cs
- ProcessModelInfo.cs
- NamespaceEmitter.cs
- X509Certificate2Collection.cs
- TableLayoutCellPaintEventArgs.cs
- Size3D.cs
- StateItem.cs
- DataGridViewRowHeaderCell.cs
- MenuEventArgs.cs
- PropertyDescriptorComparer.cs
- InputScopeConverter.cs
- MultilineStringConverter.cs
- DesignerAutoFormatStyle.cs
- OleCmdHelper.cs
- Positioning.cs
- XmlWellformedWriterHelpers.cs
- DecoderNLS.cs
- LocalValueEnumerator.cs
- SqlBooleanMismatchVisitor.cs
- smtpconnection.cs
- X509CertificateChain.cs
- InfocardChannelParameter.cs
- WebPartMenuStyle.cs
- ByteStorage.cs
- DataControlButton.cs
- XmlMapping.cs
- ExecutedRoutedEventArgs.cs
- BindingObserver.cs
- DataListCommandEventArgs.cs
- OracleString.cs
- StandardOleMarshalObject.cs
- PointLightBase.cs
- WebBaseEventKeyComparer.cs
- OleServicesContext.cs
- QueryableFilterRepeater.cs
- DataGridViewLinkColumn.cs
- NavigationPropertyEmitter.cs
- ProfileGroupSettingsCollection.cs
- RepeaterItem.cs
- DiscoveryServiceExtension.cs
- Menu.cs
- iisPickupDirectory.cs
- RtfControlWordInfo.cs
- MetadataCache.cs
- UIPropertyMetadata.cs
- HitTestDrawingContextWalker.cs
- Int64.cs
- PersonalizableTypeEntry.cs
- SinglePageViewer.cs
- DependencyObjectProvider.cs
- LinqDataSourceInsertEventArgs.cs
- SemanticAnalyzer.cs
- MemoryStream.cs
- SchemaEntity.cs
- DataGridViewMethods.cs
- InteropTrackingRecord.cs
- Control.cs
- DataGridAddNewRow.cs
- EntityException.cs
- SerializationObjectManager.cs
- HTMLTagNameToTypeMapper.cs
- TrackPoint.cs
- DBPropSet.cs
- SiteMapNodeItem.cs
- IndexOutOfRangeException.cs
- HwndSourceParameters.cs
- Parser.cs
- Aggregates.cs
- PropertyChangeTracker.cs
- GeometryDrawing.cs
- TransactionFlowAttribute.cs
- ImageFormat.cs
- BasicCellRelation.cs
- DefaultBindingPropertyAttribute.cs
- SystemInfo.cs
- CreateInstanceBinder.cs
- InternalControlCollection.cs
- Int32KeyFrameCollection.cs
- RadioButtonFlatAdapter.cs